chore: merge master

This commit is contained in:
zombiej 2021-11-26 10:15:39 +08:00
commit 24ec3ba662
75 changed files with 1062 additions and 652 deletions

View File

@ -1,5 +1,8 @@
blank_issues_enabled: true
contact_links:
- name: Create new issue
- name: 🆕 Create new issue
url: http://new-issue.ant.design
about: The issue which is not created via http://new-issue.ant.design will be closed immediately.
- name: 🆕 创建一个新 Issue
url: http://new-issue.ant.design
about: 不是用 http://new-issue.ant.design 创建的 issue 会被机器人自动关闭。另外『如何使用...』类问题建议使用讨论区 https://github.com/ant-design/ant-design/discussions

View File

@ -493,4 +493,7 @@ jobs:
- name: lessc component
run: npx lessc --js ./es/button/style/index.less
- name: lessc mixins
run: npx lessc --js ./es/style/mixins/index.less
needs: setup

2
.gitignore vendored
View File

@ -34,6 +34,8 @@ config/base.yaml
/coverage
yarn.lock
package-lock.json
pnpm-lock.yaml
.pnpm-debug.log
components/**/*.js
components/**/*.jsx
!components/**/__tests__/**/*.js

View File

@ -15,86 +15,137 @@ timeline: true
---
## 4.17.0-alpha.10
## 4.17.1
`2021-11-7`
`2021-11-22`
- 🚧 Move part `mixins` related less file to `themes` instead since it requires theme variable. We do not recommend use internal file but please note this if you already use it. [#32763](https://github.com/ant-design/ant-design/pull/32763)
- 🐞 Fix the problem that the bottom Drawer component has no animation. [#32761](https://github.com/ant-design/ant-design/pull/32761) [@solitia7125](https://github.com/solitia7125)
- 💄 Fix Steps `progressDot` style when it is `vertical`. [#32742](https://github.com/ant-design/ant-design/pull/32742)
- 💄 Fix Input set to `disabled` still keep focused style. [#32739](https://github.com/ant-design/ant-design/pull/32739)
- 🐞 Fix Typography ellipsis with `rows: 1` doesn't wrap after expanding. [#32735](https://github.com/ant-design/ant-design/pull/32735) [@hydraZty](https://github.com/hydraZty)
- 💄 Fix Table `loading` jumpy style when set `sticky`. [#32703](https://github.com/ant-design/ant-design/pull/32703) [@miloudbelaabed](https://github.com/miloudbelaabed)
- 🐞 Fix directly import `es/style/mixins/index.less` throw `Variable @root-entry-name is undefined` error. [#32887](https://github.com/ant-design/ant-design/pull/32887)
- 🐞 Fix Menu text color in collapsed tooltip. [#32956](https://github.com/ant-design/ant-design/pull/32956)
- 🐞 Fix Modal.method `bodyStyle` not working bug. [#32934](https://github.com/ant-design/ant-design/pull/32934) [@jin-benben](https://github.com/jin-benben)
- 🐞 Fix abnormal placeholder color. [#32915](https://github.com/ant-design/ant-design/pull/32915)
- 💄 Fix editable Tabs dropdown remove button style issue. [#32919](https://github.com/ant-design/ant-design/pull/32919)
- 🛠 Modal.confirm() Remove unnecessary `div` container. [#31492](https://github.com/ant-design/ant-design/pull/31492) [@ppbl](https://github.com/ppbl)
- 🛠 Remove unused css code for Drawer. [4ca6976](https://github.com/ant-design/ant-design/commit/4ca6976)
- 🛠 Use `@height-base` in PageHeader. [#32883](https://github.com/ant-design/ant-design/pull/32883)
- 🇵🇱 Added missing pl_PL translations. [#32896](https://github.com/ant-design/ant-design/pull/32896) [@MichalPodeszwa](https://github.com/MichalPodeszwa)
- TypeScript
- 🤖 Modify the type of Spin `tip` to ReactNode.. [#32733](https://github.com/ant-design/ant-design/pull/32733) [@tychenjiajun](https://github.com/tychenjiajun)
- 🤖 Remove unnecessary union types for ReactNode. [#32935](https://github.com/ant-design/ant-design/pull/32935) [@huangkairan](https://github.com/huangkairan)
- 🤖 Inherit `itemRender` typing from `rc-pagination`. [#32931](https://github.com/ant-design/ant-design/pull/32931) [@JounQin](https://github.com/JounQin)
## 4.17.0-alpha.9
## 4.17.0
`2021-10-31`
`2021-11-15`
- 🐞 Fix Collapse style issue when `expandIconPosition="right"`. [#32648](https://github.com/ant-design/ant-design/pull/32648)
- 🐞 Fix Upload broken loading style when `listStyle="picture"`. [#32664](https://github.com/ant-design/ant-design/pull/32664)
- 🐞 Fix Card `tabs` style when set `tabPosition: 'left'`. [#32695](https://github.com/ant-design/ant-design/pull/32695)
- 🐞 Avoid Input `placeholder` can be selected on Chrome. [#32639](https://github.com/ant-design/ant-design/pull/32639) [@cw1997](https://github.com/cw1997)
## 4.17.0-alpha.8
`2021-10-25`
- 🐞 Fix the text overflow when page zoomed in Typography with prop `ellipsis`. [#32496](https://github.com/ant-design/ant-design/pull/32496) [@hydraZty](https://github.com/hydraZty)
- 🐞 Fix Transfer throws `MenuItem should not leave undefined key` warning when opening selection dropdown menu. [#32578](https://github.com/ant-design/ant-design/pull/32578)
- 🐞 Fix Tree.DirectoryTree throws `TypeError:nativeEvent is undefined`. [#32551](https://github.com/ant-design/ant-design/pull/32551) [@D-to-the-K](https://github.com/D-to-the-K)
- 💄 Add box-shadow for jumper input in Pagination with `simple` props. [#32528](https://github.com/ant-design/ant-design/pull/32528) [@chen-jingjie](https://github.com/chen-jingjie)
- 💄 Table hover `rowSpan` row will highlight all the rows now. [#32557](https://github.com/ant-design/ant-design/pull/32557)
## 4.17.0-alpha.7
`2021-10-18`
- 🐞 Fix Radio cannot click due to custom `type` property. [#32463](https://github.com/ant-design/ant-design/pull/32463)
- 🐞 Input.TextArea `maxLength` is now passing to html textarea element. [#32448](https://github.com/ant-design/ant-design/pull/32448) [@MOHAMMADArsalan](https://github.com/MOHAMMADArsalan)
- 🐞 Fix Typography `ellipsis` calculation bug when browser zoomed in. [#32447](https://github.com/ant-design/ant-design/pull/32447)
- 💄 Adjust Collapse header style to make title overflow wrap not take arrow position. [#32492](https://github.com/ant-design/ant-design/pull/32492)
- 💄 Optimize the text weight in Select. [#32486](https://github.com/ant-design/ant-design/pull/32486) [@liuxulian](https://github.com/liuxulian)
- TypeScript
- 🤖 Fix Message duration type definition. [#32524](https://github.com/ant-design/ant-design/pull/32524) [@chen-jingjie](https://github.com/chen-jingjie)
## 4.17.0-alpha.6
`2021-10-11`
- 🐞 Fix InputNumber handler arrow not align center. [#32409](https://github.com/ant-design/ant-design/pull/32409)
- 🐞 Fix `closeIcon` not working bug when Notification is called multiple times. [#32359](https://github.com/ant-design/ant-design/pull/32359) [@KAROTT7](https://github.com/KAROTT7)
- 🐞 Fix Button align issue with `icon` and `href`. [#32373](https://github.com/ant-design/ant-design/pull/32373)
- 💄 Optimize Drawer open animation. [#32342](https://github.com/ant-design/ant-design/pull/32342)
- 💄 Fix Mentions error style in Form. [#32385](https://github.com/ant-design/ant-design/pull/32385)
- TypeScript
- 🤖 Fix args type for `getPopupContainer` in ConfigProvider. [#32406](https://github.com/ant-design/ant-design/pull/32406) [@mtadams007](https://github.com/mtadams007)
## 4.17.0-alpha.5
`2021-09-30`
- 🆕 Tree `draggable` add handler for tips. [#32306](https://github.com/ant-design/ant-design/pull/32306)
- 🐞 Fix Table selection column arrow get covered by fixed column. [#32276](https://github.com/ant-design/ant-design/pull/32276) [@g7i](https://github.com/g7i)
- TypeScript
- 🐞 Fix Table missing generic type definition. [#32358](https://github.com/ant-design/ant-design/pull/32358)
## 4.17.0-alpha.4
`2021-09-25`
- 🐞 Fix `Ok` abbreviation to be `OK`. [#32259](https://github.com/ant-design/ant-design/pull/32259) [@chj-damon](https://github.com/chj-damon)
- 🐞 Fix `antd.variable.less` compile mix with default theme variable. [#32279](https://github.com/ant-design/ant-design/pull/32279)
- Button
- 🐞 Fix Button with `ghost` hover style. [#32289](https://github.com/ant-design/ant-design/pull/32289)
- 🐞 Fix Button with `loading` can not trigger Tooltip. [#32158](https://github.com/ant-design/ant-design/pull/32158)
- Dynamic Theme Theme
- 🔥 ConfigProvider support dynamic modify theme color. [view detail](/docs/react/customize-theme-variable). [#31496](https://github.com/ant-design/ant-design/pull/31496)
- 🚧 Move part `mixins` related less file to `themes` instead since it requires theme variable. We do not recommend use internal file but please note this if you already use it. [#32763](https://github.com/ant-design/ant-design/pull/32763)
- 🐞 Fix `antd.variable.less` compile mix with default theme variable. [#32279](https://github.com/ant-design/ant-design/pull/32279)
- 🐞 Fix antd compile file miss `/style/default.css`. [#32116](https://github.com/ant-design/ant-design/pull/32116)
- 🐞 Fix less compile `antd.xxx.less` throw the `Maximum call stack size exceeded error`. [#32063](https://github.com/ant-design/ant-design/pull/32063)
- Input
- 🐞 Fix Input.Search `border-left-radius` is not 0 when configured with `allowClear` and `addonBefore`. [#32812](https://github.com/ant-design/ant-design/pull/32812) [@KAROTT7](https://github.com/KAROTT7)
- 🐞 Fix Input set to `disabled` still keep focused style. [#32739](https://github.com/ant-design/ant-design/pull/32739)
- 🐞 Avoid Input `placeholder` can be selected on Chrome. [#32639](https://github.com/ant-design/ant-design/pull/32639) [@cw1997](https://github.com/cw1997)
- 🐞 Input.TextArea `maxLength` is now passing to html textarea element. [#32448](https://github.com/ant-design/ant-design/pull/32448) [@MOHAMMADArsalan](https://github.com/MOHAMMADArsalan)
- 🐞 Fix Input cannot clear content when focus it. [#31931](https://github.com/ant-design/ant-design/pull/31931) [@adaex](https://github.com/adaex)
- Cascader
- 🔥 Cascader support `multiple` mode. [#31936](https://github.com/ant-design/ant-design/pull/31936)
- 🆕 Cascader add `title` prop with content by default. [#31237](https://github.com/ant-design/ant-design/pull/31237) [@yingpengsha](https://github.com/yingpengsha)
- 🐞 Fix Cascader missing `popupClassName` and `popupPlacement` props. [#32143](https://github.com/ant-design/ant-design/pull/32143)
- Select
- 🆕 Select support `placement`. [#32143](https://github.com/ant-design/ant-design/pull/32143)
- 🆕 Select support `fieldNames`. [#31925](https://github.com/ant-design/ant-design/pull/31925)
- 🆕 Select support `ctrl + n/p` on mac. [#650](https://github.com/react-component/select/pull/650)
- 🆕 Select add `title` for tag in `multiple` mode. [#637](https://github.com/react-component/select/pull/637)
- 💄 Optimize the text weight in Select. [#32486](https://github.com/ant-design/ant-design/pull/32486) [@liuxulian](https://github.com/liuxulian)
- TreeSelect
- 🆕 TreeSelect support `placement`. [#32143](https://github.com/ant-design/ant-design/pull/32143)
- 🆕 TreeSelect support `fieldNames`. [#31925](https://github.com/ant-design/ant-design/pull/31925)
- Tree
- 🆕 Tree `draggable` add handler for tips. [#32306](https://github.com/ant-design/ant-design/pull/32306)
- 🆕 Tree support `fieldNames` to customize node field name. [#31395](https://github.com/ant-design/ant-design/pull/31395)
- 🆕 Tree support `onScroll` in virtual scroll. [#474](https://github.com/react-component/tree/pull/474)
- 🐞 Fix Tree icon align bug when `showLine` is enable. [#32822](https://github.com/ant-design/ant-design/pull/32822)
- 🐞 Fix Tree.DirectoryTree throws `TypeError:nativeEvent is undefined`. [#32551](https://github.com/ant-design/ant-design/pull/32551) [@D-to-the-K](https://github.com/D-to-the-K)
- 🐞 Fix Tree drop outside not clear indicator. [#478](https://github.com/react-component/tree/pull/478)
- 💄 Fix 1px position deviation of the Tree connection line when zooming in. [#32075](https://github.com/ant-design/ant-design/pull/32075) [@btea](https://github.com/btea)
- PageHeader
- 🐞 Fix PageHeader with false 'breadcrumbrender' still shows dom. [#32738](https://github.com/ant-design/ant-design/pull/32738)
- Form
- 🔥 Form `rule` support `warningOnly` to avoid form submit. [#30829](https://github.com/ant-design/ant-design/pull/30829)
- 🆕 Form.ErrorList support customize `className`. [#30887](https://github.com/ant-design/ant-design/pull/30887)
- 🐞 Fix Form breaks the line when Select content too long. [#32778](https://github.com/ant-design/ant-design/pull/32778)
- 💄 Fix Mentions error style in Form. [#32385](https://github.com/ant-design/ant-design/pull/32385)
- Drawer
- 🆕 Tweak Drawer close icon position and default width, add `extra` and `size` props. [#30908](https://github.com/ant-design/ant-design/pull/30908)
- 🆕 Drawer support `autoFocus` prop. [#181](https://github.com/react-component/drawer/pull/181)
- 🐞 Fix the problem that the bottom Drawer component has no animation. [#32761](https://github.com/ant-design/ant-design/pull/32761) [@solitia7125](https://github.com/solitia7125)
- 💄 Optimize Drawer open animation. [#32342](https://github.com/ant-design/ant-design/pull/32342)
- Steps
- 🐞 Fix Steps `progressDot` style when it is `vertical`. [#32742](https://github.com/ant-design/ant-design/pull/32742)
- 🐞 Fix Steps default responsive style not working. [#31965](https://github.com/ant-design/ant-design/pull/31965) [@tangjinzhou](https://github.com/tangjinzhou)
- Typography
- 🐞 Fix Typography ellipsis with `rows: 1` doesn't wrap after expanding. [#32735](https://github.com/ant-design/ant-design/pull/32735) [@hydraZty](https://github.com/hydraZty)
- 🐞 Fix the text overflow when page zoomed in Typography with prop `ellipsis`. [#32496](https://github.com/ant-design/ant-design/pull/32496) [@hydraZty](https://github.com/hydraZty)
- 🐞 Fix Typography `ellipsis` calculation bug when browser zoomed in. [#32447](https://github.com/ant-design/ant-design/pull/32447)
- Table
- 🔥 Table adds `column.filterMode` to support filter in a tree, which could set to `'menu' | 'tree'`. [#31809](https://github.com/ant-design/ant-design/pull/31809)
- 🔥 Table adds `column.filterSearch` for enable search function in filter dropdown. [#31809](https://github.com/ant-design/ant-design/pull/31809)
- 🆕 Table hover `rowSpan` row will highlight all the rows now. [#32557](https://github.com/ant-design/ant-design/pull/32557)
- 🐞 Fix Table selection column arrow get covered by fixed column. [#32276](https://github.com/ant-design/ant-design/pull/32276) [@g7i](https://github.com/g7i)
- 🐞 Fix Table `loading` jumpy style when set `sticky`. [#32703](https://github.com/ant-design/ant-design/pull/32703) [@miloudbelaabed](https://github.com/miloudbelaabed)
- 🐞 Fix Table don't support `ref`. [#32136](https://github.com/ant-design/ant-design/pull/32136) [@JounQin](https://github.com/JounQin)
- 🐞 Table remove `sticky` style with fixed column in IE11 to avoid layout issue. [#32177](https://github.com/ant-design/ant-design/pull/32177)
- 💄 Optimize Table sorter icon margin problem. [#32172](https://github.com/ant-design/ant-design/pull/32172)
- 🐞 Fix Table.SELECT_XXX ignore record `disabled` status by `getCheckboxProps`. [#32027](https://github.com/ant-design/ant-design/pull/32027)
- 💄 Table filter reset button won't close dropdown now. [#31809](https://github.com/ant-design/ant-design/pull/31809)
- 🐞 Revert Table sticky `z-index` style back to `calc` instead of less calculation to fix `auto` style failure. [#31874](https://github.com/ant-design/ant-design/pull/31874) [@bconnorwhite](https://github.com/bconnorwhite)
- 🐞 Fix Table scroll bar display issue when data dynamic changed. [#647](https://github.com/react-component/table/pull/647) [@lanten](https://github.com/lanten)
- 🐞 Fix `pagination.className` not working in Table. [#32131](https://github.com/ant-design/ant-design/pull/32131) [@JounQin](https://github.com/JounQin)
- Transfer
- 🆕 Transfer support custom left and right `footer`. [#31108](https://github.com/ant-design/ant-design/pull/31108)
- 🆕 Transfer supports `locale.notFoundContent` with array. [#31088](https://github.com/ant-design/ant-design/pull/31088) [@wwyx778](https://github.com/wwyx778)
- 🐞 Fix Transfer throws `MenuItem should not leave undefined key` warning when opening selection dropdown menu. [#32578](https://github.com/ant-design/ant-design/pull/32578)
- 💄 Tweak Transfer filter search input icon position. [#31809](https://github.com/ant-design/ant-design/pull/31809)
- Collapse
- 🐞 Fix Collapse style issue when `expandIconPosition="right"`. [#32648](https://github.com/ant-design/ant-design/pull/32648)
- 💄 Adjust Collapse header style to make title overflow wrap not take arrow position. [#32492](https://github.com/ant-design/ant-design/pull/32492)
- Button
- 🐞 Fix Button with `ghost` hover style. [#32289](https://github.com/ant-design/ant-design/pull/32289)
- 🐞 Fix Button with `loading` can not trigger Tooltip. [#32158](https://github.com/ant-design/ant-design/pull/32158)
- 🐞 Fix Button align issue with `icon` and `href`. [#32373](https://github.com/ant-design/ant-design/pull/32373)
- Pagination
- 🆕 Pagination supports `selectComponentClass` prop. [#32132](https://github.com/ant-design/ant-design/pull/32132) [@JounQin](https://github.com/JounQin)
- 💄 Add box-shadow for jumper input in Pagination with `simple` props. [#32528](https://github.com/ant-design/ant-design/pull/32528) [@chen-jingjie](https://github.com/chen-jingjie)
- Upload
- 🐞 Fix Upload broken loading style when `listStyle="picture"`. [#32664](https://github.com/ant-design/ant-design/pull/32664)
- 🐞 Fix Upload icon error background. [#32051](https://github.com/ant-design/ant-design/pull/32051)
- InputNumber
- 🔥 InputNumber support `addonBefore` and `addonAfter`. [#31432](https://github.com/ant-design/ant-design/pull/31432) [@Austaras](https://github.com/Austaras)
- 🆕 InputNumber now supports `controls` for displaying `+-` buttons or not. [#31548](https://github.com/ant-design/ant-design/pull/31548)
- 🆕 InputNumber `formatter` support additional param to check if current input is user typing. [#31030](https://github.com/ant-design/ant-design/pull/31030)
- 🐞 Fix InputNumber handler arrow not align center. [#32409](https://github.com/ant-design/ant-design/pull/32409)
- 💄 Show InputNumber handler when focus it. [#31911](https://github.com/ant-design/ant-design/pull/31911)
- DatePicker
- 🆕 `DatePicker` and `RangePicker` now support `nextIcon`, `prevIcon`, `superNextIcon` and `superPrevIcon`. [#31703](https://github.com/ant-design/ant-design/pull/31703) [@Oreoz](https://github.com/Oreoz)
- 🐞 Fix `defaultPickerValue` not working in RangePicker. [#32107](https://github.com/ant-design/ant-design/pull/32107) [@thommesZip](https://github.com/thommesZip)
- Notification
- 🆕 Notification support `maxCount` to limit count. [#31807](https://github.com/ant-design/ant-design/pull/31807) [@binyellow](https://github.com/binyellow)
- 🐞 Fix `closeIcon` not working bug when Notification is called multiple times. [#32359](https://github.com/ant-design/ant-design/pull/32359) [@KAROTT7](https://github.com/KAROTT7)
- 🆕 Menu.Divider support `dashed` style. [#31379](https://github.com/ant-design/ant-design/pull/31379) [@Map1en](https://github.com/Map1en)
- 🆕 Skeleton.Button add `block` prop. [#30902](https://github.com/ant-design/ant-design/pull/30902) [@Jehu](https://github.com/Jehu)
- 🆕 Popconfirm `onConfirm` supports Promise. [#30871](https://github.com/ant-design/ant-design/pull/30871) [@wendellhu95](https://github.com/wendellhu95)
- 🐞 Fix Card `tabs` style when set `tabPosition: 'left'`. [#32695](https://github.com/ant-design/ant-design/pull/32695)
- 🐞 Fix Radio cannot click due to custom `type` property. [#32463](https://github.com/ant-design/ant-design/pull/32463)
- 🐞 Fix `Ok` abbreviation to be `OK`. [#32259](https://github.com/ant-design/ant-design/pull/32259) [@chj-damon](https://github.com/chj-damon)
- 🐞 Fix Grid Col `flex` some time exceed its width when content too long. [#32160](https://github.com/ant-design/ant-design/pull/32160)
- 🐞 Fix Switch Loading icon in an incorrect position. [#32216](https://github.com/ant-design/ant-design/pull/32216)
- 🐞 Fix return element of `getPopupContainer` in ConfigProvider is not used as a container when calling `message.useMessage`. [#31939](https://github.com/ant-design/ant-design/pull/31939) [@DaoxingHuang](https://github.com/DaoxingHuang)
- 💄 Improve small size Image by ellipsising preview text. [#29900](https://github.com/ant-design/ant-design/pull/29900) [@drizzlesconsin](https://github.com/drizzlesconsin)
- 🐞 Fix Alert extra dom node when `message` is `undefined`. [#32057](https://github.com/ant-design/ant-design/pull/32057)
- 🐞 Fix anchor `targetOffset` not work when contain spaces. [#31952](https://github.com/ant-design/ant-design/pull/31952) [@adaex](https://github.com/adaex)
- 💄 Add `@checkbox-border-radius` less variable. [#31360](https://github.com/ant-design/ant-design/pull/31360) [@Gherciu](https://github.com/Gherciu)
- 🐞 Avatar add `crossOrigin` property to resolve cross origin issue. [#31273](https://github.com/ant-design/ant-design/pull/31273) [@Map1en](https://github.com/Map1en)
- RTL
- 💄 Optimized Alert close icon display in RTL mode. [#32286](https://github.com/ant-design/ant-design/pull/32286)
- 💄 Optimized Table header action display in RTL mode. [#32283](https://github.com/ant-design/ant-design/pull/32283)
@ -102,101 +153,25 @@ timeline: true
- 💄 Optimized Badge count display and animation in RTL mode. [#32281](https://github.com/ant-design/ant-design/pull/32281)
- 💄 Optimized InputNumber handler border style in RTL mode. [#32272](https://github.com/ant-design/ant-design/pull/32272)
- 💄 Optimized Dropdown icon display in RTL mode. [#32271](https://github.com/ant-design/ant-design/pull/32271)
- TypeScript
- 🐞 Fix Switch missing `id` property. [#32237](https://github.com/ant-design/ant-design/pull/32237) [@M-ZubairAhmed](https://github.com/M-ZubairAhmed)
## 4.17.0-alpha.3
`2021-09-14`
- 🆕 Pagination supports `selectComponentClass` prop. [#32132](https://github.com/ant-design/ant-design/pull/32132) [@JounQin](https://github.com/JounQin)
- 🆕 Tree and TreeSelect support `placement`. [#32143](https://github.com/ant-design/ant-design/pull/32143)
- 🐞 Fix Cascader missing `popupClassName` and `popupPlacement` props. [#32143](https://github.com/ant-design/ant-design/pull/32143)
- 🐞 Fix return element of `getPopupContainer` in ConfigProvider is not used as a container when calling `message.useMessage`. [#31939](https://github.com/ant-design/ant-design/pull/31939) [@DaoxingHuang](https://github.com/DaoxingHuang)
- 🐞 Fix `pagination.className` not working in Table. [#32131](https://github.com/ant-design/ant-design/pull/32131) [@JounQin](https://github.com/JounQin)
- 🐞 Fix `defaultPickerValue` not working in RangePicker. [#32107](https://github.com/ant-design/ant-design/pull/32107) [@thommesZip](https://github.com/thommesZip)
- 🐞 Fix antd compile file miss `/style/default.css`. [#32116](https://github.com/ant-design/ant-design/pull/32116)
- 💄 Fix 1px position deviation of the Tree connection line when zooming in. [#32075](https://github.com/ant-design/ant-design/pull/32075) [@btea](https://github.com/btea)
- 💄 Improve small size Image by ellipsising preview text. [#29900](https://github.com/ant-design/ant-design/pull/29900) [@drizzlesconsin](https://github.com/drizzlesconsin)
- 🇬🇪 Add Georgian locale. [#32106](https://github.com/ant-design/ant-design/pull/32106) [@PrimulaX](https://github.com/PrimulaX)
- TypeScript
- 🤖 Fix `type` type for Button. [#32004](https://github.com/ant-design/ant-design/pull/32004) [@jaredleechn](https://github.com/jaredleechn)
- 🤖 Improve type `locale` for Pagination. [#32128](https://github.com/ant-design/ant-design/pull/32128) [@JounQin](https://github.com/JounQin)
- 🤖 Improve and export `DropdownButtonType` type for DropdownButton [[#31957](https://github.com/ant-design/ant-design/pull/31957) [@Dreamerryao](https://github.com/Dreamerryao)
## 4.17.0-alpha.2
`2021-09-07`
- 🐞 Fix Alert extra dom node when `message` is `undefined`. [#32057](https://github.com/ant-design/ant-design/pull/32057)
- 🐞 Fix Upload icon error background. [#32051](https://github.com/ant-design/ant-design/pull/32051)
- 🐞 Fix less compile `antd.xxx.less` throw the `Maximum call stack size exceeded error`. [#32063](https://github.com/ant-design/ant-design/pull/32063)
- TypeScript
- 🤖 Adjust List `rowKey` type to React.key. [#32033](https://github.com/ant-design/ant-design/pull/32033) [@lironhl](https://github.com/lironhl)
## 4.17.0-alpha.1
`2021-09-06`
- 🐞 Fix Table.SELECT_XXX ignore record `disabled` status by `getCheckboxProps`. [#32027](https://github.com/ant-design/ant-design/pull/32027)
- TypeScript
- 🐞 Fix DatePicker `ref` typing. [#31993](https://github.com/ant-design/ant-design/pull/31993) [@acfasj](https://github.com/acfasj)
- 🤖 Update the `levelMove` type definition in Drawer. [#30714](https://github.com/ant-design/ant-design/pull/30714) [@g0shed](https://github.com/g0shed)
- 🌐 Localization
- 🇩🇪 Added Image translation in de_DE. [#32001](https://github.com/ant-design/ant-design/pull/32001) [@Chtau](https://github.com/Chtau)
## 4.17.0-alpha.0
`2021-09-01`
- 🔥 ConfigProvider support dynamic modify theme color. [view detail](/docs/react/customize-theme-variable). [#31496](https://github.com/ant-design/ant-design/pull/31496)
- Table
- 🔥 Table adds `column.filterMode` to support filter in a tree, which could set to `'menu' | 'tree'`. [#31809](https://github.com/ant-design/ant-design/pull/31809)
- 🔥 Table adds `column.filterSearch` for enable search function in filter dropdown. [#31809](https://github.com/ant-design/ant-design/pull/31809)
- 💄 Table filter reset button won't close dropdown now. [#31809](https://github.com/ant-design/ant-design/pull/31809)
- 💄 Tweak Transfer filter search input icon position. [#31809](https://github.com/ant-design/ant-design/pull/31809)
- 🐞 Revert Table sticky `z-index` style back to `calc` instead of less calculation to fix `auto` style failure. [#31874](https://github.com/ant-design/ant-design/pull/31874) [@bconnorwhite](https://github.com/bconnorwhite)
- 🐞 Fix Table scroll bar display issue when data dynamic changed. [#647](https://github.com/react-component/table/pull/647) [@lanten](https://github.com/lanten)
- Cascader
- 🔥 Cascader support `multiple` mode. [#31936](https://github.com/ant-design/ant-design/pull/31936)
- 🆕 Cascader add `title` prop with content by default. [#31237](https://github.com/ant-design/ant-design/pull/31237) [@yingpengsha](https://github.com/yingpengsha)
- 🐞 Fix Steps default responsive style not working. [#31965](https://github.com/ant-design/ant-design/pull/31965) [@tangjinzhou](https://github.com/tangjinzhou)
- InputNumber
- 🔥 InputNumber support `addonBefore` and `addonAfter`. [#31432](https://github.com/ant-design/ant-design/pull/31432) [@Austaras](https://github.com/Austaras)
- 💄 Show InputNumber handler when focus it. [#31911](https://github.com/ant-design/ant-design/pull/31911)
- 🆕 InputNumber now supports `controls` for displaying `+-` buttons or not. [#31548](https://github.com/ant-design/ant-design/pull/31548)
- 🆕 InputNumber `formatter` support additional param to check if current input is user typing. [#31030](https://github.com/ant-design/ant-design/pull/31030)
- 🐞 Fix Input cannot clear content when focus it. [#31931](https://github.com/ant-design/ant-design/pull/31931) [@adaex](https://github.com/adaex)
- 🐞 Fix anchor `targetOffset` not work when contain spaces. [#31952](https://github.com/ant-design/ant-design/pull/31952) [@adaex](https://github.com/adaex)
- 🆕 TreeSelect and Select support `fieldNames`. [#31925](https://github.com/ant-design/ant-design/pull/31925)
- Select
- 🆕 Select support `ctrl + n/p` on mac. [#650](https://github.com/react-component/select/pull/650)
- 🆕 Select add `title` for tag in `multiple` mode. [#637](https://github.com/react-component/select/pull/637)
- Transfer
- 🐞 Fix Transfer list `direction` value in RTL mode. [#31903](https://github.com/ant-design/ant-design/pull/31903)
- 🆕 Transfer support custom left and right `footer`. [#31108](https://github.com/ant-design/ant-design/pull/31108)
- 🆕 Transfer supports `locale.notFoundContent` with array. [#31088](https://github.com/ant-design/ant-design/pull/31088) [@wwyx778](https://github.com/wwyx778)
- 🆕 `DatePicker` and `RangePicker` now support `nextIcon`, `prevIcon`, `superNextIcon` and `superPrevIcon`. [#31703](https://github.com/ant-design/ant-design/pull/31703) [@Oreoz](https://github.com/Oreoz)
- 🆕 Notification support `maxCount` to limit count. [#31807](https://github.com/ant-design/ant-design/pull/31807) [@binyellow](https://github.com/binyellow)
- 🆕 Menu.Divider support `dashed` style. [#31379](https://github.com/ant-design/ant-design/pull/31379) [@Map1en](https://github.com/Map1en)
- Tree
- 🆕 Tree support `fieldNames` to customize node field name. [#31395](https://github.com/ant-design/ant-design/pull/31395)
- 🆕 Tree support `onScroll` in virtual scroll. [#474](https://github.com/react-component/tree/pull/474)
- 🐞 Fix Tree drop outside not clear indicator. [#478](https://github.com/react-component/tree/pull/478)
- 💄 Add `@checkbox-border-radius` less variable. [#31360](https://github.com/ant-design/ant-design/pull/31360) [@Gherciu](https://github.com/Gherciu)
- 🐞 Avatar add `crossOrigin` property to resolve cross origin issue. [#31273](https://github.com/ant-design/ant-design/pull/31273) [@Map1en](https://github.com/Map1en)
- Drawer
- 🆕 Tweak Drawer close icon position and default width, add `extra` and `size` props. [#30908](https://github.com/ant-design/ant-design/pull/30908)
- 🆕 Drawer support `autoFocus` prop. [#181](https://github.com/react-component/drawer/pull/181)
- 🆕 Skeleton.Button add `block` prop. [#30902](https://github.com/ant-design/ant-design/pull/30902) [@Jehu](https://github.com/Jehu)
- 🆕 Popconfirm `onConfirm` supports Promise. [#30871](https://github.com/ant-design/ant-design/pull/30871) [@wendellhu95](https://github.com/wendellhu95)
- Form
- 🆕 Form.ErrorList support customize `className`. [#30887](https://github.com/ant-design/ant-design/pull/30887)
- 🔥 Form `rule` support `warningOnly` to avoid form submit. [#30829](https://github.com/ant-design/ant-design/pull/30829)
- 🌐 Localization
- 🇬🇪 Add Georgian locale. [#32106](https://github.com/ant-design/ant-design/pull/32106) [@PrimulaX](https://github.com/PrimulaX)
- 🇩🇪 Added Image translation in de_DE. [#32001](https://github.com/ant-design/ant-design/pull/32001) [@Chtau](https://github.com/Chtau)
- 🇮🇳 Added Malayalam (ml_IN) locale. [#31521](https://github.com/ant-design/ant-design/pull/31521) [@khjabir](https://github.com/khjabir)
- 🇵🇰 Added Urdu language (ur_PK) locale. [#31346](https://github.com/ant-design/ant-design/pull/31346) [@MuhammadAnas190](https://github.com/MuhammadAnas190)
- 🇧🇩 Added bn_BD (Bangla) locale. [#31257](https://github.com/ant-design/ant-design/pull/31257) [@AminulBD](https://github.com/AminulBD)
- TypeScript
- 🤖 Modify the type of Spin `tip` to ReactNode.. [#32733](https://github.com/ant-design/ant-design/pull/32733) [@tychenjiajun](https://github.com/tychenjiajun)
- 🤖 Fix Message duration type definition. [#32524](https://github.com/ant-design/ant-design/pull/32524) [@chen-jingjie](https://github.com/chen-jingjie)
- 🤖 Fix args type for `getPopupContainer` in ConfigProvider. [#32406](https://github.com/ant-design/ant-design/pull/32406) [@mtadams007](https://github.com/mtadams007)
- 🐞 Fix Table missing generic type definition. [#32358](https://github.com/ant-design/ant-design/pull/32358)
- 🐞 Fix Switch missing `id` property. [#32237](https://github.com/ant-design/ant-design/pull/32237) [@M-ZubairAhmed](https://github.com/M-ZubairAhmed)
- 🤖 Fix `type` type for Button. [#32004](https://github.com/ant-design/ant-design/pull/32004) [@jaredleechn](https://github.com/jaredleechn)
- 🤖 Improve type `locale` for Pagination. [#32128](https://github.com/ant-design/ant-design/pull/32128) [@JounQin](https://github.com/JounQin)
- 🤖 Improve and export `DropdownButtonType` type for DropdownButton [[#31957](https://github.com/ant-design/ant-design/pull/31957) [@Dreamerryao](https://github.com/Dreamerryao)
- 🤖 Adjust List `rowKey` type to React.key. [#32033](https://github.com/ant-design/ant-design/pull/32033) [@lironhl](https://github.com/lironhl)
- 🐞 Fix DatePicker `ref` typing. [#31993](https://github.com/ant-design/ant-design/pull/31993) [@acfasj](https://github.com/acfasj)
- 🤖 Update the `levelMove` type definition in Drawer. [#30714](https://github.com/ant-design/ant-design/pull/30714) [@g0shed](https://github.com/g0shed)
## 4.16.13

View File

@ -15,86 +15,137 @@ timeline: true
---
## 4.17.0-alpha.10
## 4.17.1
`2021-11-7`
`2021-11-22`
- 🚧 移动部分 `mixins` less 文件到 `themes` 文件下,因为它们依赖于主题相关变量。我们不推荐直接引用底层 less 文件,但是如果你使用了请注意这部分变更。[#32763](https://github.com/ant-design/ant-design/pull/32763)
- 🐞 修复底部 Drawer 组件没有动画的问题。[#32761](https://github.com/ant-design/ant-design/pull/32761) [@solitia7125](https://github.com/solitia7125)
- 💄 修复 Steps 垂直 `progressDot` 的对齐样式问题。[#32742](https://github.com/ant-design/ant-design/pull/32742)
- 💄 修复 Input 设置 `disabled` 时仍然保留聚焦样式的问题。[#32739](https://github.com/ant-design/ant-design/pull/32739)
- 🐞 修复 Typography 在单行折叠时展开后不换行。[#32735](https://github.com/ant-design/ant-design/pull/32735) [@hydraZty](https://github.com/hydraZty)
- 💄 修复 Table 设置 `sticky` 的时候 `loading` 样式跳动的问题。[#32703](https://github.com/ant-design/ant-design/pull/32703) [@miloudbelaabed](https://github.com/miloudbelaabed)
- 🐞 修复直接引入 `es/style/mixins/index.less` 文件会抛出 `Variable @root-entry-name is undefined` 异常的问题。[#32887](https://github.com/ant-design/ant-design/pull/32887)
- 🐞 修复 Menu 折叠后 Tooltip 文字颜色错误的问题。[#32956](https://github.com/ant-design/ant-design/pull/32956)
- 🐞 修复 Modal.method `bodyStyle` 无效的问题。[#32934](https://github.com/ant-design/ant-design/pull/32934) [@jin-benben](https://github.com/jin-benben)
- 🐞 修复组件 placeholder 色彩异常的问题。[#32915](https://github.com/ant-design/ant-design/pull/32915)
- 💄 修复可编辑 Tabs 下拉框移除按钮样式问题。[#32919](https://github.com/ant-design/ant-design/pull/32919)
- 🛠 Modal.confirm() 移除不必要的 `div` 容器。[#31492](https://github.com/ant-design/ant-design/pull/31492) [@ppbl](https://github.com/ppbl)
- 🛠 移除无用的 Drawer 样式。[4ca6976](https://github.com/ant-design/ant-design/commit/4ca6976)
- 🛠 PageHeader 标题高度使用 `@height-base` 变量。[#32883](https://github.com/ant-design/ant-design/pull/32883)
- 🇵🇱 添加缺失的 pl_PL 翻译内容。[#32896](https://github.com/ant-design/ant-design/pull/32896) [@MichalPodeszwa](https://github.com/MichalPodeszwa)
- TypeScript
- 🤖 修改 Spin `tip` 的类型为 ReactNode。[#32733](https://github.com/ant-design/ant-design/pull/32733) [@tychenjiajun](https://github.com/tychenjiajun)
- 🤖 移除不必要的 ReactNode 并联类型。[#32935](https://github.com/ant-design/ant-design/pull/32935) [@huangkairan](https://github.com/huangkairan)
- 🤖 从 `rc-pagination` 继承 `itemRender` 类型。[#32931](https://github.com/ant-design/ant-design/pull/32931) [@JounQin](https://github.com/JounQin)
## 4.17.0-alpha.9
## 4.17.0
`2021-10-31`
`2021-11-15`
- 🐞 修复 Collapse 设置 `expandIconPosition``right` 后的样式问题。[#32648](https://github.com/ant-design/ant-design/pull/32648)
- 🐞 修复 Upload `listStyle="picture"` 下加载中样式错位的问题。[#32664](https://github.com/ant-design/ant-design/pull/32664)
- 🐞 修复 Card 设置 `tabs` 后当 `tabPosition: 'left'` 时的样式问题。[#32695](https://github.com/ant-design/ant-design/pull/32695)
- 🐞 修复 Input `placeholder` 在 Chrome 上能被选择的问题。[#32639](https://github.com/ant-design/ant-design/pull/32639) [@cw1997](https://github.com/cw1997)
## 4.17.0-alpha.8
`2021-10-25`
- 🐞 修复 Typography 设置 `ellipsis` 后在缩放下的文本溢出。[#32496](https://github.com/ant-design/ant-design/pull/32496) [@hydraZty](https://github.com/hydraZty)
- 🐞 修复 Transfer 打开选择菜单时抛出 `MenuItem should not leave undefined key` 警告。[#32578](https://github.com/ant-design/ant-design/pull/32578)
- 🐞 修复 Tree.DirectoryTree 键盘操作时抛出 `TypeError:nativeEvent is undefined`。[#32551](https://github.com/ant-design/ant-design/pull/32551) [@D-to-the-K](https://github.com/D-to-the-K)
- 💄 Pagination `simple` 属性下中翻页 input 增加 box-shadow。[#32528](https://github.com/ant-design/ant-design/pull/32528) [@chen-jingjie](https://github.com/chen-jingjie)
- 💄 Table 鼠标悬浮 `rowSpan` 行时会高亮所有相关行。[#32557](https://github.com/ant-design/ant-design/pull/32557)
## 4.17.0-alpha.7
`2021-10-18`
- 🐞 修复 Radio `type` 属性被覆盖导致无法点击的问题。[#32463](https://github.com/ant-design/ant-design/pull/32463)
- 🐞 Input.TextArea `maxLength` 属性现在会传给原生 textarea 标签。[#32448](https://github.com/ant-design/ant-design/pull/32448) [@MOHAMMADArsalan](https://github.com/MOHAMMADArsalan)
- 🐞 修复 Typography `ellipsis` 在 Chrome 下屏幕缩小时溢出的问题。[#32447](https://github.com/ant-design/ant-design/pull/32447)
- 💄 调整 Collapse 标题栏样式使标题折行时不侵占箭头空间。[#32492](https://github.com/ant-design/ant-design/pull/32492)
- 💄 优化 Select 中选项文字粗细。[#32486](https://github.com/ant-design/ant-design/pull/32486) [@liuxulian](https://github.com/liuxulian)
- TypeScript
- 🤖 修复 Message duration 类型定义。[#32524](https://github.com/ant-design/ant-design/pull/32524) [@chen-jingjie](https://github.com/chen-jingjie)
## 4.17.0-alpha.6
`2021-10-11`
- 🐞 修复 InputNumber 操作杆箭头未居中对齐的问题。[#32409](https://github.com/ant-design/ant-design/pull/32409)
- 🐞 修复多次调用 Notification 时 `closeIcon` 配置无法覆盖的问题。[#32359](https://github.com/ant-design/ant-design/pull/32359) [@KAROTT7](https://github.com/KAROTT7)
- 🐞 修复 Button 有 `icon``href` 时的对齐问题。[#32373](https://github.com/ant-design/ant-design/pull/32373)
- 💄 优化 Drawer 弹出动画。[#32342](https://github.com/ant-design/ant-design/pull/32342)
- 💄 修复 Mentions 在 Form 下错误样式丢失的问题。[#32385](https://github.com/ant-design/ant-design/pull/32385)
- TypeScript
- 🤖 修复 ConfigProvider 中 `getPopupContainer` 的参数类型。[#32406](https://github.com/ant-design/ant-design/pull/32406) [@mtadams007](https://github.com/mtadams007)
## 4.17.0-alpha.5
`2021-09-30`
- 🆕 Tree `draggable` 添加拖拽图标以提示。[#32306](https://github.com/ant-design/ant-design/pull/32306)
- 🐞 修复 Table 选择框下拉箭头被固定列遮挡的问题。[#32276](https://github.com/ant-design/ant-design/pull/32276) [@g7i](https://github.com/g7i)
- TypeScript
- 🐞 修复 Table 丢失泛型定义。[#32358](https://github.com/ant-design/ant-design/pull/32358)
## 4.17.0-alpha.4
`2021-09-25`
- 🐞 修复英文国际化文案 `Ok``OK`。[#32259](https://github.com/ant-design/ant-design/pull/32259) [@chj-damon](https://github.com/chj-damon)
- 🐞 修复 `antd.variable.less` 编译时会混入默认主题配置的问题。[#32279](https://github.com/ant-design/ant-design/pull/32279)
- Button
- 🐞 修复 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)
- 动态主题
- 🔥 ConfigProvider 支持动态配置主题色,[详细文档](/docs/react/customize-theme-variable)。[#31496](https://github.com/ant-design/ant-design/pull/31496)
- 🚧 移动部分 `mixins` less 文件到 `themes` 文件下,因为它们依赖于主题相关变量。我们不推荐直接引用底层 less 文件,但是如果你使用了请注意这部分变更。[#32763](https://github.com/ant-design/ant-design/pull/32763)
- 🐞 修复 `antd.variable.less` 编译时会混入默认主题配置的问题。[#32279](https://github.com/ant-design/ant-design/pull/32279)
- 🐞 修复 antd 编译产物缺失 `/style/default.css` 文件的问题。[#32116](https://github.com/ant-design/ant-design/pull/32116)
- 🐞 修复 less 编译 `antd.xxx.less` 会抛出 `Maximum call stack size exceeded error` 的问题。[#32063](https://github.com/ant-design/ant-design/pull/32063)
- Input
- 🐞 修复 `Input.Search` 组件在有 `allowClear``addonBefore` 属性时,输入框 `border-left-radius` 值错误的问题。[#32812](https://github.com/ant-design/ant-design/pull/32812) [@KAROTT7](https://github.com/KAROTT7)
- 🐞 修复 Input 设置 `disabled` 时仍然保留聚焦样式的问题。[#32739](https://github.com/ant-design/ant-design/pull/32739)
- 🐞 修复 Input `placeholder` 在 Chrome 上能被选择的问题。[#32639](https://github.com/ant-design/ant-design/pull/32639) [@cw1997](https://github.com/cw1997)
- 🐞 Input.TextArea `maxLength` 属性现在会传给原生 textarea 标签。[#32448](https://github.com/ant-design/ant-design/pull/32448) [@MOHAMMADArsalan](https://github.com/MOHAMMADArsalan)
- 🐞 修复 Input 聚焦时点击清除图标无效的问题。[#31931](https://github.com/ant-design/ant-design/pull/31931) [@adaex](https://github.com/adaex)
- Cascader
- 🔥 Cascader 支持 `multiple` 模式。[#31936](https://github.com/ant-design/ant-design/pull/31936)
- 🆕 在 `Cascader` 组件中,默认给选中值的文本添加 `title` 属性。[#31237](https://github.com/ant-design/ant-design/pull/31237) [@yingpengsha](https://github.com/yingpengsha)
- 🐞 修复 Cascader 中 `popupClassName``popupPlacement` 属性无效问题。[#32143](https://github.com/ant-design/ant-design/pull/32143)
- Select
- 🆕 Select 支持 `placement` 属性。[#32143](https://github.com/ant-design/ant-design/pull/32143)
- 🆕 Select 支持 `fieldNames` 自定义字段名称。[#31925](https://github.com/ant-design/ant-design/pull/31925)
- 🆕 Select 支持 mac 的 `ctrl + n/p` 快捷键组合。[#650](https://github.com/react-component/select/pull/650)
- 🆕 Select 在 `multiple` 模式下tag 添加 `title` 属性。[#637](https://github.com/react-component/select/pull/637)
- 💄 优化 Select 中选项文字粗细。[#32486](https://github.com/ant-design/ant-design/pull/32486) [@liuxulian](https://github.com/liuxulian)
- TreeSelect
- 🆕 TreeSelect 支持 `placement` 属性。[#32143](https://github.com/ant-design/ant-design/pull/32143)
- 🆕 TreeSelect 支持 `fieldNames` 自定义字段名称。[#31925](https://github.com/ant-design/ant-design/pull/31925)
- Tree
- 🆕 Tree `draggable` 添加拖拽图标以提示。[#32306](https://github.com/ant-design/ant-design/pull/32306)
- 🆕 Tree 添加 `fieldNames` 属性以支持自定义节点字段名称。[#31395](https://github.com/ant-design/ant-design/pull/31395)
- 🆕 Tree 虚拟滚动也支持 `onScroll` 事件。[#474](https://github.com/react-component/tree/pull/474)
- 🐞 修复 Tree 一个图标文字对齐问题。[#32822](https://github.com/ant-design/ant-design/pull/32822)
- 🐞 修复 Tree.DirectoryTree 键盘操作时抛出 `TypeError:nativeEvent is undefined`。[#32551](https://github.com/ant-design/ant-design/pull/32551) [@D-to-the-K](https://github.com/D-to-the-K)
- 🐞 修复 Tree 拖拽到外部时没有清空指示器的问题。[#478](https://github.com/react-component/tree/pull/478)
- 💄 修复 Tree 连接线在浏览器放大时一像素位置偏差的问题。[#32075](https://github.com/ant-design/ant-design/pull/32075) [@btea](https://github.com/btea)
- PageHeader
- 🐞 修复 PageHeader `breadcrumbRender` 返回`false`,仍然展示 dom 的问题。[#32738](https://github.com/ant-design/ant-design/pull/32738)
- Form
- 🔥 Form `rule` 支持 `warningOnly` 实现非阻塞校验。[#30829](https://github.com/ant-design/ant-design/pull/30829)
- 🆕 Form.ErrorList 支持自定义 `className` 属性。[#30887](https://github.com/ant-design/ant-design/pull/30887)
- 🐞 修复 Form 下 Select 内容太长导致布局换行的问题。[#32778](https://github.com/ant-design/ant-design/pull/32778)
- 💄 修复 Mentions 在 Form 下错误样式丢失的问题。[#32385](https://github.com/ant-design/ant-design/pull/32385)
- Drawer
- 🆕 调整 Drawer 关闭按钮位置和默认宽度,新增 `extra` 操作区域和 `size` 大小属性。[#30908](https://github.com/ant-design/ant-design/pull/30908)
- 🆕 Drawer 支持 `autoFocus` 属性。[#181](https://github.com/react-component/drawer/pull/181)
- 🐞 修复底部 Drawer 组件没有动画的问题。[#32761](https://github.com/ant-design/ant-design/pull/32761) [@solitia7125](https://github.com/solitia7125)
- 💄 优化 Drawer 弹出动画。[#32342](https://github.com/ant-design/ant-design/pull/32342)
- Steps
- 🐞 修复 Steps 垂直 `progressDot` 的对齐样式问题。[#32742](https://github.com/ant-design/ant-design/pull/32742)
- 🐞 修复 Steps 默认响应式不生效的问题。[#31965](https://github.com/ant-design/ant-design/pull/31965) [@tangjinzhou](https://github.com/tangjinzhou)
- Typography
- 🐞 修复 Typography 在单行折叠时展开后不换行。[#32735](https://github.com/ant-design/ant-design/pull/32735) [@hydraZty](https://github.com/hydraZty)
- 🐞 修复 Typography 设置 `ellipsis` 后在缩放下的文本溢出。[#32496](https://github.com/ant-design/ant-design/pull/32496) [@hydraZty](https://github.com/hydraZty)
- 🐞 修复 Typography `ellipsis` 在 Chrome 下屏幕缩小时溢出的问题。[#32447](https://github.com/ant-design/ant-design/pull/32447)
- Table
- 🔥 Table 新增 `column.filterMode` 以支持配置树形筛选菜单,可选值为 `'menu' | 'tree'`。[#31809](https://github.com/ant-design/ant-design/pull/31809)
- 🔥 Table 新增 `column.filterSearch` 以支持开启筛选列搜索功能。[#31809](https://github.com/ant-design/ant-design/pull/31809)
- 🆕 Table 鼠标悬浮 `rowSpan` 行时会高亮所有相关行。[#32557](https://github.com/ant-design/ant-design/pull/32557)
- 🐞 修复 Table 选择框下拉箭头被固定列遮挡的问题。[#32276](https://github.com/ant-design/ant-design/pull/32276) [@g7i](https://github.com/g7i)
- 🐞 修复 Table 设置 `sticky` 的时候 `loading` 样式跳动的问题。[#32703](https://github.com/ant-design/ant-design/pull/32703) [@miloudbelaabed](https://github.com/miloudbelaabed)
- 🐞 修复 Table 不支持 `ref` 的问题。[#32136](https://github.com/ant-design/ant-design/pull/32136) [@JounQin](https://github.com/JounQin)
- 🐞 Table 移除 IE11 下 `sticky` 的相关样式以解决布局问题。[#32177](https://github.com/ant-design/ant-design/pull/32177)
- 🐞 优化 Table 排序图标边距问题。[#32172](https://github.com/ant-design/ant-design/pull/32172)
- 🐞 修复 Table 中 `pagination.className` 不生效的问题。[#32131](https://github.com/ant-design/ant-design/pull/32131) [@JounQin](https://github.com/JounQin)
- 🐞 修复 Table.SELECT_XXX 会无视 `getCheckboxProps` 提供的 `disabled` 状态问题。[#32027](https://github.com/ant-design/ant-design/pull/32027)
- 💄 Table 筛选菜单重置按钮现在不再关闭菜单和生效。[#31809](https://github.com/ant-design/ant-design/pull/31809)
- 🐞 回滚 Table sticky `z-index` 样式的 less 计算到 `calc`,以防止 `auto` 样式计算错误问题。[#31874](https://github.com/ant-design/ant-design/pull/31874) [@bconnorwhite](https://github.com/bconnorwhite)
- 🐞 修复 Table 在数据变更后滚动条展示问题。[#647](https://github.com/react-component/table/pull/647) [@lanten](https://github.com/lanten)
- Transfer
- 🆕 Transfer 新增自定义左右 `footer`。[#31108](https://github.com/ant-design/ant-design/pull/31108)
- 🆕 Transfer 支持 `locale.notFoundContent` 传入数组。[#31088](https://github.com/ant-design/ant-design/pull/31088) [@wwyx778](https://github.com/wwyx778)
- 🐞 修复 Transfer 打开选择菜单时抛出 `MenuItem should not leave undefined key` 警告。[#32578](https://github.com/ant-design/ant-design/pull/32578)
- 💄 调整 Transfer 筛选搜索框图标位置,使其和表格筛选搜索框统一。[#31809](https://github.com/ant-design/ant-design/pull/31809)
- Collapse
- 🐞 修复 Collapse 设置 `expandIconPosition``right` 后的样式问题。[#32648](https://github.com/ant-design/ant-design/pull/32648)
- 💄 调整 Collapse 标题栏样式使标题折行时不侵占箭头空间。[#32492](https://github.com/ant-design/ant-design/pull/32492)
- Button
- 🐞 修复 Button 有 `icon``href` 时的对齐问题。[#32373](https://github.com/ant-design/ant-design/pull/32373)
- 🐞 修复 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 `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)
- 🐞 修复 Upload 错误背景颜色。[#32051](https://github.com/ant-design/ant-design/pull/32051)
- InputNumber
- 🔥 InputNumber 增加 `addonBefore``addonAfter` 属性支持。[#31432](https://github.com/ant-design/ant-design/pull/31432) [@Austaras](https://github.com/Austaras)
- 🆕 InputNumber 新增 `controls` 属性用于控制是否显示加减按钮。[#31548](https://github.com/ant-design/ant-design/pull/31548)
- 🆕 InputNumber `formatter` 支持额外参数用以检测当前变更是否为用户输入。[#31030](https://github.com/ant-design/ant-design/pull/31030)
- 🐞 修复 InputNumber 操作杆箭头未居中对齐的问题。[#32409](https://github.com/ant-design/ant-design/pull/32409)
- 💄 聚焦 InputNumber 时将始终显示加减操作区。[#31911](https://github.com/ant-design/ant-design/pull/31911)
- DatePicker
- 🆕 `DatePicker``RangePicker` 现在支持 `nextIcon`、`prevIcon`、`superNextIcon` 和 `superPrevIcon`。[#31703](https://github.com/ant-design/ant-design/pull/31703) [@Oreoz](https://github.com/Oreoz)
- 🐞 修复 RangePicker 的 `defaultPickerValue` 不生效的问题。[#32107](https://github.com/ant-design/ant-design/pull/32107) [@thommesZip](https://github.com/thommesZip)
- Notification
- 🆕 Notification 支持 `maxCount` 属性以限制最大显示数。[#31807](https://github.com/ant-design/ant-design/pull/31807) [@binyellow](https://github.com/binyellow)
- 🐞 修复多次调用 Notification 时 `closeIcon` 配置无法覆盖的问题。[#32359](https://github.com/ant-design/ant-design/pull/32359) [@KAROTT7](https://github.com/KAROTT7)
- 🆕 增加 Menu.Divider 的 `dashed` 属性。[#31379](https://github.com/ant-design/ant-design/pull/31379) [@Map1en](https://github.com/Map1en)
- 🆕 Skeleton.Button 添加 `block` 属性。[#30902](https://github.com/ant-design/ant-design/pull/30902) [@Jehu](https://github.com/Jehu)
- 🆕 Popconfirm 组件的 `onConfirm` 允许返回一个 Promise。[#30871](https://github.com/ant-design/ant-design/pull/30871) [@wendellhu95](https://github.com/wendellhu95)
- 🐞 修复 Card 设置 `tabs` 后当 `tabPosition: 'left'` 时的样式问题。[#32695](https://github.com/ant-design/ant-design/pull/32695)
- 🐞 修复 Radio `type` 属性被覆盖导致无法点击的问题。[#32463](https://github.com/ant-design/ant-design/pull/32463)
- 🐞 修复英文国际化文案 `Ok``OK`。[#32259](https://github.com/ant-design/ant-design/pull/32259) [@chj-damon](https://github.com/chj-damon)
- 🐞 修复 Switch `loading` 按钮位置不正确的问题。[#32216](https://github.com/ant-design/ant-design/pull/32216)
- 🐞 修复 Grid Col `flex` 在内容过长的时候缩放失效的问题。[#32160](https://github.com/ant-design/ant-design/pull/32160)
- 🐞 修复调用 `message.useMessage` 时未使用 ConfigProvider 中的 `getPopupContainer` 返回元素作为容器的问题。[#31939](https://github.com/ant-design/ant-design/pull/31939) [@DaoxingHuang](https://github.com/DaoxingHuang)
- 💄 优化 Image 在小尺寸下省略预览文本。[#29900](https://github.com/ant-design/ant-design/pull/29900) [@drizzlesconsin](https://github.com/drizzlesconsin)
- 🐞 修复 Alert `message` 为空时 dom 节点还在的问题。[#32057](https://github.com/ant-design/ant-design/pull/32057)
- 🐞 修复 Anchor 组件包含空格时 `targetOffset` 属性不生效的问题。[#31952](https://github.com/ant-design/ant-design/pull/31952) [@adaex](https://github.com/adaex)
- 💄 新增 Less 变量 `@checkbox-border-radius`。[#31360](https://github.com/ant-design/ant-design/pull/31360) [@Gherciu](https://github.com/Gherciu)
- 🐞 Avatar 增加 `crossOrigin` 参数以解决跨域问题。[#31273](https://github.com/ant-design/ant-design/pull/31273) [@Map1en](https://github.com/Map1en)
- RTL
- 💄 优化 Alert 关闭按钮在 RTL 模式下的显示。[#32286](https://github.com/ant-design/ant-design/pull/32286)
- 💄 优化 Table 表头操作按钮在 RTL 模式下显示。[#32283](https://github.com/ant-design/ant-design/pull/32283)
@ -102,101 +153,25 @@ timeline: true
- 💄 优化 Badge 数字在 RTL 模式下显示和动画。[#32281](https://github.com/ant-design/ant-design/pull/32281)
- 💄 优化 InputNumber 操作栏 RTL 模式下边框样式。[#32272](https://github.com/ant-design/ant-design/pull/32272)
- 💄 优化 Dropdown RTL 模式下 icon 显示。[#32271](https://github.com/ant-design/ant-design/pull/32271)
- TypeScript
- 🤖 修复 Switch `id` 属性定义。[#32237](https://github.com/ant-design/ant-design/pull/32237) [@M-ZubairAhmed](https://github.com/M-ZubairAhmed)
## 4.17.0-alpha.3
`2021-09-14`
- 🆕 Pagination 支持定制 `selectComponentClass`。 [#32132](https://github.com/ant-design/ant-design/pull/32132) [@JounQin](https://github.com/JounQin)
- 🆕 Tree 与 TreeSelect 支持 `placement` 属性。[#32143](https://github.com/ant-design/ant-design/pull/32143)
- 🐞 修复 Cascader 中 `popupClassName``popupPlacement` 属性无效问题。[#32143](https://github.com/ant-design/ant-design/pull/32143)
- 🐞 修复调用 `message.useMessage` 时未使用 ConfigProvider 中的 `getPopupContainer` 返回元素作为容器的问题。[#31939](https://github.com/ant-design/ant-design/pull/31939) [@DaoxingHuang](https://github.com/DaoxingHuang)
- 🐞 修复 Table 中 `pagination.className` 不生效的问题。[#32131](https://github.com/ant-design/ant-design/pull/32131) [@JounQin](https://github.com/JounQin)
- 🐞 修复 RangePicker 的 `defaultPickerValue` 不生效的问题。[#32107](https://github.com/ant-design/ant-design/pull/32107) [@thommesZip](https://github.com/thommesZip)
- 🐞 修复 antd 编译产物缺失 `/style/default.css` 文件的问题。[#32116](https://github.com/ant-design/ant-design/pull/32116)
- 💄 修复 Tree 连接线在浏览器放大时一像素位置偏差的问题。[#32075](https://github.com/ant-design/ant-design/pull/32075) [@btea](https://github.com/btea)
- 💄 优化 Image 在小尺寸下省略预览文本。[#29900](https://github.com/ant-design/ant-design/pull/29900) [@drizzlesconsin](https://github.com/drizzlesconsin)
- 🇬🇪 添加格鲁吉亚语言环境。[#32106](https://github.com/ant-design/ant-design/pull/32106) [@PrimulaX](https://github.com/PrimulaX)
- TypeScript
- 🤖 修复 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)
## 4.17.0-alpha.2
`2021-09-07`
- 🐞 修复 Alert `message` 为空时 dom 节点还在的问题。[#32057](https://github.com/ant-design/ant-design/pull/32057)
- 🐞 修复 Upload 错误背景颜色。[#32051](https://github.com/ant-design/ant-design/pull/32051)
- 🐞 修复 less 编译 `antd.xxx.less` 会抛出 `Maximum call stack size exceeded error` 的问题。[#32063](https://github.com/ant-design/ant-design/pull/32063)
- TypeScript
- 🤖 调整 List 组件 `rowKey` 类型为 React.key。[#32033](https://github.com/ant-design/ant-design/pull/32033) [@lironhl](https://github.com/lironhl)
## 4.17.0-alpha.1
`2021-09-06`
- 🐞 修复 Table.SELECT_XXX 会无视 `getCheckboxProps` 提供的 `disabled` 状态问题。[#32027](https://github.com/ant-design/ant-design/pull/32027)
- TypeScript
- 🐞 修复 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)
- 🌐 国际化
- 🇩🇪 补充 de_DE 中 Image 字段。[#32001](https://github.com/ant-design/ant-design/pull/32001) [@Chtau](https://github.com/Chtau)
## 4.17.0-alpha.0
`2021-09-01`
- 🔥 ConfigProvider 支持动态配置主题色,[详细文档](/docs/react/customize-theme-variable)。[#31496](https://github.com/ant-design/ant-design/pull/31496)
- Table
- 🔥 Table 新增 `column.filterMode` 以支持配置树形筛选菜单,可选值为 `'menu' | 'tree'`。[#31809](https://github.com/ant-design/ant-design/pull/31809)
- 🔥 Table 新增 `column.filterSearch` 以支持开启筛选列搜索功能。[#31809](https://github.com/ant-design/ant-design/pull/31809)
- 💄 Table 筛选菜单重置按钮现在不再关闭菜单和生效。[#31809](https://github.com/ant-design/ant-design/pull/31809)
- 💄 调整 Transfer 筛选搜索框图标位置,使其和表格筛选搜索框统一。[#31809](https://github.com/ant-design/ant-design/pull/31809)
- 🐞 回滚 Table sticky `z-index` 样式的 less 计算到 `calc`,以防止 `auto` 样式计算错误问题。[#31874](https://github.com/ant-design/ant-design/pull/31874) [@bconnorwhite](https://github.com/bconnorwhite)
- 🐞 修复 Table 在数据变更后滚动条展示问题。[#647](https://github.com/react-component/table/pull/647) [@lanten](https://github.com/lanten)
- Cascader
- 🔥 Cascader 支持 `multiple` 模式。[#31936](https://github.com/ant-design/ant-design/pull/31936)
- 🆕 在 `Cascader` 组件中,默认给选中值的文本添加 `title` 属性。[#31237](https://github.com/ant-design/ant-design/pull/31237) [@yingpengsha](https://github.com/yingpengsha)
- 🐞 修复 Steps 默认响应式不生效的问题。[#31965](https://github.com/ant-design/ant-design/pull/31965) [@tangjinzhou](https://github.com/tangjinzhou)
- InputNumber
- 🔥 InputNumber 增加 `addonBefore``addonAfter` 属性支持。[#31432](https://github.com/ant-design/ant-design/pull/31432) [@Austaras](https://github.com/Austaras)
- 💄 聚焦 InputNumber 时将始终显示加减操作区。[#31911](https://github.com/ant-design/ant-design/pull/31911)
- 🆕 InputNumber 新增 `controls` 属性用于控制是否显示加减按钮。[#31548](https://github.com/ant-design/ant-design/pull/31548)
- 🆕 InputNumber `formatter` 支持额外参数用以检测当前变更是否为用户输入。[#31030](https://github.com/ant-design/ant-design/pull/31030)
- 🐞 修复 Input 聚焦时点击清除图标无效的问题。[#31931](https://github.com/ant-design/ant-design/pull/31931) [@adaex](https://github.com/adaex)
- 🐞 修复 Anchor 组件包含空格时 `targetOffset` 属性不生效的问题。[#31952](https://github.com/ant-design/ant-design/pull/31952) [@adaex](https://github.com/adaex)
- 🆕 TreeSelect 和 Select 支持 `fieldNames` 自定义字段名称。[#31925](https://github.com/ant-design/ant-design/pull/31925)
- Select
- 🆕 Select 支持 mac 的 `ctrl + n/p` 快捷键组合。[#650](https://github.com/react-component/select/pull/650)
- 🆕 Select 在 `multiple` 模式下tag 添加 `title` 属性。[#637](https://github.com/react-component/select/pull/637)
- Transfer
- 🐞 修复 Transfer 列表在 RTL 模式下 `direction` 取值。[#31903](https://github.com/ant-design/ant-design/pull/31903)
- 🆕 Transfer 新增自定义左右 `footer`。[#31108](https://github.com/ant-design/ant-design/pull/31108)
- 🆕 Transfer 支持 `locale.notFoundContent` 传入数组。[#31088](https://github.com/ant-design/ant-design/pull/31088) [@wwyx778](https://github.com/wwyx778)
- 🆕 `DatePicker``RangePicker` 现在支持 `nextIcon`、`prevIcon`、`superNextIcon` 和 `superPrevIcon`。[#31703](https://github.com/ant-design/ant-design/pull/31703) [@Oreoz](https://github.com/Oreoz)
- 🆕 Notification 支持 `maxCount` 属性以限制最大显示数。[#31807](https://github.com/ant-design/ant-design/pull/31807) [@binyellow](https://github.com/binyellow)
- 🆕 增加 Menu.Divider 的 `dashed` 属性。[#31379](https://github.com/ant-design/ant-design/pull/31379) [@Map1en](https://github.com/Map1en)
- Tree
- 🆕 Tree 添加 `fieldNames` 属性以支持自定义节点字段名称。[#31395](https://github.com/ant-design/ant-design/pull/31395)
- 🆕 Tree 虚拟滚动也支持 `onScroll` 事件。[#474](https://github.com/react-component/tree/pull/474)
- 🐞 修复 Tree 拖拽到外部时没有清空指示器的问题。[#478](https://github.com/react-component/tree/pull/478)
- 💄 新增 Less 变量 `@checkbox-border-radius`。[#31360](https://github.com/ant-design/ant-design/pull/31360) [@Gherciu](https://github.com/Gherciu)
- 🐞 Avatar 增加 `crossOrigin` 参数以解决跨域问题。[#31273](https://github.com/ant-design/ant-design/pull/31273) [@Map1en](https://github.com/Map1en)
- Drawer
- 🆕 调整 Drawer 关闭按钮位置和默认宽度,新增 `extra` 操作区域和 `size` 大小属性。[#30908](https://github.com/ant-design/ant-design/pull/30908)
- 🆕 Drawer 支持 `autoFocus` 属性。[#181](https://github.com/react-component/drawer/pull/181)
- 🆕 Skeleton.Button 添加 `block` 属性。[#30902](https://github.com/ant-design/ant-design/pull/30902) [@Jehu](https://github.com/Jehu)
- 🆕 Popconfirm 组件的 `onConfirm` 允许返回一个 Promise。[#30871](https://github.com/ant-design/ant-design/pull/30871) [@wendellhu95](https://github.com/wendellhu95)
- Form
- 🆕 Form.ErrorList 支持自定义 `className` 属性。[#30887](https://github.com/ant-design/ant-design/pull/30887)
- 🔥 Form `rule` 支持 `warningOnly` 实现非阻塞校验。[#30829](https://github.com/ant-design/ant-design/pull/30829)
- 🌐 国际化
- 🇬🇪 添加格鲁吉亚语言环境。[#32106](https://github.com/ant-design/ant-design/pull/32106) [@PrimulaX](https://github.com/PrimulaX)
- 🇩🇪 补充 de_DE 中 Image 字段。[#32001](https://github.com/ant-design/ant-design/pull/32001) [@Chtau](https://github.com/Chtau)
- 🇮🇳 添加马拉雅拉姆语 (ml_IN) 语言环境。[#31521](https://github.com/ant-design/ant-design/pull/31521) [@khjabir](https://github.com/khjabir)
- 🇵🇰 添加乌尔都语 (ur_PK) 语言环境。[#31346](https://github.com/ant-design/ant-design/pull/31346) [@MuhammadAnas190](https://github.com/MuhammadAnas190)
- 🇧🇩 添加孟加拉语 (bn_BD) 语言环境。[#31257](https://github.com/ant-design/ant-design/pull/31257) [@AminulBD](https://github.com/AminulBD)
- TypeScript
- 🤖 修改 Spin `tip` 的类型为 ReactNode。[#32733](https://github.com/ant-design/ant-design/pull/32733) [@tychenjiajun](https://github.com/tychenjiajun)
- 🤖 修复 Message duration 类型定义。[#32524](https://github.com/ant-design/ant-design/pull/32524) [@chen-jingjie](https://github.com/chen-jingjie)
- 🤖 修复 ConfigProvider 中 `getPopupContainer` 的参数类型。[#32406](https://github.com/ant-design/ant-design/pull/32406) [@mtadams007](https://github.com/mtadams007)
- 🐞 修复 Table 丢失泛型定义。[#32358](https://github.com/ant-design/ant-design/pull/32358)
- 🤖 修复 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)
- 🤖 调整 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)
## 4.16.13

View File

@ -49,7 +49,7 @@ export interface CardProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 't
cover?: React.ReactNode;
actions?: React.ReactNode[];
tabList?: CardTabListType[];
tabBarExtraContent?: React.ReactNode | null;
tabBarExtraContent?: React.ReactNode;
onTabChange?: (key: string) => void;
activeTabKey?: string;
defaultActiveTabKey?: string;

View File

@ -1,5 +1,6 @@
import { mount } from 'enzyme';
import * as React from 'react';
import Cascader from '..';
import Cascader, { BasicDataNode } from '..';
describe('Cascader.typescript', () => {
it('options value', () => {
@ -42,4 +43,35 @@ describe('Cascader.typescript', () => {
expect(result).toBeTruthy();
});
it('suffixIcon', () => {
const wrapper = mount(<Cascader suffixIcon={<span />} />);
expect(wrapper).toBeTruthy();
});
it('Generic', () => {
interface MyOptionData extends BasicDataNode {
customizeLabel: string;
customizeValue: string;
customizeChildren?: MyOptionData[];
}
const wrapper = mount(
<Cascader<MyOptionData>
options={[
{
customizeLabel: 'Bamboo',
customizeValue: 'bamboo',
customizeChildren: [
{
customizeLabel: 'Little',
customizeValue: 'little',
},
],
},
]}
/>,
);
expect(wrapper).toBeTruthy();
});
});

View File

@ -24,7 +24,7 @@ Cascade selection box.
| allowClear | Whether allow clear | boolean | true | |
| autoFocus | If get focus when component mounted | boolean | false | |
| bordered | Whether has border style | boolean | true | |
| changeOnSelect | Change value on each selection if set to true, see above demo for details | boolean | false | |
| changeOnSelect | (Work on single select) Change value on each selection if set to true, see above demo for details | boolean | false | |
| className | The additional css class | string | - | |
| defaultValue | Initial selected value | string\[] \| number\[] | \[] | |
| disabled | Whether disabled select | boolean | false | |

View File

@ -2,7 +2,7 @@ import * as React from 'react';
import classNames from 'classnames';
import RcCascader from 'rc-cascader';
import type { CascaderProps as RcCascaderProps } from 'rc-cascader';
import type { ShowSearchType, FieldNames } from 'rc-cascader/lib/interface';
import type { ShowSearchType, FieldNames, DataNode } from 'rc-cascader/lib/interface';
import omit from 'rc-util/lib/omit';
import RightOutlined from '@ant-design/icons/RightOutlined';
import RedoOutlined from '@ant-design/icons/RedoOutlined';
@ -19,6 +19,8 @@ import { getTransitionName } from '../_util/motion';
// - Hover opacity style
// - Search filter match case
export type BasicDataNode = Omit<DataNode, 'label' | 'value' | 'children'>;
export type FieldNamesType = FieldNames;
export type FilledFieldNamesType = Required<FieldNamesType>;
@ -72,18 +74,22 @@ const defaultSearchRender: ShowSearchType['render'] = (inputValue, path, prefixC
return optionList;
};
export interface CascaderProps extends Omit<RcCascaderProps, 'checkable'> {
export interface CascaderProps<DataNodeType>
extends Omit<RcCascaderProps, 'checkable' | 'options'> {
multiple?: boolean;
size?: SizeType;
bordered?: boolean;
suffixIcon?: React.ReactNode;
options?: DataNodeType[];
}
interface CascaderRef {
export interface CascaderRef {
focus: () => void;
blur: () => void;
}
const Cascader = React.forwardRef((props: CascaderProps, ref: React.Ref<CascaderRef>) => {
const Cascader = React.forwardRef((props: CascaderProps<any>, ref: React.Ref<CascaderRef>) => {
const {
prefixCls: customizePrefixCls,
size: customizeSize,
@ -225,7 +231,11 @@ const Cascader = React.forwardRef((props: CascaderProps, ref: React.Ref<Cascader
ref={ref}
/>
);
});
}) as (<DataNodeType extends BasicDataNode | DataNode = DataNode>(
props: React.PropsWithChildren<CascaderProps<DataNodeType>> & { ref?: React.Ref<CascaderRef> },
) => React.ReactElement) & {
displayName: string;
};
Cascader.displayName = 'Cascader';

View File

@ -25,7 +25,7 @@ cover: https://gw.alipayobjects.com/zos/alicdn/UdS8y8xyZ/Cascader.svg
| allowClear | 是否支持清除 | boolean | true | |
| autoFocus | 自动获取焦点 | boolean | false | |
| bordered | 是否有边框 | boolean | true | |
| changeOnSelect | 当此项为 true 时,点选每级菜单选项值都会发生变化,具体见上面的演示 | boolean | false | |
| changeOnSelect | (单选时生效)当此项为 true 时,点选每级菜单选项值都会发生变化,具体见上面的演示 | boolean | false | |
| className | 自定义类名 | string | - | |
| defaultValue | 默认的选中项 | string\[] \| number\[] | \[] | |
| disabled | 禁用 | boolean | false | |

View File

@ -16402,17 +16402,6 @@ exports[`ConfigProvider components Pagination configProvider 1`] = `
</span>
</span>
</div>
<div
class="config-pagination-options-quick-jumper"
>
Go to
<input
aria-label="Page"
type="text"
value=""
/>
Page
</div>
</li>
</ul>
<ul
@ -16559,17 +16548,6 @@ exports[`ConfigProvider components Pagination configProvider 1`] = `
</span>
</span>
</div>
<div
class="config-pagination-options-quick-jumper"
>
Go to
<input
aria-label="Page"
type="text"
value=""
/>
Page
</div>
</li>
</ul>
</div>
@ -16721,17 +16699,6 @@ exports[`ConfigProvider components Pagination configProvider componentSize large
</span>
</span>
</div>
<div
class="config-pagination-options-quick-jumper"
>
Go to
<input
aria-label="Page"
type="text"
value=""
/>
Page
</div>
</li>
</ul>
<ul
@ -16878,17 +16845,6 @@ exports[`ConfigProvider components Pagination configProvider componentSize large
</span>
</span>
</div>
<div
class="config-pagination-options-quick-jumper"
>
Go to
<input
aria-label="Page"
type="text"
value=""
/>
Page
</div>
</li>
</ul>
</div>
@ -17040,17 +16996,6 @@ exports[`ConfigProvider components Pagination configProvider componentSize middl
</span>
</span>
</div>
<div
class="config-pagination-options-quick-jumper"
>
Go to
<input
aria-label="Page"
type="text"
value=""
/>
Page
</div>
</li>
</ul>
<ul
@ -17197,17 +17142,6 @@ exports[`ConfigProvider components Pagination configProvider componentSize middl
</span>
</span>
</div>
<div
class="config-pagination-options-quick-jumper"
>
Go to
<input
aria-label="Page"
type="text"
value=""
/>
Page
</div>
</li>
</ul>
</div>
@ -17359,17 +17293,6 @@ exports[`ConfigProvider components Pagination configProvider virtual and dropdow
</span>
</span>
</div>
<div
class="ant-pagination-options-quick-jumper"
>
Go to
<input
aria-label="Page"
type="text"
value=""
/>
Page
</div>
</li>
</ul>
<ul
@ -17516,17 +17439,6 @@ exports[`ConfigProvider components Pagination configProvider virtual and dropdow
</span>
</span>
</div>
<div
class="ant-pagination-options-quick-jumper"
>
Go to
<input
aria-label="Page"
type="text"
value=""
/>
Page
</div>
</li>
</ul>
</div>
@ -17678,17 +17590,6 @@ exports[`ConfigProvider components Pagination normal 1`] = `
</span>
</span>
</div>
<div
class="ant-pagination-options-quick-jumper"
>
Go to
<input
aria-label="Page"
type="text"
value=""
/>
Page
</div>
</li>
</ul>
<ul
@ -17835,17 +17736,6 @@ exports[`ConfigProvider components Pagination normal 1`] = `
</span>
</span>
</div>
<div
class="ant-pagination-options-quick-jumper"
>
Go to
<input
aria-label="Page"
type="text"
value=""
/>
Page
</div>
</li>
</ul>
</div>
@ -17997,17 +17887,6 @@ exports[`ConfigProvider components Pagination prefixCls 1`] = `
</span>
</span>
</div>
<div
class="prefix-Pagination-options-quick-jumper"
>
Go to
<input
aria-label="Page"
type="text"
value=""
/>
Page
</div>
</li>
</ul>
<ul
@ -18154,17 +18033,6 @@ exports[`ConfigProvider components Pagination prefixCls 1`] = `
</span>
</span>
</div>
<div
class="prefix-Pagination-options-quick-jumper"
>
Go to
<input
aria-label="Page"
type="text"
value=""
/>
Page
</div>
</li>
</ul>
</div>

View File

@ -22,7 +22,7 @@ const locale: PickerLocale = {
};
// should add whitespace between char in Button
locale.lang.ok = '确 定';
locale.lang.ok = '确定';
// All settings at:
// https://github.com/ant-design/ant-design/blob/master/components/date-picker/locale/example.json

View File

@ -24,7 +24,7 @@ A Drawer is a panel that is typically overlaid on top of a page and slides in fr
| afterVisibleChange | Callback after the animation ends when switching drawers | function(visible) | - | |
| bodyStyle | Style of the drawer content part | object | - | |
| className | The class name of the container of the Drawer dialog | string | - | |
| closable | Whether a close (x) button is visible on top right of the Drawer dialog or not | boolean | true | |
| closable | Whether a close (x) button is visible on top left of the Drawer dialog or not | boolean | true | |
| closeIcon | Custom close icon | ReactNode | &lt;CloseOutlined /> | |
| contentWrapperStyle | Style of the drawer wrapper of content part | CSSProperties | - | |
| destroyOnClose | Whether to unmount child components on closing drawer or not | boolean | false | |

View File

@ -23,7 +23,7 @@ cover: https://gw.alipayobjects.com/zos/alicdn/7z8NJQhFb/Drawer.svg
| afterVisibleChange | 切换抽屉时动画结束后的回调 | function(visible) | - | |
| bodyStyle | 可用于设置 Drawer 内容部分的样式 | CSSProperties | - | |
| className | 对话框外层容器的类名 | string | - | |
| closable | 是否显示上角的关闭按钮 | boolean | true | |
| closable | 是否显示上角的关闭按钮 | boolean | true | |
| closeIcon | 自定义关闭图标 | ReactNode | &lt;CloseOutlined /> | |
| contentWrapperStyle | 可用于设置 Drawer 包裹内容部分的样式 | CSSProperties | - | |
| destroyOnClose | 关闭时销毁 Drawer 里的子元素 | boolean | false | |
@ -47,4 +47,4 @@ cover: https://gw.alipayobjects.com/zos/alicdn/7z8NJQhFb/Drawer.svg
| visible | Drawer 是否可见 | boolean | - | |
| width | 宽度 | string \| number | 378 | |
| zIndex | 设置 Drawer 的 `z-index` | number | 1000 | |
| onClose | 点击遮罩层或上角叉或取消按钮的回调 | function(e) | - | |
| onClose | 点击遮罩层或上角叉或取消按钮的回调 | function(e) | - | |

View File

@ -228,12 +228,6 @@
pointer-events: none;
}
&-open {
&-content {
box-shadow: @shadow-2;
}
}
// =================== Hook Components ===================
.@{picker-prefix-cls} {
&-clear {

View File

@ -471,6 +471,137 @@ exports[`renders ./components/form/demo/basic.md correctly 1`] = `
</form>
`;
exports[`renders ./components/form/demo/col-24-debug.md correctly 1`] = `
<form
autocomplete="off"
class="ant-form ant-form-horizontal"
id="basic"
>
<div
class="ant-row ant-form-item"
>
<div
class="ant-col ant-col-24 ant-form-item-label"
>
<label
class="ant-form-item-required"
for="basic_username"
title="Username"
>
Username
</label>
</div>
<div
class="ant-col ant-col-24 ant-form-item-control"
>
<div
class="ant-form-item-control-input"
>
<div
class="ant-form-item-control-input-content"
>
<input
class="ant-input"
id="basic_username"
type="text"
value=""
/>
</div>
</div>
</div>
</div>
<div
class="ant-row ant-form-item"
>
<div
class="ant-col ant-col-24 ant-form-item-label"
>
<label
class="ant-form-item-required"
for="basic_password"
title="Password"
>
Password
</label>
</div>
<div
class="ant-col ant-col-24 ant-form-item-control"
>
<div
class="ant-form-item-control-input"
>
<div
class="ant-form-item-control-input-content"
>
<span
class="ant-input-affix-wrapper ant-input-password"
>
<input
action="click"
class="ant-input"
id="basic_password"
type="password"
value=""
/>
<span
class="ant-input-suffix"
>
<span
aria-label="eye-invisible"
class="anticon anticon-eye-invisible ant-input-password-icon"
role="img"
tabindex="-1"
>
<svg
aria-hidden="true"
data-icon="eye-invisible"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M942.2 486.2Q889.47 375.11 816.7 305l-50.88 50.88C807.31 395.53 843.45 447.4 874.7 512 791.5 684.2 673.4 766 512 766q-72.67 0-133.87-22.38L323 798.75Q408 838 512 838q288.3 0 430.2-300.3a60.29 60.29 0 000-51.5zm-63.57-320.64L836 122.88a8 8 0 00-11.32 0L715.31 232.2Q624.86 186 512 186q-288.3 0-430.2 300.3a60.3 60.3 0 000 51.5q56.69 119.4 136.5 191.41L112.48 835a8 8 0 000 11.31L155.17 889a8 8 0 0011.31 0l712.15-712.12a8 8 0 000-11.32zM149.3 512C232.6 339.8 350.7 258 512 258c54.54 0 104.13 9.36 149.12 28.39l-70.3 70.3a176 176 0 00-238.13 238.13l-83.42 83.42C223.1 637.49 183.3 582.28 149.3 512zm246.7 0a112.11 112.11 0 01146.2-106.69L401.31 546.2A112 112 0 01396 512z"
/>
<path
d="M508 624c-3.46 0-6.87-.16-10.25-.47l-52.82 52.82a176.09 176.09 0 00227.42-227.42l-52.82 52.82c.31 3.38.47 6.79.47 10.25a111.94 111.94 0 01-112 112z"
/>
</svg>
</span>
</span>
</span>
</div>
</div>
</div>
</div>
<div
class="ant-row ant-form-item"
>
<div
class="ant-col ant-col-24 ant-form-item-control"
>
<div
class="ant-form-item-control-input"
>
<div
class="ant-form-item-control-input-content"
>
<button
class="ant-btn ant-btn-primary"
type="submit"
>
<span>
Submit
</span>
</button>
</div>
</div>
</div>
</div>
</form>
`;
exports[`renders ./components/form/demo/control-hooks.md correctly 1`] = `
<form
class="ant-form ant-form-horizontal"

View File

@ -0,0 +1,65 @@
---
order: 9999
title:
zh-CN: 测试特殊 col 24 用法
en-US: Test col 24 usage
debug: true
---
## zh-CN
See issue [#32980](https://github.com/ant-design/ant-design/issues/32980).
## en-US
See issue [#32980](https://github.com/ant-design/ant-design/issues/32980).
```tsx
import { Form, Input, Button } from 'antd';
const Demo = () => {
const onFinish = (values: any) => {
console.log('Success:', values);
};
const onFinishFailed = (errorInfo: any) => {
console.log('Failed:', errorInfo);
};
return (
<Form
name="basic"
labelCol={{ span: 24 }}
wrapperCol={{ span: 24 }}
initialValues={{ remember: true }}
onFinish={onFinish}
onFinishFailed={onFinishFailed}
autoComplete="off"
>
<Form.Item
label="Username"
name="username"
rules={[{ required: true, message: 'Please input your username!' }]}
>
<Input />
</Form.Item>
<Form.Item
label="Password"
name="password"
rules={[{ required: true, message: 'Please input your password!' }]}
>
<Input.Password />
</Form.Item>
<Form.Item>
<Button type="primary" htmlType="submit">
Submit
</Button>
</Form.Item>
</Form>
);
};
ReactDOM.render(<Demo />, mountNode);
```

View File

@ -9,6 +9,9 @@
}
.@{form-item-prefix-cls}-control {
flex: 1 1 0;
}
// https://github.com/ant-design/ant-design/issues/32980
.@{form-item-prefix-cls}-control:not(.@{ant-prefix}-col) {
// https://github.com/ant-design/ant-design/issues/32777
min-width: 0;
}

View File

@ -68,10 +68,7 @@ const Search = React.forwardRef<Input, SearchProps>((props, ref) => {
const prefixCls = getPrefixCls('input-search', customizePrefixCls);
const inputPrefixCls = getPrefixCls('input', customizeInputPrefixCls);
const searchIcon =
typeof enterButton === 'boolean' ? (
<SearchOutlined />
) : null;
const searchIcon = typeof enterButton === 'boolean' ? <SearchOutlined /> : null;
const btnClassName = `${prefixCls}-button`;
let button: React.ReactNode;
@ -81,7 +78,10 @@ const Search = React.forwardRef<Input, SearchProps>((props, ref) => {
if (isAntdButton || enterButtonAsElement.type === 'button') {
button = cloneElement(enterButtonAsElement, {
onMouseDown,
onClick: onSearch,
onClick: (e: React.MouseEvent<HTMLButtonElement>) => {
enterButtonAsElement?.props?.onClick?.(e);
onSearch(e);
},
key: 'enterButton',
...(isAntdButton
? {

View File

@ -110,10 +110,15 @@ describe('Input.Search', () => {
it('should trigger onSearch when click search button of native', () => {
const onSearch = jest.fn();
const onButtonClick = jest.fn();
const wrapper = mount(
<Search
defaultValue="search text"
enterButton={<button type="button">antd button</button>}
enterButton={
<button type="button" onClick={onButtonClick}>
antd button
</button>
}
onSearch={onSearch}
/>,
);
@ -126,6 +131,7 @@ describe('Input.Search', () => {
preventDefault: expect.any(Function),
}),
);
expect(onButtonClick).toHaveBeenCalledTimes(1);
});
it('should trigger onSearch when press enter', () => {

View File

@ -1467,7 +1467,7 @@ exports[`renders ./components/input/demo/group.md correctly 1`] = `
type="button"
>
<span>
Sumbit
Submit
</span>
</button>
</span>
@ -2767,6 +2767,87 @@ exports[`renders ./components/input/demo/search-input.md correctly 1`] = `
</span>
</span>
</div>
<div
class="ant-space-item"
style="margin-bottom:8px"
>
<span
class="ant-input-group-wrapper ant-input-search"
style="width:304px"
>
<span
class="ant-input-wrapper ant-input-group"
>
<span
class="ant-input-group-addon"
>
https://
</span>
<span
class="ant-input-affix-wrapper"
>
<input
class="ant-input"
placeholder="input search text"
type="text"
value=""
/>
<span
class="ant-input-suffix"
>
<span
aria-label="close-circle"
class="anticon anticon-close-circle ant-input-clear-icon-hidden ant-input-clear-icon"
role="button"
tabindex="-1"
>
<svg
aria-hidden="true"
data-icon="close-circle"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm165.4 618.2l-66-.3L512 563.4l-99.3 118.4-66.1.3c-4.4 0-8-3.5-8-8 0-1.9.7-3.7 1.9-5.2l130.1-155L340.5 359a8.32 8.32 0 01-1.9-5.2c0-4.4 3.6-8 8-8l66.1.3L512 464.6l99.3-118.4 66-.3c4.4 0 8 3.5 8 8 0 1.9-.7 3.7-1.9 5.2L553.5 514l130 155c1.2 1.5 1.9 3.3 1.9 5.2 0 4.4-3.6 8-8 8z"
/>
</svg>
</span>
</span>
</span>
<span
class="ant-input-group-addon"
>
<button
class="ant-btn ant-btn-icon-only ant-input-search-button"
type="button"
>
<span
aria-label="search"
class="anticon anticon-search"
role="img"
>
<svg
aria-hidden="true"
data-icon="search"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M909.6 854.5L649.9 594.8C690.2 542.7 712 479 712 412c0-80.2-31.3-155.4-87.9-212.1-56.6-56.7-132-87.9-212.1-87.9s-155.5 31.3-212.1 87.9C143.2 256.5 112 331.8 112 412c0 80.1 31.3 155.5 87.9 212.1C256.5 680.8 331.8 712 412 712c67 0 130.6-21.8 182.7-62l259.7 259.6a8.2 8.2 0 0011.6 0l43.6-43.5a8.2 8.2 0 000-11.6zM570.4 570.4C528 612.7 471.8 636 412 636s-116-23.3-158.4-65.6C211.3 528 188 471.8 188 412s23.3-116.1 65.6-158.4C296 211.3 352.2 188 412 188s116.1 23.2 158.4 65.6S636 352.2 636 412s-23.3 116.1-65.6 158.4z"
/>
</svg>
</span>
</button>
</span>
</span>
</span>
</div>
<div
class="ant-space-item"
style="margin-bottom:8px"

View File

@ -89,11 +89,14 @@ const App = () => (
<br />
<Input.Group compact>
<Input style={{ width: 'calc(100% - 200px)' }} defaultValue="https://ant.design" />
<Button type="primary">Sumbit</Button>
<Button type="primary">Submit</Button>
</Input.Group>
<br />
<Input.Group compact>
<Input style={{ width: 'calc(100% - 200px)' }} defaultValue="git@github.com:ant-design/ant-design.git" />
<Input
style={{ width: 'calc(100% - 200px)' }}
defaultValue="git@github.com:ant-design/ant-design.git"
/>
<Tooltip title="copy git url">
<Button icon={<CopyOutlined />} />
</Tooltip>

View File

@ -34,6 +34,13 @@ ReactDOM.render(
<Space direction="vertical">
<Search placeholder="input search text" onSearch={onSearch} style={{ width: 200 }} />
<Search placeholder="input search text" allowClear onSearch={onSearch} style={{ width: 200 }} />
<Search
addonBefore="https://"
placeholder="input search text"
allowClear
onSearch={onSearch}
style={{ width: 304 }}
/>
<Search placeholder="input search text" onSearch={onSearch} enterButton />
<Search
placeholder="input search text"

View File

@ -293,11 +293,6 @@
}
.@{inputClass}-affix-wrapper {
&:not(:first-child) {
border-top-left-radius: 0;
border-bottom-left-radius: 0;
}
&:not(:last-child) {
border-top-right-radius: 0;
border-bottom-right-radius: 0;
@ -306,6 +301,12 @@
border-bottom-left-radius: @border-radius-base;
}
}
&:not(:first-child),
.@{ant-prefix}-input-search &:not(:first-child) {
border-top-left-radius: 0;
border-bottom-left-radius: 0;
}
}
&&-compact {

View File

@ -1,21 +1,39 @@
/* eslint-disable no-template-curly-in-string */
import Pagination from 'rc-pagination/lib/locale/et_EE';
import DatePicker from '../date-picker/locale/et_EE';
import TimePicker from '../time-picker/locale/et_EE';
import Calendar from '../calendar/locale/et_EE';
import { Locale } from '../locale-provider';
const typeTemplate = '${label} ei ole kehtiv ${type}';
const localeValues: Locale = {
locale: 'et',
Pagination,
DatePicker,
TimePicker,
Calendar,
global: {
placeholder: 'Palun vali',
},
Table: {
filterTitle: 'Filtri menüü',
filterConfirm: 'OK',
filterReset: 'Nulli',
filterEmptyText: 'Filtreid pole',
filterCheckall: 'Vali kõik',
filterSearchPlaceholder: 'Otsi filtritest',
emptyText: 'Andmed puuduvad',
selectAll: 'Vali kõik',
selectInvert: 'Inverteeri valik',
selectNone: 'Kustuta kõik andmed',
selectionAll: 'Vali kõik andmed',
sortTitle: 'Sorteeri',
expand: 'Laienda rida',
collapse: 'Ahenda rida',
triggerDesc: 'Klõpsa kahanevalt sortimiseks',
triggerAsc: 'Klõpsa kasvavalt sortimiseks',
cancelSort: 'Klõpsa sortimise tühistamiseks',
},
Modal: {
okText: 'OK',
@ -27,20 +45,92 @@ const localeValues: Locale = {
cancelText: 'Tühista',
},
Transfer: {
titles: ['', ''],
searchPlaceholder: 'Otsi siit',
itemUnit: 'kogus',
itemsUnit: 'kogus',
itemsUnit: 'kogused',
remove: 'Eemalda',
selectCurrent: 'Vali praegune leht',
removeCurrent: 'Eemalda praegune leht',
selectAll: 'Vali kõik',
removeAll: 'Eemalda kõik andmed',
selectInvert: 'Inverteeri valik',
},
Upload: {
uploading: 'Üleslaadimine...',
removeFile: 'Eemalda fail',
uploadError: 'Üleslaadimise tõrge',
previewFile: 'Faili eelvaade',
downloadFile: 'Laadige fail alla',
downloadFile: 'Lae fail alla',
},
Empty: {
description: 'Andmed puuduvad',
},
Icon: {
icon: 'ikoon',
},
Text: {
edit: 'Muuda',
copy: 'Kopeeri',
copied: 'Kopeeritud',
expand: 'Laienda',
},
PageHeader: {
back: 'Tagasi',
},
Form: {
optional: '(valikuline)',
defaultValidateMessages: {
default: '${label} välja valideerimise viga',
required: 'Palun sisesta ${label}',
enum: '${label} peab olema üks järgmistest: [${enum}]',
whitespace: '${label} ei saa olla tühi märk',
date: {
format: '${label} kuupäevavorming on kehtetu',
parse: '${label} ei saa kuupäevaks teisendada',
invalid: '${label} on vale kuupäev',
},
types: {
string: typeTemplate,
method: typeTemplate,
array: typeTemplate,
object: typeTemplate,
number: typeTemplate,
date: typeTemplate,
boolean: typeTemplate,
integer: typeTemplate,
float: typeTemplate,
regexp: typeTemplate,
email: typeTemplate,
url: typeTemplate,
hex: typeTemplate,
},
string: {
len: '${label} peab koosnema ${len} tähemärgist',
min: '${label} peab olema vähemalt ${min} tähemärki',
max: '${label} peab olema kuni ${max} tähemärki',
range: '${label} peab olema vahemikus ${min}${max} tähemärki',
},
number: {
len: '${label} must be equal to ${len}',
min: '${label} peab olema vähemalt ${min}',
max: '${label} peab olema maksimaalne ${max}',
range: '${label} peab olema vahemikus ${min}${max}',
},
array: {
len: 'Peab olema ${len} ${label}',
min: 'Vähemalt ${min} ${label}',
max: 'Maksimaalselt ${max} ${label}',
range: '${label} summa peab olema vahemikus ${min}${max}',
},
pattern: {
mismatch: '${label} ei vasta mustrile ${pattern}',
},
},
},
Image: {
preview: 'Eelvaade',
},
};
export default localeValues;

View File

@ -1,21 +1,36 @@
/* eslint-disable no-template-curly-in-string */
import Pagination from 'rc-pagination/lib/locale/pl_PL';
import DatePicker from '../date-picker/locale/pl_PL';
import TimePicker from '../time-picker/locale/pl_PL';
import Calendar from '../calendar/locale/pl_PL';
import { Locale } from '../locale-provider';
const typeTemplate = '${label} nie posiada poprawnej wartości dla typu ${type}';
const localeValues: Locale = {
locale: 'pl',
Pagination,
DatePicker,
TimePicker,
Calendar,
global: {
placeholder: 'Wybierz',
},
Table: {
filterTitle: 'Menu filtra',
filterConfirm: 'OK',
filterReset: 'Wyczyść',
filterReset: 'Usuń filtry',
filterEmptyText: 'Brak filtrów',
filterCheckall: 'Wybierz wszystkie elementy',
filterSearchPlaceholder: 'Szukaj w filtrach',
emptyText: 'Brak danych',
selectAll: 'Zaznacz bieżącą stronę',
selectInvert: 'Odwróć zaznaczenie',
selectNone: 'Wyczyść',
selectionAll: 'Wybierz wszystkie',
sortTitle: 'Sortowanie',
expand: 'Rozwiń wiersz',
collapse: 'Zwiń wiersz',
triggerDesc: 'Sortuj malejąco',
triggerAsc: 'Sortuj rosnąco',
cancelSort: 'Usuń sortowanie',
@ -30,9 +45,16 @@ const localeValues: Locale = {
cancelText: 'Anuluj',
},
Transfer: {
titles: ['', ''],
searchPlaceholder: 'Szukaj',
itemUnit: 'obiekt',
itemsUnit: 'obiekty',
remove: 'Usuń',
selectCurrent: 'Wybierz aktualną stronę',
removeCurrent: 'Usuń aktualną stronę',
selectAll: 'Wybierz wszystkie',
removeAll: 'Usuń wszystkie',
selectInvert: 'Odwróć wybór',
},
Upload: {
uploading: 'Wysyłanie...',
@ -44,6 +66,71 @@ const localeValues: Locale = {
Empty: {
description: 'Brak danych',
},
Icon: {
icon: 'Ikona',
},
Text: {
edit: 'Edytuj',
copy: 'Kopiuj',
copied: 'Skopiowany',
expand: 'Rozwiń',
},
PageHeader: {
back: 'Wstecz',
},
Form: {
optional: '(opcjonalne)',
defaultValidateMessages: {
default: 'Błąd walidacji dla pola ${label}',
required: 'Pole ${label} jest wymagane',
enum: 'Pole ${label} musi posiadać wartość z listy: [${enum}]',
whitespace: 'Pole ${label} nie może być puste',
date: {
format: '${label} posiada zły format daty',
parse: '${label} nie może zostać zinterpretowane jako data',
invalid: '${label} jest niepoprawną datą',
},
types: {
string: typeTemplate,
method: typeTemplate,
array: typeTemplate,
object: typeTemplate,
number: typeTemplate,
date: typeTemplate,
boolean: typeTemplate,
integer: typeTemplate,
float: typeTemplate,
regexp: typeTemplate,
email: typeTemplate,
url: typeTemplate,
hex: typeTemplate,
},
string: {
len: '${label} musi posiadać ${len} znaków',
min: '${label} musi posiadać co namniej ${min} znaków',
max: '${label} musi posiadać maksymalnie ${max} znaków',
range: '${label} musi posiadać między ${min} a ${max} znaków',
},
number: {
len: '${label} musi mieć wartość o długości ${len}',
min: '${label} musi mieć wartość większą lub równą ${min}',
max: '${label} musi mieć wartość mniejszą lub równą ${max}',
range: '${label} musi mieć wartość pomiędzy ${min} a ${max}',
},
array: {
len: '${label} musi posiadać ${len} elementów',
min: '${label} musi posiadać co najmniej ${len} elementów',
max: '${label} musi posiadać maksymalnie ${len} elementów',
range: '${label} musi posiadać między ${min} a ${max} elementów',
},
pattern: {
mismatch: '${label} nie posiada wartości zgodnej ze wzorem ${pattern}',
},
},
},
Image: {
preview: 'Podgląd',
},
};
export default localeValues;

View File

@ -687,6 +687,14 @@
}
}
// https://github.com/ant-design/ant-design/issues/32950
.@{ant-prefix}-menu-inline-collapsed-tooltip {
a,
a:hover {
color: @white;
}
}
@import './light';
@import './dark';
@import './rtl';

View File

@ -198,7 +198,7 @@ function notice(args: ArgsProps): MessageType {
return result;
}
type ConfigContent = React.ReactNode | string;
type ConfigContent = React.ReactNode;
type ConfigDuration = number | (() => void);
type JointContent = ConfigContent | ArgsProps;
export type ConfigOnClose = () => void;

View File

@ -99,6 +99,7 @@ const ConfirmDialog = (props: ConfirmDialogProps) => {
maskClosable={maskClosable}
maskStyle={maskStyle}
style={style}
bodyStyle={bodyStyle}
width={width}
zIndex={zIndex}
afterClose={afterClose}
@ -111,7 +112,7 @@ const ConfirmDialog = (props: ConfirmDialogProps) => {
focusTriggerAfterClose={focusTriggerAfterClose}
>
<div className={`${contentPrefixCls}-body-wrapper`}>
<div className={`${contentPrefixCls}-body`} style={bodyStyle}>
<div className={`${contentPrefixCls}-body`}>
{icon}
{props.title === undefined ? null : (
<span className={`${contentPrefixCls}-title`}>{props.title}</span>

View File

@ -38,7 +38,7 @@ export interface ModalProps {
/** 确定按钮 loading */
confirmLoading?: boolean;
/** 标题 */
title?: React.ReactNode | string;
title?: React.ReactNode;
/** 是否显示右上角的关闭按钮 */
closable?: boolean;
/** 点击确定回调 */

View File

@ -545,4 +545,10 @@ describe('Modal.confirm triggers callbacks correctly', () => {
await sleep(500);
expect(afterClose).toHaveBeenCalled();
});
it('bodyStyle', async () => {
open({ bodyStyle: { width: 500 } });
const { width } = $$('.ant-modal-body')[0].style;
expect(width).toBe('500px');
});
});

View File

@ -27,16 +27,12 @@ export type ModalFunc = (props: ModalFuncProps) => {
export type ModalStaticFunctions = Record<NonNullable<ModalFuncProps['type']>, ModalFunc>;
export default function confirm(config: ModalFuncProps) {
const div = document.createElement('div');
document.body.appendChild(div);
const container = document.createDocumentFragment();
// eslint-disable-next-line @typescript-eslint/no-use-before-define
let currentConfig = { ...config, close, visible: true } as any;
function destroy(...args: any[]) {
const unmountResult = ReactDOM.unmountComponentAtNode(div);
if (unmountResult && div.parentNode) {
div.parentNode.removeChild(div);
}
ReactDOM.unmountComponentAtNode(container);
const triggerCancel = args.some(param => param && param.triggerCancel);
if (config.onCancel && triggerCancel) {
config.onCancel(...args);
@ -74,7 +70,7 @@ export default function confirm(config: ModalFuncProps) {
okText={okText || (props.okCancel ? runtimeLocale.okText : runtimeLocale.justOkText)}
cancelText={cancelText || runtimeLocale.cancelText}
/>,
div,
container,
);
});
}

View File

@ -117,6 +117,7 @@
.@{dialog-prefix-cls} {
top: 0;
display: inline-block;
padding-bottom: 0;
text-align: left;
vertical-align: middle;
}

View File

@ -66,7 +66,7 @@
color: @heading-color;
font-weight: 600;
font-size: @page-header-heading-title;
line-height: 32px;
line-height: @height-base;
.text-overflow-ellipsis();
}

View File

@ -20,11 +20,6 @@ export interface PaginationProps extends RcPaginationProps {
showQuickJumper?: boolean | { goButton?: React.ReactNode };
size?: 'default' | 'small';
responsive?: boolean;
itemRender?: (
page: number,
type: 'page' | 'prev' | 'next' | 'jump-prev' | 'jump-next',
originalElement: React.ReactElement<HTMLElement>,
) => React.ReactNode;
role?: string;
totalBoundaryShowSizeChanger?: number;
}

View File

@ -10,15 +10,10 @@
&::placeholder {
color: @color;
user-select: none; // https://github.com/ant-design/ant-design/pull/32639
}
&:placeholder-shown {
text-overflow: ellipsis;
}
// Chrome
/* stylelint-disable-next-line selector-no-vendor-prefix */
&::-webkit-input-placeholder {
user-select: none;
}
}

View File

@ -4,12 +4,10 @@
@import 'compatibility';
@import 'clearfix';
@import 'iconfont';
@import 'operation-unit';
@import 'typography';
@import 'customize';
@import 'box';
@import 'modal-mask';
// Note: These mixins require theme variables. Let's move to theme file instead:
// @import 'motion';
// @import 'reset';
@import 'motion';
@import 'reset';
@import 'operation-unit';

View File

@ -1,5 +1,3 @@
@import (reference) '../../style/themes/index';
.operation-unit() {
color: @link-color;
text-decoration: none;

View File

@ -1,6 +1,5 @@
/* stylelint-disable at-rule-empty-line-before,at-rule-name-space-after,at-rule-no-unknown */
@import '../color/colors';
@import './mixins/index';
@theme: default;

View File

@ -1,2 +0,0 @@
@import 'motion';
@import 'reset';

View File

@ -1,6 +1,5 @@
/* stylelint-disable at-rule-empty-line-before,at-rule-name-space-after,at-rule-no-unknown */
@import '../color/colors';
@import './mixins/index';
@theme: variable;

View File

@ -22,10 +22,10 @@ class Demo extends React.Component {
constructor(props) {
super(props);
this.newTabIndex = 0;
const panes = [
{ title: 'Tab 1', content: 'Content of Tab Pane 1', key: '1' },
{ title: 'Tab 2', content: 'Content of Tab Pane 2', key: '2' },
];
const panes = new Array(2).fill(null).map((_, index) => {
const id = String(index + 1);
return { title: `Tab ${id}`, content: `Content of Tab Pane ${id}`, key: id };
});
this.state = {
activeKey: panes[0].key,
panes,

View File

@ -31,6 +31,8 @@
box-shadow: @box-shadow-base;
&-item {
display: flex;
align-items: center;
min-width: 120px;
margin: 0;
padding: @dropdown-vertical-padding @control-padding-horizontal;
@ -44,6 +46,25 @@
cursor: pointer;
transition: all 0.3s;
> span {
flex: 1;
white-space: nowrap;
}
&-remove {
flex: none;
margin-left: @margin-sm;
color: @text-color-secondary;
font-size: @font-size-sm;
background: transparent;
border: 0;
cursor: pointer;
&:hover {
color: @tabs-hover-color;
}
}
&:hover {
background: @item-hover-bg;
}

View File

@ -1,6 +1,6 @@
import * as React from 'react';
import HolderOutlined from '@ant-design/icons/HolderOutlined';
import RcTree, { TreeNode, TreeProps as RcTreeProps } from 'rc-tree';
import RcTree, { TreeNode, TreeProps as RcTreeProps, BasicDataNode } from 'rc-tree';
import classNames from 'classnames';
import { DataNode, Key } from 'rc-tree/lib/interface';
import DirectoryTree from './DirectoryTree';
@ -98,8 +98,8 @@ interface DraggableConfig {
nodeDraggable?: DraggableFn;
}
export interface TreeProps
extends Omit<RcTreeProps, 'prefixCls' | 'showLine' | 'direction' | 'draggable'> {
export interface TreeProps<T extends BasicDataNode = DataNode>
extends Omit<RcTreeProps<T>, 'prefixCls' | 'showLine' | 'direction' | 'draggable'> {
showLine?: boolean | { showLeafIcon: boolean };
className?: string;
/** 是否支持多选 */
@ -143,11 +143,13 @@ export interface TreeProps
blockNode?: boolean;
}
interface CompoundedComponent
extends React.ForwardRefExoticComponent<TreeProps & React.RefAttributes<RcTree>> {
type CompoundedComponent = (<T extends BasicDataNode | DataNode = DataNode>(
props: React.PropsWithChildren<TreeProps<T>> & { ref?: React.Ref<RcTree> },
) => React.ReactElement) & {
defaultProps: Partial<React.PropsWithChildren<TreeProps<any>>>;
TreeNode: typeof TreeNode;
DirectoryTree: typeof DirectoryTree;
}
};
const Tree = React.forwardRef<RcTree, TreeProps>((props, ref) => {
const { getPrefixCls, direction, virtual } = React.useContext(ConfigContext);
@ -223,7 +225,7 @@ const Tree = React.forwardRef<RcTree, TreeProps>((props, ref) => {
{children}
</RcTree>
);
}) as CompoundedComponent;
}) as unknown as CompoundedComponent;
Tree.TreeNode = TreeNode;

View File

@ -0,0 +1,51 @@
import * as React from 'react';
import { mount } from 'enzyme';
import type { BasicDataNode } from 'rc-tree';
import Tree from '../index';
describe('Tree.TypeScript', () => {
it('without generic', () => {
const wrapper = mount(
<Tree
treeData={[
{
title: 'Bamboo',
key: 'bamboo',
children: [
{
title: 'Little',
key: 'little',
},
],
},
]}
/>,
);
expect(wrapper).toBeTruthy();
});
it('support generic', () => {
interface MyDataNode extends BasicDataNode {
bamboo: string;
list?: MyDataNode[];
}
const wrapper = mount(
<Tree<MyDataNode>
treeData={[
{
bamboo: 'good',
list: [
{
bamboo: 'well',
},
],
},
]}
/>,
);
expect(wrapper).toBeTruthy();
});
});

View File

@ -10,7 +10,7 @@ import { isValidElement, cloneElement } from '../../_util/reactNode';
export default function renderSwitcherIcon(
prefixCls: string,
switcherIcon: React.ReactNode | null | undefined,
switcherIcon: React.ReactNode,
showLine: boolean | { showLeafIcon: boolean } | undefined,
{ isLeaf, expanded, loading }: AntTreeNodeProps,
) {

View File

@ -5,9 +5,10 @@ title: Dynamic Theme (Experimental)
Except [less customize theme](/docs/react/customize-theme), We also provide CSS Variable version to enable dynamic theme. You can check on [ConfigProvider](/components/config-provider/#components-config-provider-demo-theme) demo.
## Notice
## Caveats
This function need CSS Variable support which mean it can not support IE. Please make sure your browser requirement.
- This function depends on CSS Variables. Please check the [browser compatibility](https://caniuse.com/css-variables).
- This function requires at least `antd@4.17.0-alpha.0`.
## How to use

View File

@ -1,6 +1,6 @@
{
"name": "antd",
"version": "4.17.0-alpha.10",
"version": "4.17.1",
"description": "An enterprise-class UI design language and React components implementation",
"title": "Ant Design",
"keywords": [
@ -60,7 +60,6 @@
"pretest": "npm run version",
"predist": "npm run version",
"presite": "npm run version",
"color-less": "node ./scripts/generate-color-less",
"compile": "npm run clean && antd-tools run compile",
"changelog": "node ./scripts/print-changelog",
"predeploy": "antd-tools run clean && npm run site && cp CNAME _site && npm run site:test",
@ -84,10 +83,13 @@
"pretty-quick": "pretty-quick",
"pub": "npm run version && antd-tools run pub",
"prepublishOnly": "antd-tools run guard",
"site": "cross-env NODE_ICU_DATA=node_modules/full-icu ESBUILD=1 concurrently \"bisheng build --ssr -c ./site/bisheng.config.js\" \"npm run color-less\"",
"site:theme": "npm run site:theme-dark && npm run site:theme-compact",
"site:theme-dark": "cross-env ESBUILD=1 ANT_THEME=dark bisheng build --ssr -c ./site/bisheng.config.js",
"site:theme-compact": "cross-env ESBUILD=1 ANT_THEME=compact bisheng build --ssr -c ./site/bisheng.config.js",
"site": "npm run site:theme && cross-env NODE_ICU_DATA=node_modules/full-icu ESBUILD=1 concurrently \"bisheng build --ssr -c ./site/bisheng.config.js\"",
"sort": "npx sort-package-json",
"sort-api": "antd-tools run sort-api-table",
"start": "antd-tools run clean && cross-env NODE_ENV=development concurrently \"npm run color-less\" \"bisheng start -c ./site/bisheng.config.js\"",
"start": "antd-tools run clean && cross-env NODE_ENV=development concurrently \"bisheng start -c ./site/bisheng.config.js\"",
"test": "jest --config .jest.js --cache=false",
"test:update": "jest --config .jest.js --cache=false -u",
"test-all": "sh -e ./scripts/test-all.sh",
@ -118,7 +120,7 @@
"copy-to-clipboard": "^3.2.0",
"lodash": "^4.17.21",
"moment": "^2.25.3",
"rc-cascader": "~2.1.0",
"rc-cascader": "~2.2.0",
"rc-checkbox": "~2.3.0",
"rc-collapse": "~3.1.0",
"rc-dialog": "~8.6.0",
@ -144,8 +146,8 @@
"rc-tabs": "~11.10.0",
"rc-textarea": "~0.3.0",
"rc-tooltip": "~5.1.1",
"rc-tree": "~5.2.0",
"rc-tree-select": "~4.6.0",
"rc-tree": "~5.3.0",
"rc-tree-select": "~4.7.0",
"rc-trigger": "^5.2.10",
"rc-upload": "~4.3.0",
"rc-util": "^5.14.0",
@ -177,8 +179,6 @@
"@typescript-eslint/parser": "^5.0.0",
"@wojtekmaj/enzyme-adapter-react-17": "^0.6.0",
"antd-img-crop": "^3.1.1",
"antd-pro-merge-less": "^3.0.11",
"antd-theme-generator": "^1.2.3",
"argos-cli": "^0.3.0",
"array-move": "^4.0.0",
"babel-plugin-add-react-displayname": "^0.0.5",
@ -202,14 +202,14 @@
"eslint-config-airbnb": "^18.0.0",
"eslint-config-prettier": "^8.0.0",
"eslint-plugin-babel": "^5.3.0",
"eslint-plugin-compat": "^3.9.0",
"eslint-plugin-compat": "^4.0.0",
"eslint-plugin-import": "^2.21.1",
"eslint-plugin-jest": "^25.0.1",
"eslint-plugin-jsx-a11y": "^6.2.1",
"eslint-plugin-markdown": "^2.0.0",
"eslint-plugin-react": "^7.20.6",
"eslint-plugin-react-hooks": "^4.1.2",
"eslint-plugin-unicorn": "^38.0.0",
"eslint-plugin-unicorn": "^39.0.0",
"fetch-jsonp": "^1.1.3",
"fs-extra": "^10.0.0",
"full-icu": "^1.3.0",
@ -273,11 +273,11 @@
"stylelint": "^14.0.0",
"stylelint-config-prettier": "^9.0.2",
"stylelint-config-rational-order": "^0.1.2",
"stylelint-config-standard": "^23.0.0",
"stylelint-config-standard": "^24.0.0",
"stylelint-declaration-block-no-ignored-properties": "^2.1.0",
"stylelint-order": "^5.0.0",
"theme-switcher": "^1.0.2",
"typescript": "~4.4.2",
"typescript": "~4.5.2",
"webpack-bundle-analyzer": "^4.1.0",
"xhr-mock": "^2.4.1",
"xhr2": "^0.2.0",

View File

@ -1,50 +0,0 @@
#!/usr/bin/env node
const path = require('path');
const { generateTheme } = require('antd-theme-generator');
const genCss = require('antd-pro-merge-less');
const defaultVar = require('./default-vars');
const dark = require('./dark-vars');
const compact = require('./compact-vars');
genCss(
path.join(__dirname, '..'),
[
{
theme: 'dark',
fileName: './_site/dark.css',
modifyVars: {
...defaultVar,
...dark,
'@site-text-color': '@heading-color',
'@site-markdown-code-bg': '@input-bg',
},
},
{
theme: 'compact',
fileName: './_site/compact.css',
modifyVars: {
...defaultVar,
...compact,
},
},
],
{
ignoreAntd: true,
isModule: false,
cache: false,
loadAny: true,
ignoreProLayout: true,
},
);
const options = {
antDir: path.join(__dirname, '../node_modules/antd'),
stylesDir: path.join(__dirname, '../site/theme/static'),
antdStylesDir: path.join(__dirname, '../node_modules/antd/lib/'),
varFile: path.join(__dirname, '../site/theme/static/theme.less'),
mainLessFile: path.join(__dirname, '../site/theme/static/index.less'),
themeVariables: ['@primary-color'],
outputFilePath: path.join(__dirname, '../_site/color.less'),
};
generateTheme(options);

View File

@ -8,6 +8,7 @@ const themeConfig = require('./themeConfig');
const { webpack } = getWebpackConfig;
const isDev = process.env.NODE_ENV === 'development';
const { ANT_THEME } = process.env;
function alertBabelConfig(rules) {
rules.forEach(rule => {
@ -36,7 +37,7 @@ module.exports = {
'components/form/v3': ['components/form/v3.zh-CN.md', 'components/form/v3.en-US.md'],
'docs/resources': ['./docs/resources.zh-CN.md', './docs/resources.en-US.md'],
},
theme: './site/theme',
theme: ANT_THEME ? './site/theme/index-css-only.js' : './site/theme',
htmlTemplate: './site/theme/static/template.html',
themeConfig,
filePathMapper(filePath) {
@ -57,7 +58,7 @@ module.exports = {
lessConfig: {
javascriptEnabled: true,
modifyVars: {
'root-entry-name': 'variable',
'root-entry-name': ANT_THEME || 'variable',
},
},
webpackConfig(config) {
@ -110,6 +111,16 @@ module.exports = {
delete config.module.noParse;
if (ANT_THEME) {
config.mode = 'development';
config.plugins.forEach(plugin => {
if (plugin?.options?.filename?.includes?.('.css')) {
delete plugin.options.chunkFilename;
plugin.options.filename = `${ANT_THEME}.css`;
}
});
}
return config;
},

View File

@ -0,0 +1,19 @@
/**
* ZombieJ: This file is used for generate site theme css only. Which only provides dark.css and
* compact.css for theme switcher.
*/
const config = require('./index');
const homeTmpl = './template/Home/index';
const cloneConfig = {
...config,
};
cloneConfig.routes = {
path: '/',
component: './template/Layout/index',
indexRoute: { component: homeTmpl },
};
module.exports = cloneConfig;

View File

@ -1,5 +1,3 @@
@import (reference) '../../../components/style/themes/variable.less';
#header {
// ===================== Home Page =====================
&.home-header {

View File

@ -1,26 +1,27 @@
@import '../../../components/style/themes/index.less';
@import './reset.less';
@import '../../../components/style/themes/variable.less';
@import './common';
@import './header';
@import './footer';
@import './home';
@import './page-nav';
@import './markdown';
@import './design-doc';
@import './preview-img';
@import './toc';
@import './not-found';
@import './highlight';
@import './demo';
@import './colors';
@import './icons';
@import './icon-pic-searcher';
@import './mock-browser';
@import './motion';
@import './responsive';
@import './theme';
@import './docsearch';
@import './nprogress';
@import './contributors';
@import './common.less';
@import './header.less';
@import './footer.less';
@import './home.less';
@import './page-nav.less';
@import './markdown.less';
@import './design-doc.less';
@import './preview-img.less';
@import './toc.less';
@import './not-found.less';
@import './highlight.less';
@import './demo.less';
@import './colors.less';
@import './icons.less';
@import './icon-pic-searcher.less';
@import './mock-browser.less';
@import './motion.less';
@import './responsive.less';
@import './theme.less';
@import './docsearch.less';
@import './nprogress.less';
@import './contributors.less';
@import './dark.less';
@import './rtl.less';

View File

@ -1,5 +1,3 @@
@import (reference) '../../../components/style/themes/variable.less';
.nav-phone-icon {
position: absolute;
top: 25px;

View File

@ -27,7 +27,7 @@
/* 设置 meta theme-color 的值,默认会设置一个 #1890ff */
function setColor(isDarken) {
try {
const theme = document.getElementsByTagName('meta')['theme-color'];
var theme = document.getElementsByTagName('meta')['theme-color'];
theme.setAttribute('content', isDarken ? 'rgba(0,0,0,0.65)' : '#1890ff');
} catch (error) {}
}
@ -37,20 +37,37 @@
function getSearchParam(search) {
// 处理入参错误
var search = search || location.search;
if (search === undefined) return;
if (search === undefined) {
return;
}
var pattern = /(\w+)=(\w+)/gi; // 定义正则
var matches = search.match(pattern);
if (!matches) return;
if (!matches) {
return;
}
var searchParam = Object.fromEntries(matches.map(item => item.split('=')));
function fromEntries(iterable) {
return iterable.reduce(function (obj, keyvalue) {
var key = keyvalue[0];
var val = keyvalue[1];
obj[key] = val;
return obj;
}, {});
}
var searchParam = fromEntries(
matches.map(function (item) {
return item.split('=');
}),
);
return searchParam;
}
var searchParam = getSearchParam(location.search) || {}; // 查询参数对象
var isDarkMode = searchParam.theme === 'dark'; // 判断当前主题
var isComponentsPage = location.pathname.startsWith('/components'); // 判断是否组件页面
var isComponentsPage = location.pathname.indexOf('/components') === 0; // 判断是否组件页面
// 1. 暗色主题刷新时无白屏
// 如果是暗色主题且在components路由下
@ -59,13 +76,19 @@
// 将预先定义的暗色主题link移动到body内
document.addEventListener(
'readystatechange',
() => {
document.body.prepend(darkThemeLinkEl);
function () {
document.head.appendChild(styleElement);
},
{ once: true },
);
// load后卸载
window.addEventListener('load', () => darkThemeLinkEl.remove(), { once: true });
window.addEventListener(
'load',
function () {
darkThemeLinkEl.parentNode.removeChild(darkThemeLinkEl);
},
{ once: true },
);
setColor(true);
// 清除dark.css中的全部transition 待解析完后恢复
var styleElement = document.createElement('style');
@ -74,14 +97,20 @@
'* {transition: none !important;} html {background: rgb(20, 20, 20)}';
document.head.appendChild(styleElement);
document.documentElement.style.backgroundColor = 'black';
window.addEventListener('load', () => styleElement.remove(), { once: true });
window.addEventListener(
'load',
function () {
styleElement.parentNode.removeChild(styleElement);
},
{ once: true },
);
// 设置系统主题
document.documentElement.style.colorScheme = 'dark';
} else {
setColor(false);
document.documentElement.style.colorScheme = 'light';
darkThemeLinkEl.remove();
darkThemeLinkEl.parentNode.removeChild(darkThemeLinkEl);
}
})();
</script>
@ -105,13 +134,13 @@
return /-cn\/?$/.test(pathname);
}
function getLocalizedPathname(path, zhCN) {
var pathname = path.startsWith('/') ? path : '/' + path;
var pathname = path.indexOf('/') === 0 ? path : '/' + path;
if (!zhCN) {
// to enUS
return /\/?index-cn/.test(pathname) ? '/' : pathname.replace('-cn', '');
} else if (pathname === '/') {
return '/index-cn';
} else if (pathname.endsWith('/')) {
} else if (pathname.indexOf('/') === pathname.length - 1) {
return pathname.replace(/\/$/, '-cn/');
}
return pathname + '-cn';

View File

@ -1,4 +1,3 @@
@import (reference) '../../../components/style/themes/variable.less';
@import './colors.less';
@import './home.less';

View File

@ -1,4 +1,4 @@
@import (reference) '../../../../components/style/themes/variable.less';
@import (reference) '../../../../components/style/themes/index.less';
.components-overview {
padding: 0;

View File

@ -1,4 +1,4 @@
@import (reference) '../../../../../components/style/themes/variable.less';
@import (reference) '../../../../../components/style/themes/index.less';
.home-banner-background {
position: absolute;

View File

@ -1,4 +1,4 @@
@import (reference) '../../../../../components/style/themes/variable.less';
@import (reference) '../../../../../components/style/themes/index.less';
.home-card-logo {
position: relative;

View File

@ -1,4 +1,4 @@
@import (reference) '../../../../../components/style/themes/variable.less';
@import (reference) '../../../../../components/style/themes/index.less';
@home-color: #0170fe;

View File

@ -1,4 +1,4 @@
@import (reference) '../../../../../components/style/themes/variable.less';
@import (reference) '../../../../../components/style/themes/index.less';
.design-card {
position: relative;

View File

@ -1,4 +1,4 @@
@import (reference) '../../../../components/style/themes/variable.less';
@import (reference) '../../../../components/style/themes/index.less';
.more-card {
&:hover {

View File

@ -1,4 +1,4 @@
@import (reference) '../../../../components/style/themes/variable.less';
@import (reference) '../../../../components/style/themes/index.less';
.linear-gradient(@mid-pos, @end-pos) {
background: linear-gradient(

View File

@ -1,4 +1,4 @@
@import (reference) '../../../../components/style/themes/variable.less';
@import (reference) '../../../../components/style/themes/index.less';
.home-container {
h1,

View File

@ -1,5 +1,5 @@
@import '../../../static/theme.less';
@import (reference) '../../../../../components/style/themes/variable.less';
@import (reference) '../../../../../components/style/themes/index.less';
#github-btn {
display: flex;

View File

@ -1,5 +1,5 @@
@import '../../../static/theme.less';
@import (reference) '../../../../../components/style/themes/variable.less';
@import (reference) '../../../../../components/style/themes/index.less';
@import './index.less';
#logo {

View File

@ -1,5 +1,5 @@
@import '../../../static/theme.less';
@import (reference) '../../../../../components/style/themes/variable.less';
@import (reference) '../../../../../components/style/themes/index.less';
@import './index.less';
#nav {

View File

@ -1,5 +1,5 @@
@import '../../../static/theme.less';
@import (reference) '../../../../../components/style/themes/variable.less';
@import (reference) '../../../../../components/style/themes/index.less';
@import './index.less';
@import './DocSearch.less';

View File

@ -1,5 +1,5 @@
@import '../../../static/theme.less';
@import (reference) '../../../../../components/style/themes/variable.less';
@import (reference) '../../../../../components/style/themes/index.less';
@header-height: 64px;
@menu-item-border: 2px;

View File

@ -1,4 +1,4 @@
@import (reference) '../../../../components/style/themes/variable.less';
@import (reference) '../../../../components/style/themes/index.less';
@import './index.less';
.resource-affix-tabs {

View File

@ -1,4 +1,4 @@
@import (reference) '../../../../components/style/themes/variable.less';
@import (reference) '../../../../components/style/themes/index.less';
@ArticleMaxWidth: 1208px;
@resource-padding: 40px;