Compare commits

...

619 Commits
4.1.2 ... 4.3.0

Author SHA1 Message Date
偏右
9d4d6f5402 Added Irish(ga_IE) locale (#24609)
🆙 upgrade rc-pagination and rc-picker

🇮🇪 docs and test case of Irish locale

Co-authored-by: AbhijeetGaware <56472463+AbhijeetGaware@users.noreply.github.com>
2020-05-31 12:40:10 +08:00
Tom Xu
162b6979af refactor(badge): 🛠 improve code (#24601)
* refactor(badge): improve code

* refactor(badge): improve code

* increase coverage
2020-05-31 12:38:32 +08:00
偏右
b95207d58e Revert "fix: make upload action buttons focusable (#24604)" (#24608)
This reverts commit 8e20fe6779.
2020-05-31 11:50:26 +08:00
偏右
882cec62d6 docs: 🌈 Add Components overview page (#24491)
* docs: Add components overview page

* fix detail

* remove ContributorsList form overview page

* fix components url

* improve code style

* remove extra file

* fix detail

* fix lint

* fix lint

* docs: Finish components overview page

* fix lint

* docs: Update cover

* fix lint

* update cover

* update menu

* improve overview page

* refactor code

* fix order

* update title

* add components count

* fix overview page ssr bug

* move less file

* update title margin

Co-authored-by: arvinxx <arvinx@foxmail.com>
2020-05-31 11:48:34 +08:00
二货机器人
e573ac4e89 docs: 4.3.0 changelog (#24607) 2020-05-31 11:03:08 +08:00
二货机器人
e915a83326 Merge pull request #24606 from ant-design/feature
chore: master merge feature
2020-05-31 09:11:01 +08:00
偏右
a9b95fe63b docs: 📅 DatePicker change start day of week (#24605)
close #5605
close #19229
close #17982
close #3877
close #11552
close #10644
close #12194
2020-05-31 01:01:53 +08:00
Teng YANG
8e20fe6779 fix: make upload action buttons focusable (#24604) 2020-05-31 01:00:23 +08:00
Artem
d8d48487b0 chore: export RuleObject and RuleRender types from Form (#24541)
* Fix Table type

* Add: export RuleObject and RuleRender

Co-authored-by: soroka_av <soroka_av@st.by>
2020-05-30 23:28:11 +08:00
二货机器人
d89cca53b1 docs: Text ellipsis (#24603) 2020-05-30 22:33:24 +08:00
偏右
31fa14a742 test: Update lighthouse-ci.yml (#24598)
* Update lighthouse-ci.yml

* Create lighthouserc.js

* Update index.js

* Add url

* fix url

* fix assertions
2020-05-30 20:37:06 +08:00
二货机器人
77c5adbe4d feat: New Tabs (#24552)
* init style

* support size

* editable

* add shadow

* update demo

* fix nest style

* update rtl

* update snapshot

* bump

* fix hover

* fix test case

* fix style lint

* clean up

* updat docs

* add onTabScroll

* upgrade rc-dropdown

* update snapshot

* clean snapshot

* clean up

Co-authored-by: afc163 <afc163@gmail.com>
2020-05-30 18:28:25 +08:00
偏右
bd9b38527e Delete lighthouserc.js 2020-05-30 16:31:03 +08:00
偏右
00d1276ed2 Create lighthouserc.js 2020-05-30 16:29:53 +08:00
偏右
75d84b2041 Merge pull request #24597 from ant-design/master
chore: Merge master into feature
2020-05-30 15:19:49 +08:00
偏右
cf360252f7 chore: 🆙 upgrade rc-util to 5.x (#24584)
* 🆙 upgrade rc-util to 5.x

* 5.0.1

* Update package.json

* Update package.json

* Update package.json

* Update package.json

* Update package.json

* Update package.json

* Update package.json

* Update package.json

* Update package.json

* upgrade rc-menu and rc-mentions

* upgrade rc-tabs

* upgrade rc-picker

* upgrade rc-table

* fix snapshot

* Update package.json

* Update package.json

* Update package.json
2020-05-30 14:56:03 +08:00
kevin
14f9f95864 docs: Added Ant Design Charts link (#24496)
* Added Ant Design Charts link

* Modified position of  Ant Design Charts

Co-authored-by: liufu.lf <liufu.lf@antfin.com>
2020-05-30 14:55:41 +08:00
Kermit Xuan
0bf728c3e8 docs(table): update hideSelectAll api version (#24594) 2020-05-30 12:31:53 +08:00
偏右
f958a1cbc8 fix: Steps subtitle transition style (#24593)
close #24576
2020-05-30 00:45:24 +08:00
Teng YANG
c353e8bb06 support -readonly suffix on input-affix-wrapper (#24551) 2020-05-30 00:37:59 +08:00
Kermit Xuan
49533aafdc feat(table): support hideSelectAll prop and (#24592)
remove hideDefaultSelections prop in rowSelection(#14581);
2020-05-29 23:50:56 +08:00
偏右
27bc2d1e02 Update package.json 2020-05-29 23:45:26 +08:00
xrkffgg
ada81616b5 style: optimize tree checkbox rtl style (#24563) 2020-05-29 22:28:52 +08:00
Sakari Pesonen
0cdb4c8c86 Extend Finnish locale by updating fi_FI.tsx (#24591)
Added missing localization values for Finnish locale.
2020-05-29 22:04:10 +08:00
linye
76793143ae Update RecommendPage.tsx (#24587) 2020-05-29 19:25:52 +08:00
linye
59a53fbb69 Update MorePage.tsx (#24585) 2020-05-29 19:23:55 +08:00
偏右
c7e1b050ab 🗑️ remove PropTypes (#24577) 2020-05-29 18:05:58 +08:00
偏右
2c9ddcb1b2 fix: List warning (#24568)
* refactor code

* fix: List not recognize colStyle on DOM node

close #24557
2020-05-29 15:27:08 +08:00
Charlie Jonas
37c894f1a2 fix: Progress steps didn't change when update percent (#24534)
* #24532 Progress with steps does not reverse indicator when moving reducing progress percent

* updating snapshots

* Update components/progress/Steps.tsx

Co-authored-by: Amumu <yoyo837@hotmail.com>

* fix tsd and add transition

* add default color for Progress steps

* color => background

* @success-color => @info-color

* @progress-default-color

Co-authored-by: Amumu <yoyo837@hotmail.com>
Co-authored-by: afc163 <afc163@gmail.com>
2020-05-29 13:43:53 +08:00
xrkffgg
059b106ccf docs: update confirm demo (#24569) 2020-05-29 13:39:24 +08:00
xrkffgg
11bbd725f7 fix: transfer rtl (#24560) 2020-05-29 10:36:50 +08:00
afc163
e6b8e24828 fix react-dnd 2020-05-28 23:26:51 +08:00
afc163
9e9e62911c 🆙 upgrade react-dnd 2020-05-28 23:12:04 +08:00
骗你是小猫咪
e761538e26 chore: improve github aciton mirror conditional (#24545) 2020-05-28 22:03:29 +08:00
Kermit Xuan
9b8e0bb908 feat(upload): data support return Promise(#22529) (#24546) 2020-05-28 22:02:56 +08:00
二货机器人
7c77a764e1 Merge pull request #24537 from ant-design/master-to-merge-feature
chore: Master to merge feature
2020-05-28 16:49:21 +08:00
afc163
527f34fe6d fix snapshot 2020-05-28 16:21:18 +08:00
arturpfb
163154a4fb feat: Add ptBR localization to Form and some other components that were missing. (#24518)
* added ptBR localization.

* Corrected lint.

Co-authored-by: Artur Barbosa | Stone <artur.barbosa@stone.com.br>
2020-05-28 16:08:53 +08:00
afc163
e3ac222fd3 🎬 update card demo 2020-05-28 15:49:35 +08:00
afc163
d039e32e6b merge feature into master-to-merge-feature 2020-05-28 15:30:36 +08:00
Tom Xu
56c42e496b refactor(breadcrumb): rewrite with hook (#24512)
* refactor(breadcrumb): rewrite with hook

* Update BreadcrumbItem.tsx
2020-05-28 15:22:00 +08:00
Tom Xu
81bde547cd refactor(rate): improve code (#24524) 2020-05-28 15:21:40 +08:00
xrkffgg
afe7172974 docs: fix rate api (#24536) 2020-05-28 15:19:15 +08:00
偏右
4be9535926 fix: Password value still exists after blur it (#24535)
close #24526
2020-05-28 14:49:03 +08:00
二货机器人
cf401f73c8 fix: Form flex inline style (#24531) 2020-05-28 12:47:37 +08:00
xrkffgg
6773020607 style: optimize calendar content text rtl style (#24528) 2020-05-28 12:22:09 +08:00
xrkffgg
cfd66fa030 fix: cascader expand icon disacled color (#24521) 2020-05-28 12:17:04 +08:00
信鑫-King
6844c413c2 chore: unused deps (#24525) 2020-05-28 12:12:53 +08:00
xrkffgg
9fcd20c6cc style: optimize table filter dropdown rtl style (#24529) 2020-05-28 12:11:31 +08:00
xrkffgg
3712832a03 style: optimize cascader rtl style (#24520) 2020-05-28 10:04:29 +08:00
Tom Xu
fd9846a145 refactor(tag): improve code (#24513) 2020-05-28 09:56:45 +08:00
Tom Xu
030c545964 refactor(switch): improve code (#24516) 2020-05-28 09:55:23 +08:00
xrkffgg
9b54bd728d fix: menu inline collapsed show without icon (#24330)
close #24311
2020-05-27 22:19:07 +08:00
偏右
ef7e7a80d2 test: increase test case cov of List (#24510) 2020-05-27 22:16:35 +08:00
Suki小火车
d5e7187d9d fix: Breadcrumb link margin (#24490)
* fix: breadcrumb a 标签添加间距

* Update components/breadcrumb/style/index.less

Co-authored-by: 偏右 <afc163@gmail.com>

* chore: fix in rtl

* chore: add changelog

* chore: remove changelog

Co-authored-by: 偏右 <afc163@gmail.com>
2020-05-27 20:40:19 +08:00
afc163
b2e92d38eb docs: 📝 add doc about adding language
close #24497
2020-05-27 20:09:05 +08:00
偏右
670ec79fa0 Update i18n.zh-CN.md 2020-05-27 19:53:29 +08:00
Manoj Kumar
19da433933 corrected spell mistake (#24507) 2020-05-27 19:52:35 +08:00
Sanonz
f7c34de3ca fix: Avatar.onError() event is triggered twice (#24506) 2020-05-27 19:25:28 +08:00
zefeng
84df944aaf chore: remove duplicate code (#24504) 2020-05-27 19:19:32 +08:00
偏右
98a13a7569 🆙 upgrade esbuild-webpack-plugin (#24498) 2020-05-27 16:31:55 +08:00
Tom Xu
89d7101e6e refactor: focusTest to ts (#24489) 2020-05-27 12:06:50 +08:00
coskunuyar
ab972ac1eb Preventing parent components changing steps component text align property. (#24486)
Co-authored-by: Coskun Uyar <coskunuyarr@gmail.com>
2020-05-27 11:56:30 +08:00
xrkffgg
9e96b9e2d5 fix: alert close padding (#24471)
* fix: alert close padding

* add compact

* fix var
2020-05-27 10:29:04 +08:00
Tom Xu
2a3fc818d0 refactor(radio): rewrite with hook (#24485)
* refactor(radio): rewrite with hook

* fix lint
2020-05-27 10:21:17 +08:00
Tom Xu
5a1ffb7894 refactor(mentions): rewrite with hook (#24476)
* refactor(mentions): rewrite with hook

* Update index.tsx

* Update index.tsx

* Update index.tsx
2020-05-26 22:29:27 +08:00
Tom Xu
cea0e45671 docs: improve upload (#24482) 2020-05-26 22:29:04 +08:00
偏右
d13c76d7e4 refactor components/radio/group.tsx (#24480) 2020-05-26 22:26:51 +08:00
Tom Xu
5290421ac9 refactor(collapse): rewrite with hook (#24477) 2020-05-26 20:55:39 +08:00
Teng YANG
1bf9959062 fix @tree-directory-selected-bg don't work (#24468) 2020-05-26 13:52:41 +08:00
偏右
75d7038691 chore: update @ant-design/icons import way (#24467) 2020-05-26 12:38:08 +08:00
zoomdong
4e9fc51dba feat: add custom expand style for typography.paragraph (#24385)
* feat: add custom expand style for typography.paragraph

* feat: delete filed-form

* fix: lint error

* feat: add test case

* fix: typo
2020-05-26 11:54:52 +08:00
zefeng
d7949a76ad docs: update tooltip docs (#24465) 2020-05-26 11:41:23 +08:00
Teng YANG
ccd2820ce7 fix: #24205 less class name prefix enhancement (#24459)
* replace ant class prefix with variable in mixin

* replace ant class prefix with variable in wave
2020-05-26 10:32:35 +08:00
xrkffgg
b34b956529 docs: fix btn demo typo (#24463) 2020-05-26 09:37:26 +08:00
xrkffgg
47b3aa2225 docs: add version prompt of message rtl (#24456) 2020-05-26 09:08:07 +08:00
Kermit Xuan
84bd53627b fix: 🐛 Typography title prop support (#24440) 2020-05-25 19:04:40 +08:00
zefeng
cb2094265e feat(tooltip): Tooltip support colour background (#23155)
* feat(tooltip): Tooltip support colour background

Closes #23127

* patch: update test case

* chore: repalce h1 tag to Divider

* chore: update demo
2020-05-25 18:59:00 +08:00
Zohaib Ijaz
f0a4e211b1 imported missing variable imports which are required to compile less files to css (#24450) 2020-05-25 18:58:15 +08:00
Teng YANG
84225e4d50 add en_GB localisations for form (#24404) 2020-05-25 18:56:11 +08:00
xrkffgg
94edeaa02f feat: add avatar gap api (#24357)
* feat: add avatar gap api

* docs: update explain

* fix: gap in span

* docs: update

* fix: test

* remove lastgap
2020-05-25 17:56:48 +08:00
偏右
c93400d375 feat: ⌨️ Popconfirm can be closed by pressing ESC (#24420)
* feat: support ESC to close Popconfirm

close #15203

* add test case

* fix focus in other element inside inner-content

* no fit

* fix snapshot

* refactor it

* use util cloneElement

* fix test case
2020-05-25 17:43:59 +08:00
骗你是小猫咪
21bd9444f4 test: use azure deploy ui test report site (#24327)
* test: use azure deploy ui test report site

* parallel stage

* continueOnError

* fix continueOnError position

* use github comment

* failed

* fix artifact name

* add download path

* ls files

* fix path download

* Install modules

* update snapshot image

* test: docker compose run test image

* use docker

* use docker update snapshots

* remove unused dep

* improve github comment and add doc

* fix azure script

* test faild condition

* improve pass comment
2020-05-25 17:40:57 +08:00
Fullstop000
0cea6237dc doc: add exact type for onTabClick (#24448) 2020-05-25 17:35:24 +08:00
偏右
a5efa7a81a test: increase coverage of Progress/Comment/Avatar/Dropdown (#24439)
* test: increase test case of Progress and Comment

* test: add test case for Avatar

* test: add test case for Dropdown

* fix snapshot

* fix snapshot

* remove console.log

* fix lint

* add avatar
2020-05-25 16:27:02 +08:00
xrkffgg
129975f9dc fix: result demo snap (#24447) 2020-05-25 15:32:29 +08:00
xrkffgg
bffa58f439 docs: optimize demo show (#24446) 2020-05-25 14:59:01 +08:00
偏右
4b485d393b Merge pull request #24436 from ant-design/master
chore: merge master into feature
2020-05-25 11:50:02 +08:00
二货机器人
419004e38a chore: rm netlify.toml in dep script (#24434) 2020-05-25 09:50:38 +08:00
cieldon32
b0b619c877 fix: solve the problem of overlapping elements (#24128)
* fix: solve the problem of overlapping elements

* fix:  Expected flex to come before flex-grow in group Box Model

* fix: flex: none

* fix: modify the label's style

Co-authored-by: 夏芸 <xiayun@xiayundeMacBook-Pro.local>
2020-05-25 09:49:55 +08:00
陈帅
670f8f2f1e docs: 📖 add 4.2.5 changelog (#24410)
* doc: 📖 add 4.2.5 changelog

* Update CHANGELOG.zh-CN.md

Co-authored-by: xrkffgg <xrkffgg@gmail.com>

* Update CHANGELOG.zh-CN.md

Co-authored-by: xrkffgg <xrkffgg@gmail.com>

* Update CHANGELOG.en-US.md

Co-authored-by: xrkffgg <xrkffgg@gmail.com>

* Update CHANGELOG.zh-CN.md

Co-authored-by: 偏右 <afc163@gmail.com>

* Update CHANGELOG.zh-CN.md

Co-authored-by: 偏右 <afc163@gmail.com>

* Update CHANGELOG.en-US.md

Co-authored-by: 偏右 <afc163@gmail.com>

* Update CHANGELOG.zh-CN.md

Co-authored-by: 偏右 <afc163@gmail.com>

* Update CHANGELOG.zh-CN.md

Co-authored-by: 偏右 <afc163@gmail.com>

* Update CHANGELOG.zh-CN.md

Co-authored-by: xrkffgg <xrkffgg@gmail.com>

* Update CHANGELOG.zh-CN.md

* Update CHANGELOG.zh-CN.md

* Update CHANGELOG.zh-CN.md

Co-authored-by: 偏右 <afc163@gmail.com>

* add emoji

* Update CHANGELOG.zh-CN.md

Co-authored-by: xrkffgg <xrkffgg@gmail.com>

* Update CHANGELOG.en-US.md

Co-authored-by: xrkffgg <xrkffgg@gmail.com>

* update

Co-authored-by: xrkffgg <xrkffgg@gmail.com>
Co-authored-by: 偏右 <afc163@gmail.com>
2020-05-24 23:53:29 +08:00
偏右
fdbf37a9c0 test: increase test case coverage (#24430)
* test: increase test case of Cascader

* test: increase test case of Grid and Tree
2020-05-24 23:52:25 +08:00
Tom Xu
4af818ca8e refactor(Pagination): rewrite with hook (#24302)
* refactor(Pagination): rewrite with hook

* Update Pagination.tsx

* Update index.tsx
2020-05-24 23:13:32 +08:00
偏右
0c2eed6866 docs: fix TOC active (#24426)
* docs: fix TOC active

close #23929

* fix footer seeconf logo
2020-05-24 17:11:34 +08:00
偏右
e0f57e72e0 fix: Card slow perfermance when use with react-split (#24425)
close #23654
2020-05-24 16:31:38 +08:00
二货机器人
faa75d592c test: Back of test coverage (#24418)
* test: Back of test coverage

* move rtl test out
2020-05-24 00:12:29 +08:00
Mr.Biscuit
77bc48f146 docs: 📝 add Figma library (#24415)
* Propose a free open source design library we made

My team carefully crafted a free open source Ant Design UI library in Figma, its components resembles the exact appearance produced by code, and we wanted to share it so more people would benefit :)

* Update resources.en-US.md

changed image to include Figma logo
2020-05-23 22:48:39 +08:00
偏右
67c88571e7 docs: 📝 update polyfills link 2020-05-23 22:13:43 +08:00
二货机器人
03e6b33681 Merge pull request #24414 from ant-design/feature-merge-master
chore: Feature merge master
2020-05-23 17:09:38 +08:00
zombiej
973f55babb improve transfer test case 2020-05-23 16:47:49 +08:00
二货机器人
5203d256dd docs: Fix site docs name (#24416)
* docs: Fix site docs name

* Rename docs/react/use-with-create-react-app.en-US.md → docs/use-with-create-react-app.en-US.md to docs/react/use-with-create-react-app.en-US.md → docs/react/use-with-create-react-app.en-US.md

* Rename docs/react/use-with-create-react-app.en-US.md → docs/react/use-with-create-react-app.en-US.md to docs/react/use-with-create-react-app.en-US.md
2020-05-23 16:31:39 +08:00
zombiej
c54255a703 fix missing file 2020-05-23 16:03:20 +08:00
zombiej
508401cca4 add transBtn coverage 2020-05-23 15:19:24 +08:00
zombiej
7c260c03a5 chore: merge master 2020-05-23 15:00:18 +08:00
二货机器人
c13e56ab92 docs: Add Select a11y faq (#24413) 2020-05-23 14:51:54 +08:00
Krishna Dubagunta
cc045bb325 Typo: Intruduce -> Introduce (#24407) 2020-05-23 13:26:06 +08:00
二货机器人
6f6430bfee chore: Update snapshot (#24405) 2020-05-22 23:33:04 +08:00
afc163
688f8a3ab0 fix .bundle-analyzerrc.json 2020-05-22 19:09:59 +08:00
afc163
415848c359 fix .bundle-analyzerrc.json 2020-05-22 19:00:32 +08:00
偏右
1e11c83e74 test: add @bundle-analyzer/webpack-plugin (#24399)
* add @bundle-analyzer/webpack-plugin

* add .bundle-analyzerrc

* use process.env.BUNDLE_ANALYZER_TOKEN

* more dist files

* fix ci fail
2020-05-22 18:46:03 +08:00
zefeng
baf001898d feat: use inner icon to replace back-top background-img (#24397)
* feat: use inner icon to  replace back-top background-img

* chore: update snapshots
2020-05-22 17:03:30 +08:00
偏右
2932b39c88 chore: 🆙 upgrade @typescript-eslint/eslint-plugin (#24398)
* 🆙 upgrade @typescript-eslint/eslint-plugin

* Update package.json
2020-05-22 16:41:26 +08:00
偏右
1f371eee09 fix: Table selection out of column when size is small/middle (#24394)
close #24326
2020-05-22 15:20:11 +08:00
Yu
58ccb40005 chore: Cascader ts definition update (#24393) 2020-05-22 15:07:43 +08:00
偏右
76466dae9f test: remove tsconfig.test.json (#24390) 2020-05-22 13:37:41 +08:00
Kermit Xuan
254c17e320 feat: upgrade trigger to 4.2.1(#19536) (#24386) 2020-05-22 13:06:52 +08:00
linye
ebf9c1fa4a Update RecommendPage.tsx (#24381) 2020-05-22 10:52:29 +08:00
Eric Wang
8b9a005c1f chore: use ts-expect-error (#24378) 2020-05-22 10:42:55 +08:00
Kermit Xuan
b57d306107 feat: optmize tooptip destroyTooltipOnHide (#19536) (#24362) 2020-05-22 00:20:01 +08:00
Teng YANG
b467cc5cbb feat: #24355 support complex button backgrounds (#24372) 2020-05-21 23:45:25 +08:00
偏右
ae8603838a Merge pull request #24371 from ant-design/master
chore: merge master into feature
2020-05-21 23:41:37 +08:00
偏右
1bba2ef65e chore: Delete netlify.toml and update devDeps (#24343)
* Delete netlify.toml

* 🆙 upgrade dev deps

* fix mockdate tsd

* fix tsc noEmit
2020-05-21 23:27:02 +08:00
Mr.jiangzhiguo
4066f2f624 fix: Input.TextArea clear icon disappears (#24360)
* [#24359]: fix this issues

details: https://github.com/ant-design/ant-design/issues/24359

* fix css order
2020-05-21 22:55:52 +08:00
tdida
c2437a915d Notification support config prefixCls (#24295) 2020-05-21 21:15:53 +08:00
Mr.Biscuit
a518a2b0b1 docs: Propose a free open source design library we made (#24348)
I want to propose an open source ant Figma library my team made for ant design which contains all possible components and regularly maintained and updated
2020-05-21 21:05:53 +08:00
偏右
35a6a887a3 Update lighthouse-ci.yml 2020-05-21 20:47:06 +08:00
Teng YANG
b264589b77 fix: enhance upload custom progress bar (#24339)
* enhance customize progress bar in upload

- fix progress bar `type` could be overridden
- update demo

* update docs in upload customize progress bar

* update docs in upload
2020-05-21 14:58:36 +08:00
偏右
3629830a85 Revert "chore: upgrade rc-tooltip to 4.1.0(#19536) (#24341)" (#24342)
This reverts commit d7288e99a0.
2020-05-21 13:49:51 +08:00
Kermit Xuan
d7288e99a0 chore: upgrade rc-tooltip to 4.1.0(#19536) (#24341) 2020-05-21 13:43:21 +08:00
afc163
61378e4605 docs: 📖 update ScrollOptions link 2020-05-21 11:32:45 +08:00
二货机器人
0689982def fix: Table selection cache (#24338)
* test driven

* fix logic
2020-05-21 11:02:12 +08:00
二货机器人
e613861e63 fix: Notification hooks (#24337)
* test driven

* use ref for the same content
2020-05-21 10:36:18 +08:00
偏右
f646b6fae8 Update lighthouse-ci.yml 2020-05-20 23:41:17 +08:00
偏右
e657fb806f fix: Button loading animation missing (#24328)
close #24323
2020-05-20 23:32:38 +08:00
dependabot-preview[bot]
6619700893 chore(deps): bump moment from 2.25.3 to 2.26.0 (#24322)
* chore(deps): bump moment from 2.25.3 to 2.26.0

Bumps [moment](https://github.com/moment/moment) from 2.25.3 to 2.26.0.
- [Release notes](https://github.com/moment/moment/releases)
- [Changelog](https://github.com/moment/moment/blob/develop/CHANGELOG.md)
- [Commits](https://github.com/moment/moment/compare/2.25.3...2.26.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

*  fix moment snapshot

* update moment version

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: afc163 <afc163@gmail.com>
2020-05-20 22:33:51 +08:00
偏右
0f93896f0b fix: Upload type missing (#24325)
close #24229
2020-05-20 22:33:34 +08:00
Teng YANG
ac50fa147c feat: resolve #24213 customize progress bar in upload (#24319)
* feat #24213: customize progress bar in upload

* update doc for customize progress bar in upload
2020-05-20 22:29:45 +08:00
afc163
fdbf95aabd fix lighthouse-ci.yml 2020-05-20 21:52:40 +08:00
偏右
c69cf4a261 Update lighthouse-ci.yml 2020-05-20 21:46:18 +08:00
骗你是小猫咪
476853c320 test: fix ui-test install (#24320) 2020-05-20 20:51:35 +08:00
骗你是小猫咪
8d0bba4dea test: 🚀 New Image Snapshots (#24003)
* test: New Image Snapshots

* circleci apt-get some lib

* fix command

* set CircleCI NODE_ENV

* new test:image

* upgrade jest-image-snapshot

* needs dist

* use jest html report

* use now deploy

* fix deploy skip

* set token

* upgrade version

* change if

* improve imageTest

* print node version

* revert puppeteer version

* fix now fail

* test

* fix now fail

* add if

* fix if

* add judgement

* fix action

* rebase

* fix test image script

* lint ignore

* fix lint fail
2020-05-20 19:47:49 +08:00
Yu
e197163a78 feat(Avatar): support draggable prop (#24314) 2020-05-20 19:30:39 +08:00
偏右
a7b81d52af test: Add lighthouse-check-action (#24298) 2020-05-20 14:26:08 +08:00
Tom Xu
6f1fe30df1 docs(modal): improve (#24301) 2020-05-20 10:51:36 +08:00
Amumu
fb839eb1d1 remove @grid-gutter-width (#24303) 2020-05-20 10:47:39 +08:00
Tom Xu
706f0bbf56 refactor(alert): rewrite with hook and support strict mode (#24236)
* refactor(alert): rewrite with hook and support strict mode

* Update index.tsx

* improve code
2020-05-19 20:18:13 +08:00
Tom Xu
50fe770458 refactor(modal): rewrite with hook and support strict mode (#24238)
* refactor(modal): rewrite with hook and support strict mode

* Update ActionButton.tsx

* improve code
2020-05-19 20:15:51 +08:00
二货机器人
c40b291415 feat: RangePicker support info (#24278) 2020-05-19 20:13:11 +08:00
二货机器人
6106aab9d5 Merge pull request #24293 from ant-design/master-to-merge-feature
chore: Master to merge feature
2020-05-19 19:58:50 +08:00
afc163
d6d485b72d merge feature into master-to-merge-feature 2020-05-19 18:25:51 +08:00
偏右
6ad1b18a47 fix: Drawer cover other elements when closed (#24290)
* fix: Drawer cover other elements when closed

close #24287

* Add no-mask demo for Drawer
2020-05-19 18:11:21 +08:00
偏右
4feb186085 refactor: tree select style (#24291)
* chore(list): improve code (#24280)

* chore(list): improve code

* Update index.tsx

* refactor: tree select style code

* 🔒 lock antd-theme-generator to 1.2.2

https://github.com/mzohaibqc/antd-theme-generator/issues/42

Co-authored-by: Tom Xu <ycxzhkx@gmail.com>
2020-05-19 18:10:02 +08:00
Tom Xu
baa56b6d85 chore(list): improve code (#24280)
* chore(list): improve code

* Update index.tsx
2020-05-19 14:55:46 +08:00
xrkffgg
ce78029933 fix: empty in cascader/select/table/treeSelect (#24279)
* fix: empty in cascader\select\table\treeSelect

* fix: snap
2020-05-19 14:45:57 +08:00
二货机器人
8bd10889c6 docs: fix site style (#24275) 2020-05-19 11:06:12 +08:00
偏右
f53d931890 Update MorePage.tsx (#24272) 2020-05-19 10:57:00 +08:00
linye
b4f38f7a22 📖 Update RecommendPage.tsx (#24274) 2020-05-19 10:56:46 +08:00
二货机器人
2120d7dfaa docs: Add missing docs (#24273) 2020-05-19 10:42:34 +08:00
linye
a00c06c58b Update MorePage.tsx 2020-05-19 10:40:14 +08:00
xrkffgg
5b61c0fac9 fix: inputnumber handler inner center (#24266) 2020-05-19 10:12:13 +08:00
二货机器人
44cfc351cb fix: Table with controlled filteredValue empty array should not highlight the filtered icon (#24263)
* fix: FilteredValue

* update test case name
2020-05-18 22:03:20 +08:00
Amumu
f64558da89 fix md (#24256) 2020-05-18 19:58:46 +08:00
Loogeek
a216d6e4f7 fix: cascader component value support number type (#24247)
add cascader type.test.tsx
2020-05-18 19:38:36 +08:00
南小北
bfd5644ff0 Add crop image demo for Upload (#24174)
* chore: add antd-img-crop

* docs: add crop image demo for upload

* fix: move antd-img-crop to devDependencies

* fix: fix eslint warning

* test: update snapshot
2020-05-18 19:22:45 +08:00
Kermit Xuan
f546c8b9e3 chore: upgrade rc-menu to 8.2.1(#23956) (#24223) 2020-05-18 17:36:56 +08:00
二货机器人
75b090aff3 fix: Switch trigger motion (#24254)
* init fix

* fix rtl

* clean up

* update snapshot

* fix style lint

* add motion of inner

* update un-checked focus style
2020-05-18 17:31:46 +08:00
xrkffgg
70c6e47cde style: add menu default textalign (#24253) 2020-05-18 17:07:33 +08:00
xrkffgg
32ee08caa5 docs: optimize site in rtl (#24246) 2020-05-18 14:07:09 +08:00
何锦余
b87b1283ea fix: BackTop children type (#24235) 2020-05-18 14:00:19 +08:00
偏右
551763e768 docs: fix Tag demo (#24245)
close #24231
2020-05-18 13:51:56 +08:00
二货机器人
b10f4cffd9 docs: 4.2.4 changelog (#24244) 2020-05-18 13:40:15 +08:00
二货机器人
7f2f814279 revert: fix: Switch - no correct animation on the IOS/Chrome (#24242)
* Revert "fix switch ios chrome animation (#24122)"

This reverts commit fd7c942403.

* update snapshot
2020-05-18 13:00:33 +08:00
afc163
c955770c40 docs: fix filename
close #24241
2020-05-18 12:15:50 +08:00
xrkffgg
6804fdad1a docs: optimize search of header in rtl (#24239) 2020-05-18 11:35:40 +08:00
xrkffgg
8cb146becd style: adjust upload error icon (#24160)
* fix: adjust uoload error icon

* use less var

* use antd-color

* fix: adjust uoload error icon

* use less var

* use antd-color

* up snap

* fix package

* use svg fill

* fix error

* Update components/upload/style/index.less

Co-authored-by: 偏右 <afc163@gmail.com>

* Update components/upload/style/index.less

* fix fill

* fix snap

Co-authored-by: 偏右 <afc163@gmail.com>
2020-05-18 10:31:23 +08:00
Tom Xu
6a52cf0303 docs: improve spin api (#24234) 2020-05-18 09:49:00 +08:00
偏右
c99ecdac39 docs: 📝 fix create-react-app step (#24227) 2020-05-17 22:47:14 +08:00
Tom Xu
f45f7353a5 chore: 🆙 upgrade rc-switch to 3.0.0 (#24220) 2020-05-17 17:05:28 +08:00
Alexey Vinogradov
316913ca37 Add ru_RU i18n for Form defaultValidateMessages (#24219) 2020-05-17 16:41:36 +08:00
偏右
1bbaa49bef Merge pull request #24214 from ant-design/master
chore: merge master into feature
2020-05-17 01:16:58 +08:00
偏右
aee2e7a5c9 💄 Tweak Dropdown down arrow position (#24215) 2020-05-17 01:16:12 +08:00
Tom Xu
4a3af4caef refactor(dropdown): rewrite with hook (#24212) 2020-05-17 00:51:05 +08:00
Tom Xu
471e97ab76 refactor(card): rewrite with hook (#24211) 2020-05-17 00:49:05 +08:00
偏右
2268c7aa88 docs: 📝 Update README 2020-05-16 21:48:33 +08:00
Jaly
d4874fc0b3 名字重复了 (#24210) 2020-05-16 21:43:17 +08:00
偏右
8b514406e3 🚀 release 4.2.3 (#24203) 2020-05-16 18:02:42 +08:00
二货机器人
1a82efa5ca Text support keyboard (#24195) 2020-05-16 14:43:29 +08:00
偏右
a820046130 fix: Upload.Dragger triggered by label when disabled (#24202)
* refactor Dragger.tsx

* 🐛 Avoid disabled Upload.Dragger being triggered by label

close #24197
2020-05-16 14:25:49 +08:00
xilihuasi
5f1da59488 feat: Skeleton add round prop (#24137)
* feat: Skeleton add round prop

* update snapshot

* fix snapshot
2020-05-16 13:19:54 +08:00
xrkffgg
9924bbf838 refactor(backtop): rewrite with hook (#23575)
* refactor(backtop): rewrite with hook

* fix test

* refactor(backtop): rewrite with hook

* Update index.tsx

* fix coverage

Co-authored-by: hengkx <ycxzhkx@gmail.com>
2020-05-16 13:06:11 +08:00
二货机器人
7de007100d Merge pull request #24199 from ant-design/master
chore: Feature merge master
2020-05-16 12:30:58 +08:00
偏右
04ad7236e4 🐛 Fix Backtop cannot work in Chrome iframe (#24194)
close #24192
2020-05-15 23:16:49 +08:00
二货机器人
a83143bbbc fix: Picker disabled today (#24190) 2020-05-15 18:45:10 +08:00
偏右
188e5630b3 💄 Add @card-head-extra-color (#24189)
close #24187
2020-05-15 18:18:07 +08:00
偏右
02dccd9643 Merge pull request #24185 from ant-design/master
chore: merge master into feature
2020-05-15 17:40:05 +08:00
偏右
8497e54e39 docs: 📖 keep documentation up to date (#24184)
* docs: remove babel-plugin-import from docs

* docs: react-scripts-rewired + customize-cra => craco

* docs: remove babel-plugin-import

* fix remark link
2020-05-15 17:18:55 +08:00
Tom Xu
9f633bc002 chore: getScroll add more test (#24180)
* chore: getScroll add more test

* Update getScroll.test.js
2020-05-15 16:14:38 +08:00
Tom Xu
159d42fda8 chore: scrollTo add more test (#24177) 2020-05-15 14:57:12 +08:00
afc163
850b670862 docs: add create-react-app svg import usage
close #24175
2020-05-15 12:37:20 +08:00
afc163
610807ebf9 🆙 upgrade rc-progress 3.0.0 2020-05-15 10:59:34 +08:00
Tom Xu
f90702cd0c refactor(tooltip): rewrite with hook (#23699)
* refactor(tooltip): rewrite with hook

* fix lint

* fix

* fix test

* fix

* fix test

* refactor(tooltip): rewrite with hook

* fix lint

* fix test

* Update SliderTooltip.tsx

* Update tooltip.test.js

* Update index.test.js
2020-05-15 10:47:03 +08:00
二货机器人
0cd0ebe7dc fix: Select item z-index (#24170) 2020-05-15 09:53:14 +08:00
Wenqi Chen
9559754b5b chore: update issue template (#24166)
https://help.github.com/en/github/building-a-strong-community/configuring-issue-templates-for-your-repository#configuring-the-template-chooser
2020-05-14 23:51:43 +08:00
二货机器人
681aab1ef1 Merge pull request #24169 from ant-design/feature-merge-master
chore: Feature merge master
2020-05-14 22:18:37 +08:00
zombiej
9f38c46039 merge master 2020-05-14 21:03:29 +08:00
二货机器人
2afab58ac8 chore: small bundle size follow up (#24164)
* update config

* replace react function

* fix alert
2020-05-14 20:54:49 +08:00
二货机器人
9cb3c94204 Merge pull request #24158 from ant-design/feature-merge-master
chore: Feature merge master
2020-05-14 17:00:29 +08:00
zombiej
55332f6971 fix: Test case 2020-05-14 16:36:05 +08:00
zombiej
e6b1b1a4e7 Merge remote-tracking branch 'origin/master' into feature-merge-master 2020-05-14 16:19:39 +08:00
xrkffgg
be0c654fff style: optimize pagination slash style in rtl (#24154) 2020-05-14 16:05:36 +08:00
二货机器人
2e284aa017 chore: small bundle size (#24135)
* update warning

* rm warning

* replace with dev warning

* fix test

* fix site

* Update webpack.config.js

Co-authored-by: 偏右 <afc163@gmail.com>

* Update webpack.config.js

* fix sytax

* adjust

* move into function

Co-authored-by: 偏右 <afc163@gmail.com>
2020-05-14 15:57:04 +08:00
xrkffgg
4aa1b62659 style: adjust pagination simple background (#24152) 2020-05-14 15:25:54 +08:00
afc163
bb4f0da50e 📖 update PR template 2020-05-14 15:24:58 +08:00
xrkffgg
5d9d45b597 fix: dropdown button default placement in rtl (#24150)
* fix: dropdown button default placement in rtl

* change test
2020-05-14 15:06:50 +08:00
偏右
4f1605949e Update introduce.zh-CN.md 2020-05-14 14:38:57 +08:00
偏右
217723d321 🆙 upgrade devDeps 2020-05-14 13:43:06 +08:00
二货机器人
586c7f5218 fix: DatePicker panel exceed (#24145) 2020-05-14 12:01:27 +08:00
lexlexa
fd7c942403 fix switch ios chrome animation (#24122) 2020-05-13 20:49:38 +08:00
偏右
c463b2cc35 docs: fix 404 url 2020-05-13 20:32:33 +08:00
偏右
5e5ec80d04 🆙 upgrade typescript to 3.9.2 (#24111) 2020-05-13 20:19:28 +08:00
二货机器人
b0e528d14c feat: Transfer support oneWay (#24041)
* use flex

* show clear btn

* support one way

* add dropdown

* add pagination

* support pagination

* use flex

* operation stretch

* pagination works

* update selection logic

* no need to show checkbox on pagination

* fix tree demo

* support invert selection

* remove current pages

* update style

* update snapshot

* clean up

* update test case

* update test case

* update snapshot

* fix lint

* add deps

* update doc

* update hover style

* update hover checked style

* adjust demo & active region

* fix lint

* update snapshot
2020-05-13 19:15:40 +08:00
偏右
9d03db0503 refactor: 🆙 upgrade rc-progress (#24127)
* 🆙 upgrade rc-progress

* test: antd.min.js

ref #24116
2020-05-13 19:13:30 +08:00
偏右
41dd9560c9 Merge pull request #24118 from ant-design/master-to-merge-feature
chore: merge master into feature
2020-05-13 17:55:20 +08:00
afc163
da3f5528f4 Merge branch 'master' into master-to-merge-feature 2020-05-13 17:16:58 +08:00
afc163
6093f11cf0 chore: wrong env variable in build 2020-05-13 17:14:49 +08:00
afc163
68119768cc wrong env variable in build 2020-05-13 17:14:33 +08:00
afc163
53d7a20939 merge feature into master-to-merge-feature 2020-05-13 16:16:16 +08:00
afc163
50e33768a9 fix DatePicker snapshot 2020-05-13 16:10:48 +08:00
偏右
e15be10faf Update rebase.yml 2020-05-13 16:05:24 +08:00
sorteam
b73e84da9b Fix Table type (#24114)
Co-authored-by: soroka_av <soroka_av@st.by>
2020-05-13 16:03:07 +08:00
偏右
34c2fad636 refactor: 🔨 tree style code (#24096) 2020-05-13 14:45:08 +08:00
xrkffgg
90a36eed0b style: optimize select multiple tag style in rtl (#24112) 2020-05-13 14:07:11 +08:00
偏右
f7e00f645e style: fix Button small size align when customize theme (#24097)
close #24089
2020-05-13 12:56:24 +08:00
二货机器人
63a32422e5 Merge pull request #24108 from ant-design/feature-merge-master
chore: Feature merge master
2020-05-13 12:32:22 +08:00
偏右
31ba421268 fix: dark menu link color (#24110)
close #24107
2020-05-13 12:16:48 +08:00
精武陈真
227233268d docs: fix typo (#24109)
from改为form
2020-05-13 12:11:58 +08:00
zombiej
339246d316 chore: Merge master 2020-05-13 11:59:15 +08:00
二货机器人
08c63d1e23 docs: Update faq of mutable data (#24106)
* docs: Update faq

* Update faq.en-US.md
2020-05-13 11:23:58 +08:00
xrkffgg
731505813a style: fix menu border in rtl (#24101) 2020-05-13 11:09:28 +08:00
偏右
c19685e0ea fix: Child of Button should be interactive (#24095)
close #24090
2020-05-12 22:29:10 +08:00
xrkffgg
64d151aa81 style: optimize typography expand style in rtl (#24084) 2020-05-12 17:58:45 +08:00
偏右
82d709676a fix: Drawer height bug (#24082)
* 🐛 Fix Drawer height bug

close #24074

*  fix snapshot
2020-05-12 17:39:59 +08:00
wx1322
49f5ed7764 feat: Adds zh_TW localisations for Form (#24065)
* Update zh_TW.tsx

* Remove spaces

* Update zh_TW.tsx

* Update snapshot

* replace indexOf() with ||
2020-05-12 15:00:24 +08:00
afc163
fdcbfc909d fix snapshot
close #24070
2020-05-12 14:57:13 +08:00
Jinke Li
f250b2fa29 Feature: support custom cell ellipsis tooltip (#24056)
* feat: add transformFile optionfor transform file before request

* feat: bump rc-upload 2.7.0

* feat(Upload): optimize doc

* feat: support custom cell ellipsis tooltip

* tests: update snapshots

* docs: update table ellipsis demo

* tests: update snap
2020-05-12 12:44:49 +08:00
偏右
ce36d3e2fe 🆙 upgrade react-slick to 0.26.1 (#24067) 2020-05-12 11:00:47 +08:00
Kermit Xuan
9a6ad0edb9 fix(#23019): display defaultValue when no matched options (#24058) 2020-05-12 10:34:24 +08:00
二货机器人
40a987e059 chore: Fix pub script (#24063) 2020-05-11 23:38:54 +08:00
信鑫-King
705a6d63a1 release: 4.2.2 changelog (#24060)
* docs: changelog

* chore: version 4.2.2

* docs: changelog

* Update CHANGELOG.zh-CN.md

Co-authored-by: 偏右 <afc163@gmail.com>

Co-authored-by: 偏右 <afc163@gmail.com>
2020-05-11 21:56:17 +08:00
偏右
79289fa708 fix: generate-version not found (#24059)
close #24057
2020-05-11 21:04:18 +08:00
偏右
4dccbd8eab style: add @modal-close-color (#24053)
* 🆕 Add @modal-close-color

close #24050

* update snapshot

* fix var name
2020-05-11 20:08:46 +08:00
偏右
2ab7c3f182 fix @menu-item-font-size not working (#24052)
close #24051
2020-05-11 19:12:04 +08:00
信鑫-King
313f2df632 docs: changelog 4.2.1 (#24025)
* docs: changelog 4.2.1

* docs: changelog

* docs: changelog

* docs: changelog

* docs: changelog

* chore: datepicker rtl

* chore: classification

* chore: size

* chore: locale

* Update CHANGELOG.zh-CN.md

Co-authored-by: 偏右 <afc163@gmail.com>

* docs: changelog

* chore: add version

Co-authored-by: 偏右 <afc163@gmail.com>
2020-05-11 16:58:42 +08:00
Tom Xu
d766472d94 feat: descriptions add less variable (#24032)
* feat:  add less variable @descriptions-item-trailing-colon,@descriptions-it,@descriptions-item-label-colon-margin-leftem-label-colon-margin-right,

* fix

* Update demo.test.js.snap
2020-05-11 15:54:25 +08:00
二货机器人
80e3dfa9be feat: Add Link component to prepare for rm global style (#24019)
* init

* move to base

* add link component

* update snasphot

* update snasphot of test

* move to Typography

* update test case
2020-05-11 14:28:57 +08:00
afc163
626f918597 🗑️ remove checkbox PropTypes 2020-05-11 14:02:23 +08:00
njmqd
4884e91c49 fix: Add closeIcon for Tabs.Tabpane (#23992)
* fix: Add closeIcon for Tabs.TabPane

* fix: update snapshots

Co-authored-by: 倪佳敏 <ni.jiamin@datatom.com>
2020-05-11 12:12:33 +08:00
Kermit Xuan
67a482f4e5 fix(#16659): support className and style for message (#24024)
* fix(#16659): support className and style for message;

* docs(message): update demo custom-style;
2020-05-11 12:11:15 +08:00
xrkffgg
04eb91dc8e style: fix datepicker panel style (#24028) 2020-05-11 12:02:24 +08:00
偏右
e188537c00 refactor: Dropdown.Button icon prop (#24020)
ref #24017
2020-05-10 23:53:29 +08:00
xrkffgg
e26eb5f892 docs: optimize site of rtl (#23995) 2020-05-10 22:11:09 +08:00
二货机器人
1cf1a15d50 Merge pull request #24018 from ant-design/master
chore: Feature merge master
2020-05-10 18:42:00 +08:00
Rick Zhou
d7c7b86f31 fix en_GB's description (#24016) 2020-05-10 17:16:44 +08:00
偏右
0a70563e44 chore: fix drawer demo (#24015)
* 🎬 improve drawer demo

* 🎬 fix drawer demo glitch

close #24011
2020-05-10 17:15:41 +08:00
初心Yearth
7f1e7a3120 Update use-with-create-react-app.zh-CN.md (#23938) 2020-05-10 13:12:32 +08:00
Jenna Van Conett
8cce0383a1 Update drag-sorting.md (#24013) 2020-05-10 12:54:57 +08:00
二货机器人
72a846681a chore: Fix Form.List render logic (#24009)
* update snapshot

* update nest logic

* clean up
2020-05-10 10:39:30 +08:00
偏右
741ff5c3bb Merge pull request #24006 from ant-design/master-to-merge-feature
chore: 🔀 Master to merge feature
2020-05-09 21:16:15 +08:00
afc163
6705454b83 Merge branch 'master' into master-to-merge-feature 2020-05-09 20:41:03 +08:00
偏右
237c205169 🆙 upgrade eslint (#24000) 2020-05-09 20:40:35 +08:00
afc163
acb4cb6859 Merge feature into master 2020-05-09 20:40:12 +08:00
偏右
2beb28518c test: Alert and AutoComplete test coverage (#24004)
* 🔨 refactor demo code style

* refactor alert code and fix test cov

* add test case for AutoComplete

* fix test
2020-05-09 19:32:02 +08:00
mraiguo
28f71921ea fix: Tooltip in Upload components location error (#24001) 2020-05-09 18:58:44 +08:00
xrkffgg
338733d70f docs: optimize input demo (#23990)
* docs: optimize input demo

* docs: optimize input demo

* fix: style

* remove
2020-05-09 18:02:18 +08:00
xrkffgg
dd6c855028 style: fix input clear icon in rtl (#23999) 2020-05-09 18:02:08 +08:00
Vitaly Budovski
60d45d8d37 docs: Add documentation for responsive table columns (#23987) 2020-05-09 18:01:16 +08:00
Xuhao
9c0f12c7e8 fix: #23986 [Comment] Should not render avatar wrapper when avatar is… (#23994)
* fix: #23986 [Comment] Should not render avatar wrapper when avatar is not present

* #23986 test snapshots revision
2020-05-09 16:50:34 +08:00
偏右
e6a8736b9d Update FUNDING.yml 2020-05-09 14:42:42 +08:00
xrkffgg
c393ca700e style: fix select focused in input group (#23985) 2020-05-09 14:41:00 +08:00
偏右
ee58a34175 fix: 🆙 upgrade rc-steps@3.6.0 (#23989)
* 🆙 upgrade rc-steps@3.6.0

* update snapshot
2020-05-09 14:01:02 +08:00
xrkffgg
015109b42b style: opt datepicker active bar style in rtl (#23981) 2020-05-09 10:00:23 +08:00
二货机器人
fafa3b7e51 feat: Form support validateTrigger (#23972) 2020-05-08 23:04:20 +08:00
二货机器人
116af77548 Merge pull request #23973 from ant-design/feature-merge-master
chore: Feature merge master
2020-05-08 22:39:56 +08:00
zombiej
3fad93e41b chore: feature merge master 2020-05-08 22:25:33 +08:00
偏右
cc11b95194 🆙 upgrade rc-switch/rc-drawer to remove react-lifecycles-compat (#23969) 2020-05-08 19:21:21 +08:00
偏右
333e8ffeb2 💄 Tweak Select close x position (#23963)
close #23886
2020-05-08 18:13:38 +08:00
xrkffgg
48c7011f67 style: fix transfer search padding in rtl (#23962) 2020-05-08 18:13:08 +08:00
偏右
d221458939 refactor: 📦 Generate version.js from package.json (#23957)
* 📦 generate version.js from package.json

* components/version/version.ts

* remove version.js

* fix scripts

* Add pretest and predist

* clean up finalizeCompile

* fix lint
2020-05-08 17:49:22 +08:00
偏右
612bcdf4a6 refactor: 📦 use webpack-plugin-esbuild (#23930)
* 📦 use webpack-plugin-esbuild

* rename esbuild-webpack-plugin

* fix npm run dist error

* fix npm run dist error

* code style improve

* remove extra finalizeDist

* Add process.env.ESBUILD
2020-05-08 15:48:21 +08:00
xrkffgg
3d578c87be site: fix css of direction (#23953) 2020-05-08 14:06:32 +08:00
偏右
f8c1e794da refactor: 🆙 upgrade rc-animate to 3.x (#23937)
* 🆙 upgrade rc-animate to 3.x

drop dep of component-classes

* 🆙 upgrade deps which deps on rc-animate

*  fix snapshot
2020-05-08 13:47:51 +08:00
偏右
22f615200a fix rebase.yml 2020-05-08 13:43:15 +08:00
Eric Chen
dfe2477b87 docs(Divider): Move Divider to layout (#23952) 2020-05-08 10:34:50 +08:00
二货机器人
c4b602e835 fix: FormItem with help (#23945)
* fix: Help status error

* update logic

* adjust ref

* fix ts

* adjust hidden logic
2020-05-07 23:26:07 +08:00
zoomdong
5f825d8172 docs: fix typo (#23946) 2020-05-07 23:22:31 +08:00
二货机器人
c9fada3222 docs: Update cra doc (#23944) 2020-05-07 21:01:42 +08:00
臧甲彬 fadeaway
1abe5495a2 docs: add modao.cc resource link (#23939)
* 添加墨刀资源链接

* 添加墨刀资源链接

* fix letters spaces

Co-authored-by: 偏右 <afc163@gmail.com>

Co-authored-by: 偏右 <afc163@gmail.com>
2020-05-07 20:51:44 +08:00
mjfwebb
d643d113ff Adds default English localisations for Form. (#23859)
Co-authored-by: mjfwebb <michael@w3bb.net>
2020-05-07 17:39:09 +08:00
afc163
968e7edec3 📖 add dumi in footer 2020-05-07 16:50:32 +08:00
偏右
9a9aa94cfd chore: Removed workaround since it's fixed
935698dea8
2020-05-07 16:40:38 +08:00
偏右
22c313d032 chore: 🔨 replace css-animation by @ant-design/css-animation (#23932)
* 🆙 use @ant-design/css-animation

* fix ci

* fix ci
2020-05-07 16:29:41 +08:00
Nariman Movaffaghi
540fc211df feat: fa_IR is updated based on latest options. (#23926)
* Update FA_IR based on EN_US

* Update fa_IR based on zh_CN

* typeTemplate has been added

* Update fa_IR.tsx

Co-authored-by: Amumu <yoyo837@hotmail.com>
2020-05-07 14:57:31 +08:00
偏右
b0593c8a41 🔰 update badge image url 2020-05-07 14:05:25 +08:00
Tom Xu
cf01c8649f docs: improve tooltip (#23928)
* docs: improve tooltip

* remove version
2020-05-07 13:57:50 +08:00
偏右
2ba90f7ff5 💄 Drawer with percentage width cannot show when no mask (#23925)
close #23910
2020-05-07 11:38:51 +08:00
xrkffgg
ee80a2f710 style: optimize layout rtl (#23921) 2020-05-07 10:18:51 +08:00
Ty Mick
c102053f3a Fix English syntax in heading (#23917) 2020-05-07 09:37:01 +08:00
偏右
1444043fd8 Revert "test: Fix Table test (#23915)" (#23916)
This reverts commit ce17f19ca0.
2020-05-06 23:38:58 +08:00
二货机器人
ce17f19ca0 test: Fix Table test (#23915) 2020-05-06 23:00:02 +08:00
二货机器人
701f35d0eb chore: Adjust table col className priority (#23914)
* adjust col class

* update snapshot
2020-05-06 22:15:29 +08:00
Tom Xu
2961dda311 docs: improve popconfirm (#23905)
* docs: improve popconfirm

* Update index.zh-CN.md
2020-05-06 17:37:49 +08:00
偏右
6e8e36080e docs: 📖 update notFoundContent (#23901) 2020-05-06 15:04:08 +08:00
Kol Chen
41bfb79cb7 docs: 📖 update contributing.zh-CN.md (#23897) 2020-05-06 12:40:29 +08:00
偏右
012969e742 docs: refactor tutorial code to React hooks (#23896) 2020-05-06 12:25:06 +08:00
偏右
fdf0f2e585 docs: fix moment locale faq (#23895)
close #23891
2020-05-06 12:03:46 +08:00
偏右
4cb70b6f16 Merge pull request #23893 from ant-design/master
chore: merge master into feature
2020-05-06 10:58:50 +08:00
偏右
c5bcf57537 feat: 💄 Add text type Button (#22552)
* 🆕 Add text type Button

`<Button type="text" />`

close #15892

* Add test cases

* missing type

* missing type

* fix missing type

* Update components/button/index.zh-CN.md

Co-Authored-By: zefeng <zefengbao@outlook.com>

Co-authored-by: Amumu <yoyo837@hotmail.com>
Co-authored-by: zefeng <zefengbao@outlook.com>
2020-05-06 10:15:33 +08:00
偏右
aa3413b086 increase code cov (#23885) 2020-05-05 21:41:50 +08:00
二货机器人
0d46d07ad1 test: Add test coverage (#23884) 2020-05-05 21:08:56 +08:00
偏右
633d064640 increase code cov (#23880) 2020-05-05 19:33:33 +08:00
偏右
6ded8588ed chore: @radio-solid-checked-color typo (#23878)
* Update default.less

* Update dark.less
2020-05-05 18:13:46 +08:00
二货机器人
2a0df4f465 fix: FormItem getValueProps warning (#23875) 2020-05-05 16:15:36 +08:00
Jurriaan BW
5c8ffd473b Fix for #12795: InputNumber onChange type (#23871) 2020-05-05 15:38:05 +08:00
二货机器人
3a28f31fca feat: Cell support shouldCellUpdate (#23872) 2020-05-05 15:03:22 +08:00
Tom Xu
747691f600 feat: ConfigProvider support virtual and dropdownMatchSelectWidth (#23841)
* feat: ConfigProvider support virtual and dropdownMatchSelectWidth

* update snap

* Update demo.test.js.snap

* update snap
2020-05-05 15:00:43 +08:00
偏右
97fde3a304 🆙 upgrade jest to 26.0.0 (#23870) 2020-05-05 14:08:38 +08:00
xrkffgg
cffcd0378a style: optimize steps style (#23855)
* style: optimize steps style

* fix: name

* Update

Co-authored-by: 偏右 <afc163@gmail.com>

* fix: sm

Co-authored-by: 偏右 <afc163@gmail.com>
2020-05-05 13:55:05 +08:00
twoye
2b2a6a3d22 Update index.zh-CN.md (#23868)
* Update index.zh-CN.md

* Update index.zh-CN.md

Co-authored-by: 偏右 <afc163@gmail.com>
2020-05-05 13:17:50 +08:00
二货机器人
dff19af744 chore: Update Popconfirm & Modal okType type (#23867)
* chore: Update Popconfirm & Modal okType type

* add test case

* update test case
2020-05-05 12:03:16 +08:00
偏右
b9e7d853a4 chore: upgrade moment (#23856)
* 🆙 upgrade moment

* Update package.json
2020-05-04 22:58:42 +08:00
二货机器人
3d2ccd8081 refactor: Use flex of divider (#23849)
* refactor: Use flex of divider

* fix style lint
2020-05-04 18:14:25 +08:00
偏右
f05f2dd197 Merge pull request #23853 from ant-design/master
chore: merge master into feature
2020-05-04 14:19:32 +08:00
偏右
91f2dc522f fix progress snapshot (#23850) 2020-05-04 13:38:04 +08:00
Tom Xu
107731a988 docs: improve link path (#23844) 2020-05-04 13:12:42 +08:00
二货机器人
e15773e25b fix: Form.Item warning for initialValue (#23846)
* fix: Form.Item warning for initialValue

* Update index.test.js

* Update index.test.js
2020-05-04 12:13:44 +08:00
二货机器人
6668d48c54 Merge pull request #23845 from ant-design/master
chore: Feature merge master
2020-05-04 11:49:37 +08:00
二货机器人
72bb377628 fix: Textarea height (#23835)
* fix: Textarea height

* update snapshot
2020-05-03 20:32:34 +08:00
afc163
39456263b5 🎬 improve table demo 2020-05-03 19:46:52 +08:00
二货机器人
74645b7baf docs: Add table render cache faq (#23833) 2020-05-03 16:10:37 +08:00
二货机器人
e4a1a45b09 fix: Menu a color (#23832)
* fix: Menu a color

* update snapshot

* fix menu item
2020-05-03 11:28:15 +08:00
二货机器人
0f83783709 docs: Update notification onClose desc (#23831) 2020-05-03 09:16:33 +08:00
二货机器人
1489903d9d fix: Modal async (#23826)
* make async

* fix tesst
2020-05-03 00:53:32 +08:00
偏右
33cb4c9bb4 fix: Menu inlineCollapsed behavior (#23822)
* fix: Menu should onOpenChange when collapse inline menu

close #23755

* fix snapshot
2020-05-03 00:10:21 +08:00
Amazing Turtle
5c1257d726 docs: Remove deprecated supportServerRender doc 2020-05-02 23:14:43 +08:00
Amazing Turtle
83dcc0016f Update index.zh-CN.md (#23824)
Remove deprecated supportServerRender doc
2020-05-02 23:13:45 +08:00
Tom Xu
cbb46a86b3 docs: fix less-loader@6 customize-cra (#23821)
* docs: fix less-loader@6 customize-cra

* Update use-with-create-react-app.en-US.md
2020-05-02 22:29:01 +08:00
Tom Xu
009f2c8f33 docs: fix customize-cra addLessLoader link (#23819)
* docs: fix customize-cra addLessLoader link

* update snap
2020-05-02 21:58:38 +08:00
二货机器人
34bf3fdb66 fix: DatePicker miss placeholder when it's undefined (#23818)
* fix placeholder

* add test case

* update snapshot
2020-05-02 21:55:23 +08:00
Tom Xu
3d355fde08 refactor(timeline): rewrite with hook (#23631)
* refactor(timeline): rewrite with hook

* add test

* Revert "add test"

This reverts commit 39540589d7.

* Update TimelineItem.tsx

* Update TimelineItem.tsx

* fix lint
2020-05-02 18:55:56 +08:00
Vasilii Artemchuk
50c3f89e19 fix: switch loading dark theme (#23766) 2020-05-02 15:27:27 +08:00
偏右
ca896092e2 fix snapshot (#23816) 2020-05-02 15:18:23 +08:00
偏右
c9267469a0 Revert "[Snyk] Fix for 1 vulnerabilities (#23807)" (#23815)
This reverts commit 08dd4435df.
2020-05-02 14:27:04 +08:00
xrkffgg
bd692bef71 style: optimize button loading style in rtl (#23776)
* style: optimize button loading style in rtl

* opt rtl

* reback
2020-05-02 09:00:47 +08:00
偏右
78b7cf22a1 style: 💄 Fix DatePicker clear icon style (#23811) 2020-05-01 22:16:05 +08:00
偏右
35e390018c Merge pull request #23796 from ant-design/master
chore: Merge master into feature
2020-05-01 16:35:53 +08:00
二货机器人
58fcee34c1 docs: Add FAQ of form onFieldsChange (#23808) 2020-05-01 16:20:37 +08:00
二货机器人
5f2874b292 fix: Table selection col width not correct (#23806)
* update snapshot

* Update package.json

* update snapshot
2020-05-01 16:02:32 +08:00
Snyk bot
08dd4435df [Snyk] Fix for 1 vulnerabilities (#23807)
* fix: package.json & .snyk to reduce vulnerabilities


The following vulnerabilities are fixed with a Snyk patch:
- https://snyk.io/vuln/SNYK-JS-LODASH-567746

* fix: package.json & .snyk to reduce vulnerabilities


The following vulnerabilities are fixed with a Snyk patch:
- https://snyk.io/vuln/SNYK-JS-LODASH-567746
2020-05-01 15:05:18 +08:00
afc163
7d3cb95f17 fix Tooltip test case 2020-05-01 15:03:27 +08:00
xrkffgg
df1555c6c7 style: optimize input search style in rtl (#23797)
* style: optimize input search style in rtl

* fix lint
2020-05-01 14:50:35 +08:00
偏右
7139493258 refactor menu code (#23793) 2020-04-30 21:29:16 +08:00
偏右
081604e253 feat: ㊙️ Input passowrd custom icon (#23792)
*  Support Input.Password iconRender

close #23778
close #23484

*  fix snapshot
2020-04-30 21:19:16 +08:00
二货机器人
98232382f1 feat: MenuItem support danger (#23785)
* feat: Basic danger color

* dark of it

* danger dark style

* invers of dropdown

* update less

* update snapshot
2020-04-30 21:14:10 +08:00
xrkffgg
01b98e79d9 docs: optimize site of components 3 (#23779)
* docs: optimize site of components in rtl 3

* add
2020-04-30 21:04:19 +08:00
xrkffgg
ba9d75e3bd fix: switch style (#23791) 2020-04-30 21:02:03 +08:00
Zester Quinn Albano
9f2af262ef docs: add a link to FieldData in setFields FormInstance (#23790) 2020-04-30 20:49:33 +08:00
骗你是小猫咪
e34fc4a7c4 improve: Button loading smooth (#23783) 2020-04-30 17:18:24 +08:00
chenlei
b57c000678 docs: Fix Upload index.en-US.md (#23781)
* docs: fix Upload index.en-US.md

* docs: update Upload index.zh-CN.md
2020-04-30 17:06:05 +08:00
vldh
b66ab37463 feat: add less variable @input-disabled-color (#23775)
* add less variable @input-disabled-color

* Update components/style/themes/default.less

Co-Authored-By: 偏右 <afc163@gmail.com>

Co-authored-by: lidahao <lidahao@sisyphe.com.cn>
Co-authored-by: Amumu <yoyo837@hotmail.com>
Co-authored-by: 偏右 <afc163@gmail.com>
2020-04-30 15:37:11 +08:00
偏右
0b5d09dd4b docs: 🎬 fix Grid demo slider tooltip (#23772)
close #23768
2020-04-30 11:39:16 +08:00
偏右
10cf054b93 style: 💄 Slider marks should not be selected (#23773) 2020-04-30 11:38:59 +08:00
afc163
9c3bf77b92 docs: 🎬 fix Grid demo slider tooltip
close #23768
2020-04-30 11:19:09 +08:00
xrkffgg
e3e183ea39 docs: add rtl message/notification explanation (#23770)
* docs: add explanation for message/notification

* fix name

* fix

* add
2020-04-30 10:52:44 +08:00
Eric Wang
815baee4d9 chore: Transform anchor test to typescript (#23499)
* chore: Transform anchor test to typescript

* Separate dom

* use hash

* .

* chagnelog

* chore: Transform anchor test to typescript

* Separate dom

* use hash

* .

* rebase
2020-04-30 10:33:29 +08:00
二货机器人
a243aba422 docs: Fix changelog (#23769) 2020-04-30 10:15:29 +08:00
xrkffgg
402f3a9afb feat: rewrite config with hook and add rtl config (#23759)
* feat: rewrite config with hook and add rtl config

* fix import

* fix lint
2020-04-29 23:18:22 +08:00
二货机器人
5ccf03f498 docs: 4.2.0 changelog (#23761)
* docs: 4.2.0 changelog

* Update CHANGELOG.en-US.md

Co-Authored-By: xrkffgg <xrkffgg@gmail.com>

* Update CHANGELOG.zh-CN.md

Co-Authored-By: xrkffgg <xrkffgg@gmail.com>

Co-authored-by: xrkffgg <xrkffgg@gmail.com>
2020-04-29 22:34:06 +08:00
Amumu
245deed4b6 fix proper react import again (#23762) 2020-04-29 22:06:04 +08:00
二货机器人
9cd8f79366 fix snapshot (#23760) 2020-04-29 21:41:58 +08:00
Amumu
935b0e5887 fix: Fix crash when mismatch placement (#23756)
* fix Fix crash when mismatch placement

* add test case
2020-04-29 21:30:36 +08:00
二货机器人
e1299bfcc9 Merge pull request #23758 from ant-design/feature
chore: Merge feature into master
2020-04-29 20:42:52 +08:00
二货机器人
bb1f157645 feat: ConfigProvider support getTargetContainer (#23751)
* add getTargetContainer

* support affix

* test case

* anchor use new context api

* Anchor support getTargetContainer

* doc it

* update patch
2020-04-29 20:22:16 +08:00
xrkffgg
f606ca23f4 site: optimize site of components 2 (#23731)
* docs: optimize site of component 2

* add demo

* fix snap

* remove class
2020-04-29 16:21:56 +08:00
James Yeung
5c79e642ba fix: blazor links (#23649)
* fix: blazor links

* switch to github.io

* Update index.tsx

* Update Footer.tsx

* Update More.tsx

* Update introduce.en-US.md

* Update introduce.zh-CN.md

* Update introduce.zh-CN.md

* Update introduce.en-US.md

* Update introduce.zh-CN.md

Co-authored-by: 偏右 <afc163@gmail.com>
2020-04-29 15:49:00 +08:00
偏右
4fdad9a2f5 docs: fix toc covered by footer (#23753)
close #23702
2020-04-29 15:48:39 +08:00
偏右
0b61b13e56 docs: 🆙 Upgrade input number (#23742)
* 🆙 upgrade to rc-input-number@4.6.0

* 🆙 upgrade to rc-input-number@4.6.1

*  update snapshot

* fix version
2020-04-29 14:18:19 +08:00
xrkffgg
e5c664f7f0 style: fix result style in rtl (#23733) 2020-04-29 13:20:43 +08:00
二货机器人
7f347ec5f2 Merge pull request #23743 from ant-design/feature-merge-master
chore: Feature merge master
2020-04-29 12:58:44 +08:00
zombiej
80017a0f92 update snapshot 2020-04-29 12:17:00 +08:00
xrkffgg
6391df163b fix: table pagination position in rtl (#23747) 2020-04-29 12:12:54 +08:00
zombiej
2c531a827d merge master 2020-04-29 11:29:26 +08:00
xrkffgg
e41340ac4d style: add divider rtl support (#23734)
* style: add divider rtl support

* add base
2020-04-29 10:17:37 +08:00
二货机器人
53a76f0bf7 fix: Table should not crash pageSize is undefined (#23724)
* fix: Table crash when pageSize is undefined

* test case

* fix test case
2020-04-28 20:29:34 +08:00
Baic
7790046ce2 docs: update createFromIconfontCN scriptUrl new array usage (#23704)
* scriptUrl新增数组类型支持,增加文档说明,修改@ant-design/icons最低版本号

* 增加scriptUrl支持数组的代码演示,增加类型说明

* Icon 修改代码演示标题,补充文档

* 根据建议修改文档格式

* 增加scriptUrl为数组时候的覆盖关系说明

* 修改覆盖说明文案
2020-04-28 18:14:07 +08:00
Simon Altschuler
4119c9324a Move "Related Articles" out of code snippet (#23719)
In the customize theme section
2020-04-28 18:13:07 +08:00
Tom Xu
f0c82d5aa7 fix: PageHeader tag ts typo (#23712) 2020-04-28 17:42:23 +08:00
xrkffgg
16a1feb8fb fix: alert base rtl style (#23714) 2020-04-28 17:14:21 +08:00
偏右
d37c16aeaf 🤖 fix rebase action 2020-04-28 17:02:37 +08:00
偏右
7bf44c417c test: fix test case for RangePicker presetted ranges (#23710)
*  fix test case for RangePicker presetted ranges

* 🆙 upgrade simple-git
2020-04-28 16:48:06 +08:00
Tom Xu
699978bcf0 docs: improve rate character (#23713) 2020-04-28 16:46:50 +08:00
偏右
c3c2c157d0 fix: correct Button type="danger" TypeScript definition (#23709)
* fix: remove Button type danger in TypeScript

close #23708

* docs: fix Table dataSource type in document

close #23697

* add warning about type="danger"

* reverse button type warning logic
2020-04-28 16:14:38 +08:00
afc163
e4bdfb218c add test case for RangePicker presetted ranges 2020-04-28 16:00:04 +08:00
偏右
b70d607b9f 💄 Fix RangePicker ranges color when custom theme (#23705)
close #23687
2020-04-28 14:59:17 +08:00
xrkffgg
f6d12c5d88 style: optimize table rtl style (#23706) 2020-04-28 14:48:42 +08:00
偏右
190e2a28a7 🎬 improve tag demo (#23703) 2020-04-28 14:33:39 +08:00
偏右
c27a3a40a7 chore: 📦 Optimize npm package size (#23698)
* improve custom theme import path

* reduce npm package size
2020-04-28 14:11:43 +08:00
Tom Xu
f5153ab950 docs: improve style type (#23700) 2020-04-28 14:09:54 +08:00
二货机器人
3967f12f3d docs: Add mutable data warning (#23696) 2020-04-28 12:19:15 +08:00
xrkffgg
156ff7652c fix: table filter dropdown in rtl (#23695) 2020-04-28 12:16:37 +08:00
Tom Xu
313a68c15f style: fix Transfer empty custom (#23694) 2020-04-28 12:15:48 +08:00
zefeng
14417f1614 feat(theme): adjust font-size in compact mode (#23135)
* feat(theme): adjust font-size in compact mode

With compact theme mode, we adjust default font-size from 14px to 12px.

Closes #23015

* patch: update docs min font-size

* patch

* patch

* patch

* patch

* patch

* patch
2020-04-28 11:16:01 +08:00
xrkffgg
5183592ece style: fix table row select style in rtl (#23690) 2020-04-28 09:55:16 +08:00
Tom Xu
62eaa4193b fix: docs Modal confirmLoading default value (#23682) 2020-04-27 23:45:45 +08:00
Tom Xu
a9d44593b3 fix: Table pagination position ts typo (#23681)
* fix: Table pagination postion ts typo

* fix
2020-04-27 23:45:14 +08:00
MengZhaoFly
a534e4a56a doc: fix layout demo (#23683) 2020-04-27 23:42:51 +08:00
Tom Xu
5f1d5a17de fix: Table demo dynamic settings pagination (#23679)
* fix: Table demo dynamic settings pagination

* fix test
2020-04-27 21:48:13 +08:00
xrkffgg
a823400b79 docs: optimize site of components 1 (#23670)
* docs: optimize site of components 1

* fix: lint

* fix: use space

* fix: snap

* revert: button demo

* fix snap
2020-04-27 21:40:52 +08:00
xrkffgg
3e38e4448c style: optimize list rtl style (#23676) 2020-04-27 21:40:16 +08:00
偏右
d1c39d7ec5 Merge pull request #23678 from ant-design/mergefeature
chore: Merge master branch into feature branch
2020-04-27 21:39:42 +08:00
hengkx
9868a4dc59 Merge branch 'feature' into mergefeature 2020-04-27 21:02:16 +08:00
Yu Mao
e199a7a301 fix: preserve caret position🐛 (#23633)
* 🐛 fix: preserve caret position

*  update test case for preserving caret position

* Update Password.tsx

* Update Password.test.js

* Update Password.test.js

Co-authored-by: 偏右 <afc163@gmail.com>
2020-04-27 18:02:51 +08:00
偏右
5e4d8f10ac 🐛 Fix Button icon only align issue (#23671)
https://github.com/ant-design/ant-design/pull/23670#discussion_r415662549
2020-04-27 17:54:13 +08:00
偏右
053497724d feat: List grid support more column count (#23630)
* list grid

* 🎬 update demo/useBreakpoint.md

* List grid support all number

* refactor object entries

* docs: update List grid API

*  fix snapshot

* fix ci

* use max-width instead of flex %
2020-04-27 16:59:33 +08:00
偏右
939660ec86 💄 Fix Menu duplicated shadow style (#23664)
close #23625
2020-04-27 16:39:41 +08:00
Jocker
e12b560329 docs: 📖 update use-with-create-react-app (#23661)
* Update use-with-create-react-app.zh-CN.md

官网上babel-import-plugin引用的教程有误,会误导新手
https://github.com/ant-design/ant-design/issues/23660

* Update use-with-create-react-app.zh-CN.md

* Update use-with-create-react-app.en-US.md

Co-authored-by: 偏右 <afc163@gmail.com>
2020-04-27 15:42:45 +08:00
偏右
57d36f5b68 Delete tutorial.md 2020-04-27 15:29:51 +08:00
二货机器人
2da7e29198 feat: Table summary support fixed columns (#23647)
* feat: Summary support fixed column

* update snapshot

* update demo
2020-04-27 15:08:54 +08:00
Tom Xu
2325a4438d fix: npm run site (#23658) 2020-04-27 15:02:07 +08:00
Pubudu Kodikara
1a428e852a Fix Why use the svg icon link (#23653) 2020-04-27 13:59:32 +08:00
xrkffgg
df63f2567a refactor(rate): rewrite with hook (#23545)
* refactor(rate): rewrite with hook

* fix: useContext

* fix

* remove

* fix: add displayName
2020-04-27 13:42:04 +08:00
xrkffgg
0d927a18f1 docs: optimize site of sources (#23648) 2020-04-27 13:17:53 +08:00
Tom Xu
8ae2b1f542 feat: tag support ref (#23632)
* feat: tag support ref

* feat done

* Update index.tsx
2020-04-27 13:14:00 +08:00
Tom Xu
c2dc6305f3 refactor(popover): rewrite with hook (#23535)
* refactor(popover): rewrite with hook

* Update index.tsx
2020-04-27 11:59:05 +08:00
Tom Xu
90a12fa3d0 docs: fix popconfirm doc (#23644)
* docs:  fix popconfirm doc

* Update index.en-US.md
2020-04-27 11:52:31 +08:00
xrkffgg
22b5f65830 docs: optimize site of docs (#23642)
* docs: optimize site of docs

* fix: gitee link

* fix lint
2020-04-27 11:36:04 +08:00
偏右
8934bbfffa feat: Menu.Item support icon (#23629)
* feat: Menu.Item support icon

* docs: update menu item usage

* docs: remove span wrap,when use icon

* fix: Collapsed depends on the span

*  fix demo snapshot

* do not wrap children when it is span

* Menu.SubMenu support icon prop

* fix sub menu title

* fix eslint

* update dropdown demo

* fix extra icon attribute on li

Co-authored-by: MengZhaoFly <1424254461@qq.com>
2020-04-26 23:16:15 +08:00
xrkffgg
dabec4c833 refactor(switch): rewrite with hook (#23552)
* refactor(switch): rewrite with hook

* fix: size

* fix

* fix test

* fix

* fix: size
2020-04-26 22:33:36 +08:00
Tom Xu
48ee1a68c6 refactor(popconfirm): rewrite with hook (#23536)
* refactor(popconfirm): rewrite with hook

* fix lint
2020-04-26 22:24:13 +08:00
xrkffgg
2cb635e921 docs: optimize site of spec (#23628)
* docs: optimize site of spec

* fix: lint
2020-04-26 22:13:15 +08:00
偏右
c53329a27d Merge pull request #23627 from ant-design/master
chore: merge master into feature
2020-04-26 22:12:30 +08:00
Tom Xu
9ff7f31dfe refactor(list): rewrite with hook (#23542)
* refactor(list): rewrite with hook

* fix lint

* fix lint

* fix lint

* fix Empty style dep

Co-authored-by: afc163 <afc163@gmail.com>
2020-04-26 21:23:25 +08:00
afc163
75440c47c8 docs: 📖 update customize-theme 2020-04-26 18:36:35 +08:00
xrkffgg
7e53cc7f2a docs: optimize site (#23617) 2020-04-26 17:53:08 +08:00
诸岳
8d4ede4a5a Merge pull request #23607 from ant-design/merge-master
chore: Merge master branch into feature branch
2020-04-26 17:49:16 +08:00
诸岳
a400014efe Merge branch 'master' of github.com:ant-design/ant-design into merge-master 2020-04-26 17:12:58 +08:00
诸岳
eda0064e83 fix(ci): lint error 2020-04-26 16:25:42 +08:00
偏右
89bccf5752 🐛 Fix Button loading style of icon-only (#23614)
close #23610
2020-04-26 16:21:07 +08:00
吴泽康
4c9d03874b fix: anchor regexp (#23577) (#23595)
* fix: anchor regexp (#23577)

* test: fix anchor complete href scrollTo test

* test: anchor sharp matcher regexp

* test: Anchor render perfectly for complete href - hash router
2020-04-26 16:11:37 +08:00
诸岳
f955620601 chore: Merge master branch and fix conflicts 2020-04-26 13:34:11 +08:00
偏右
3ddc99c28f 🐛 Fix Input suffix align issue (#23606)
close #23588
2020-04-26 12:46:59 +08:00
Amumu
656b5abf65 docs: update docs for less-loader@6 (#23603)
* update docs for less-loader@6

* Revert "update docs for less-loader@6"

This reverts commit 5be1a428dc.

* update

* update

* update

* in line
2020-04-26 12:11:01 +08:00
afc163
c9c44c173f fix demo snapshot 2020-04-26 11:00:13 +08:00
Heechan Bak
88cab9547b Update: Add lessOptions in the use-with-create-react-app (#23596) 2020-04-26 10:49:10 +08:00
Tom Xu
60f3e775d0 style: fix table size nest table margin (#23602) 2020-04-26 10:42:05 +08:00
xrkffgg
41da9de946 docs: add symbol (#23600) 2020-04-26 09:34:46 +08:00
诸岳
44da4125fa fix(site): frameworky => framework 2020-04-26 00:09:23 +08:00
诸岳
ac14f44f2b Merge branch 'master' of github.com:ant-design/ant-design 2020-04-25 23:47:08 +08:00
偏右
569b6539d3 🆙 eslint-plugin-unicorn 2020-04-25 23:20:30 +08:00
诸岳
454a02b4d9 chore(test): Update snapshots 2020-04-25 22:54:11 +08:00
Tom Xu
8cdf1c017a fix: ConfigProvider getPopupContainer invalid (#23594)
* fix: ConfigProvider getPopupContainer invalid

* slider getPopupContainer

* Create container.test.js

* Update container.test.js
2020-04-25 22:46:21 +08:00
Tom Xu
8f30a14790 refactor(badge): rewrite with hook (#23488)
* refactor(badge): rewrite with hook

* Update ScrollNumber.tsx
2020-04-25 20:53:21 +08:00
Tom Xu
7379cfa4c2 feat: button support ref (#23571)
* feat: button support ref

* improve

* improve button displayName
2020-04-25 20:45:28 +08:00
偏右
2785d22e5c Update README.md 2020-04-25 19:49:45 +08:00
诸岳
9963e515d1 docs: Add the changelog of 4.1.5 (#23589)
* docs: Add the changelog of 4.1.5

* docs: Update changelog of 4.1.5

* Bump 4.1.5
2020-04-25 19:29:07 +08:00
afc163
5e9bf9fdc0 📖 upgrade less-loader@6 usage 2020-04-25 18:55:29 +08:00
afc163
99bcad6dd6 fix unused import 2020-04-25 18:47:36 +08:00
ibrahim velinov
336a6fba42 docs: Rephrase 500 error (#23570)
* Rephrase 500 error

'Server is wrong' is not a clear sentence for users. I propose to use 'Something went wrong' with 500.

* Update demo.test.js.snap
2020-04-25 18:16:12 +08:00
Benjamin Vertonghen
175e0aaa14 feat: Link Ant Design Blazor (#23579)
* Link Ant Design Blazor

* Indent and align

Co-authored-by: Benjamin Vertonghen <benjamin.vertonghen@apped.be>
2020-04-25 18:12:29 +08:00
二货机器人
22ffa61da0 fix: Legacy button group style (#23590) 2020-04-25 18:03:35 +08:00
Tom Xu
54f2abfe47 refactor(tree): rewrite with hook (#23550)
* refactor(tree): rewrite with hook

* fix codecov

* Update directory.test.js

* Update README.md

* 🆙 upgrade intersection-observer

* refactor(tree): rewrite with hook

* fix codecov

* Update directory.test.js

Co-authored-by: 偏右 <afc163@gmail.com>
2020-04-25 15:30:13 +08:00
二货机器人
efbb2849dc fix: Tree with quick loadData frozen the virtual scroll (#23581)
* update version

* add deadline

* clean up
2020-04-25 11:13:14 +08:00
afc163
d50cc55d87 📖 fix site description and rtl className 2020-04-24 18:48:48 +08:00
偏右
6a49973bb9 docs: 📖 Update data-display.zh-CN.md (#23567)
* Update data-display.zh-CN.md

* Update data-display.en-US.md
2020-04-24 18:24:20 +08:00
Adriano Ruberto
d2140490d8 Fix ie11 flex in steps (#23566) 2020-04-24 18:12:09 +08:00
xrkffgg
dfcaa408c2 style: optimize steps rtl (#23564) 2020-04-24 17:55:44 +08:00
Amumu
fb46b8a864 chore: Add navigation for China mirror site (#23562)
* Add navigation for domestic mirror sites

* use A tag
2020-04-24 17:17:03 +08:00
偏右
d860358f94 chore: 🎬 optimize Table demo code (#23560)
* 🎬 optimize Table demo code

*  fix demo snapshot

* 🐛 Fix Table warning when pageSize is changed

close #23554

* remove console.log

* optimize demo code
2020-04-24 17:16:44 +08:00
Adriano Ruberto
289dd080b9 fix(steps): Add flex on steps to fix ie11 (#23561)
* Add flex on steps to fix ie11

* Ordering
2020-04-24 16:46:46 +08:00
偏右
7cf20f18a1 🆙 upgrade intersection-observer 2020-04-24 13:32:56 +08:00
偏右
6556b583bd Update README.md 2020-04-24 13:29:50 +08:00
Vitaly Budovski
f09686d3df feat: Responsive table columns (#23298) 2020-04-24 12:17:42 +08:00
Sonjeet Paul
4f1ad3ef4b url navigates to correct component listing (#23540) 2020-04-24 10:41:38 +08:00
Tom Xu
eb83d6b341 docs: fixed link path for components (#23533) 2020-04-24 10:40:23 +08:00
Sonjeet Paul
f9c56b6eb4 docs: 📖 fixed link path for components 2020-04-23 21:10:57 +08:00
Tom Xu
6401da2082 refactor(comment): rewrite with hook (#23498)
* refactor(comment): rewrite with hook

* improve comment code
2020-04-23 20:52:15 +08:00
偏右
d2c541b4e2 fix: 🐛 Input.Search height affected by suffix (#23527)
* 🎬 improve Input demo code

* style: fix Input.Search height stretched by suffix

close #23523

* fix react key warning

*  fix demo snapshot
2020-04-23 18:11:11 +08:00
xrkffgg
facbe46251 style: optimize alert rtl tyle (#23526)
* style: optimize alert rtl tyle

* fix dark
2020-04-23 17:58:36 +08:00
xrkffgg
be72d1762a fix: upload disabled hover border (#23522) 2020-04-23 15:58:17 +08:00
xrkffgg
eb5c7ffc7e style: complete upload rtl (#23520) 2020-04-23 15:01:20 +08:00
二货机器人
8ec4d3f64f docs: Update research result image (#23519) 2020-04-23 13:57:32 +08:00
Amumu
fb2ef64036 update Compatibility intro (#23513) 2020-04-23 11:55:37 +08:00
偏右
cd34b624b3 🐛 Fix Menu behavior when hover gap (#23511)
close #13955
2020-04-23 11:17:21 +08:00
偏右
835bcabdbc 💄 fix DatePicker/TimePicker icon color (#23508)
should be same as 3.x
2020-04-23 10:48:51 +08:00
xiaoxintang
937beba421 fix: Table selections type when use Table.SELECTION_ALL or Table.SELECTION_INVERT (#23462)
* fix:selections type when use SELECTION_ALL | SELECTION_INVERT

* fix: Table selections type when use Table.SELECTION_ALL or Table.SELECTION_INVERT

* fix: Table selections type when use Table.SELECTION_ALL or Table.SELECTION_INVERT

* Update useSelection.tsx

* Update type.test.tsx

Co-authored-by: 二货机器人 <smith3816@gmail.com>
2020-04-22 21:59:18 +08:00
二货机器人
d77c2e8ba7 docs: Mention filterOption params change in doc (#23501)
* Update migration-v4.zh-CN.md

* Update migration-v4.en-US.md
2020-04-22 21:24:36 +08:00
偏右
17f7e2f4d2 fix: Tree custom icon missing when loading (#23494)
close #23470
2020-04-22 21:11:57 +08:00
Eric Wang
800871166c chore: Transform alert test to typescript (#23495) 2020-04-22 18:16:03 +08:00
Tom Xu
b7e877aeef refactor(slider): rewrite with hook (#23474)
* refactor(slider): rewrite with hook

* improve test

* Revert "improve test"

This reverts commit 48cd83d0cc.

* improve test

* improve test 2
2020-04-22 15:58:57 +08:00
偏右
c550cb050b 💄 fix DatePicker/TimePicker disabled icon color (#23478) 2020-04-22 15:16:51 +08:00
Eric Wang
64cb9584ce fix: include tests in type check (#23452)
* fix: include tests in type check

* Do lint *.md

* Improve types in tests
2020-04-22 13:37:23 +08:00
Eric Wang
55265ac4ef chore: Replace domhook with jest.spyon (#23469)
* chore: Replace domhook with jest.spyon

* use mockreturn value when possible

* Update tests/shared/focusTest.js
2020-04-22 11:59:56 +08:00
xrkffgg
677168b007 style: optimize tabs rtl style (#23471) 2020-04-22 11:57:06 +08:00
偏右
7935651899 style: select arrow won't rotate now (#23468)
* style: 💄 Select arrow won't rotate when open

* Update index.less
2020-04-22 11:54:13 +08:00
Tom Xu
cf3d611f59 refactor(tag): rewrite with hook (#23466)
* refactor(tag): rewrite with hook

* fix lint
2020-04-22 10:59:24 +08:00
偏右
a4c07fc0af Merge pull request #23465 from ant-design/master
chore: merge master into feature
2020-04-22 10:42:00 +08:00
二货机器人
a1e0c41c8b feat: ConfigProvider support config Input autoComplete (#23455)
* support autoComplete

* update doc

* fix lint
2020-04-22 10:38:43 +08:00
xrkffgg
d7e97aa996 style: optimize tag rtl style (#23464) 2020-04-22 10:00:59 +08:00
Tom Xu
4a3e01ff0b refactor(input-number): rewrite with hook (#23461) 2020-04-22 09:48:10 +08:00
pdeva
3e22b505a3 fix: proper react import (#23381)
* proper react import

fix for #22708

* update iconutil in select

* update in tree component
2020-04-22 09:37:46 +08:00
偏右
db97c5788e chore: add remark lint (#23457)
* 💄 Add remark lint for markdown files

* 💄 Add remark lint for markdown files

* 💄 Add remark lint for markdown files
2020-04-21 23:40:41 +08:00
二货机器人
1163d8e23d docs: Update demo (#23451) 2020-04-21 23:26:41 +08:00
xrkffgg
5e09660a3e fix: collapse default position in rtl (#23445)
* fix: collapse default position in rtl

* update snap

* up

* fix

* fix

* fix var

* fix
2020-04-21 23:23:37 +08:00
Eric Wang
9a43e439b3 chore: Use override instead of env to control eslint on markdown (#23454) 2020-04-21 23:21:56 +08:00
偏右
428b07625c fix: Select arrow cannot trigger open (#23448)
close #23447
2020-04-21 18:03:47 +08:00
Amumu
17c63e52bf chore: improve less variable @form-item-margin-bottom (#23436)
* improve @formItemMarginBottom

* Revert "improve @formItemMarginBottom"

This reverts commit 6d8da5bdb9.

* update style
2020-04-21 17:48:15 +08:00
偏右
02faa4bcf1 💄 tweak Table selected row hover background (#23313) 2020-04-21 16:53:06 +08:00
偏右
4902c5a4f0 docs: 📖 update Form ts demo for createRef (#23440)
close #23417
2020-04-21 16:42:56 +08:00
偏右
8bd8eee573 fix: first Divider render bug (#23438)
close #23432
2020-04-21 16:16:13 +08:00
xrkffgg
f467df5fe2 feat: add rtl calendar (#23394) 2020-04-21 15:29:36 +08:00
偏右
1dab17eef0 feat: 💄 Divider support plain for lighter style (#23405)
* 💄 Divider support `asHeading` for lighter style

*  fix demo snapshot

* docs: 📖 Divider asHeading documentation

* fix tsd

*  fix demo snapshot

* asHeading to plain

*  fix demo snapshot

* fix css
2020-04-21 14:16:33 +08:00
偏右
e206b4146b chore: add gitleaks.yml (#23425)
* Add gitleaks.yml

* Update gitleaks.yml

* chore: add gitleaks (#23428)

* chore: add gitleaks

* chore: remove gitleaks

* Apply suggestions from code review

Co-authored-by: pr <pr>
Co-authored-by: 偏右 <afc163@gmail.com>

Co-authored-by: 信鑫-King <chaolin.jcl@alibaba-inc.com>
2020-04-21 12:19:23 +08:00
偏右
c3e263f2f2 chore: 🚮 remove console (#23431) 2020-04-21 11:47:09 +08:00
二货机器人
2105a330dd docs: Remove dead link & Update dead images (#23427)
* docs: Replace image

* update link
2020-04-21 11:34:26 +08:00
xrkffgg
6d238a734d feat: search rtl (#23424) 2020-04-21 11:25:53 +08:00
偏右
2c86aebfa3 Merge pull request #23426 from ant-design/master
chore: merge master into feature
2020-04-21 11:24:57 +08:00
二货机器人
5a10d29796 fix: ConfigProvider with nest prefixCls (#23423)
* fix: ConfigProvider with nest prefixCls

* update

* update

* update
2020-04-21 11:16:33 +08:00
xrkffgg
3d76859bbc style: add dropdown group title rtl style (#23404)
* style: add dropdown group title rtl style

* fix margin

* fix lint
2020-04-21 10:49:59 +08:00
二货机器人
1d50004644 feat: Typography support onEllipsis (#23414)
* feat: support onEllipsis

* add test case

* update doc
2020-04-21 10:13:57 +08:00
二货机器人
ac7865a6fc chore: Adjust search style (#23406)
* chore: Adjust search style

* fix lint

* Update demo.test.js.snap

* update style

* update cover area

* area it
2020-04-21 09:41:09 +08:00
偏右
fc98ab7222 test: increase test cov for Layout and Typography (#23407) 2020-04-20 19:18:53 +08:00
二货机器人
40afa44673 chore: Move preview res to cdn (#23408) 2020-04-20 18:40:18 +08:00
xrkffgg
43bc7196ea docs: fix site subtitle in rtl (#23403) 2020-04-20 17:25:11 +08:00
xrkffgg
089591ac34 style: add steps disabled style (#23402) 2020-04-20 17:05:41 +08:00
xrkffgg
f748c4ef17 style: optimize pageheader rtl style (#23401) 2020-04-20 16:50:38 +08:00
xrkffgg
0b6d34d474 style: optimize statistic rtl style (#23397) 2020-04-20 16:29:30 +08:00
xrkffgg
e2dacde754 style: fix button loading rtl (#23399) 2020-04-20 16:25:43 +08:00
afc163
e797d44c9e chore: upgrade rc-upload to fix ci 2020-04-20 15:47:25 +08:00
linye
62d51034c4 Update MorePage.tsx (#23389) 2020-04-20 11:52:50 +08:00
linye
849ab34189 docs: Update RecommendPage.tsx (#23387)
* Update RecommendPage.tsx

* Update site/theme/template/Home/RecommendPage.tsx

Co-authored-by: 偏右 <afc163@gmail.com>
2020-04-20 11:11:02 +08:00
xrkffgg
757c57622b feat: add rate direction (#23321)
* feat: add rate direction

* fix: remove css

* remove classname
2020-04-20 11:05:27 +08:00
偏右
fd38c347a8 Update FUNDING.yml 2020-04-19 20:22:27 +08:00
偏右
54d050324a 🐛 Fix Carousel tabindex in non-active slide (#23380)
close #23294
2020-04-19 01:28:54 +08:00
偏右
76ee9668ef docs: 📖 update react-slick API link (#23379)
* Update index.en-US.md

* Update index.zh-CN.md
2020-04-19 00:51:56 +08:00
偏右
fabec4831c Merge pull request #23377 from ant-design/master
chore: Merge master into feature
2020-04-18 23:54:51 +08:00
陈帅
7489786d22 docs: add 4.1.4 changelog (#23373)
* doc: add 4.1.4 changelog

* fix error version

* sort log

* groud log

* add #23331

* fix review doc

* fix review doc
2020-04-18 21:59:24 +08:00
二货机器人
31267c5648 docs: Update migration for Select events (#23376)
* docs: Update migration for Select events

* Update migration-v4.en-US.md
2020-04-18 21:10:01 +08:00
Tom Xu
6e1ffb96ca fix: Input.Search ConfigProvider size (#23331)
* fix: Input.Search ConfigProvider size

* Update Search.tsx

* add test

* Update size.md
2020-04-18 18:31:03 +08:00
偏右
5ca5f44a7e 🆙 upgrade intersection-observer 2020-04-18 16:23:31 +08:00
Tom Xu
50416b3a7b improvement: Form default locale (#23165)
* improve: Form default locale

* fix lint

* fix lint

* improve form doc

* add test case

* improve form validate messages
2020-04-18 13:18:51 +08:00
Tom Xu
09e69c385e refactor(button): rewrite with hook (#23367) 2020-04-18 13:06:04 +08:00
偏右
f4c489553f fix: Modal.info onOk execute times (#23360)
* refactor: modal confirm onOk code

* fix: Modal.xxx onOk execute time when has close argument

close #23358

* Add test case

* fix lint
2020-04-18 01:09:14 +08:00
Eric Wang
95f6f0f14a Chore: Refactor affix test to typescript (#23364) 2020-04-18 00:31:31 +08:00
Amumu
c70b49a709 fix: fix tree key ts type (#23348)
* fix tree key ts type

* revert snap
2020-04-17 23:31:39 +08:00
Amumu
5e7f3cc67e firstActiveValue has been deprecated, remove it (#23354) 2020-04-17 18:10:10 +08:00
kenve
edcd1b2609 docs(components): improve link (#23355) 2020-04-17 17:56:42 +08:00
偏右
8ab146220e 💄 Fix Input[type=color] height (#23351)
close #23334
2020-04-17 16:04:20 +08:00
xrkffgg
6c451865eb site: add title upload picture-card (#23312)
* style: fix modal body padding without header

* change demo

* add url
2020-04-17 14:28:18 +08:00
xrkffgg
7d5910faf0 style: fix menu rtl style (#23319) 2020-04-16 17:40:13 +08:00
二货机器人
7e9fe271ed feat: Space support align (#23306)
* support align

* update demo & snapshot

* update comment

* update docs

* Update components/space/index.en-US.md

Co-Authored-By: 骗你是小猫咪 <darryshaw@gmail.com>

* update doc

Co-authored-by: 骗你是小猫咪 <darryshaw@gmail.com>
2020-04-16 12:28:04 +08:00
Misha Kav
cff24d5dcb add missings translations in he_IL (#23302) 2020-04-16 10:08:37 +08:00
Misha Kav
f9cb1522f3 add missing translations in ru_IL (#23303) 2020-04-16 10:07:38 +08:00
偏右
0716d1498f fix: Dropdown submenu background (#23296)
* 🐛 Fix Dropdown submenu background

close #23293

* remove unused code
2020-04-15 23:00:51 +08:00
二货机器人
f7d1d41220 fix: multiple selector disabled remove icon (#23295)
* fix: Select remove icon

* revert demo
2020-04-15 22:54:59 +08:00
偏右
ff509bccd0 fix: optimize PageHeader responsive behavior (#23277)
* 💄 optimize PageHeader responsive behavior

close #23260

*  add test case

* remove console
2020-04-15 12:44:35 +08:00
zefeng
bff09f8fde fix: fix ${theme}-theme.js file order (#23243)
* fix: fix ${theme}-theme.js file order

* chore: add generateThemeFileContent test

* chore: add test

* patch

* update docs

* update docs

* update docs
2020-04-15 11:37:29 +08:00
偏右
c7cc8d40c8 🐛 Select custom suffixIcon could be operated (#23274)
close #23263
2020-04-15 11:29:38 +08:00
二货机器人
c2a1fe5b1f docs: Update Table edit row example (#23270) 2020-04-15 10:39:16 +08:00
二货机器人
9c08bb2482 docs: Add listHeight desc (#23268) 2020-04-15 10:04:01 +08:00
二货机器人
02d7292576 fix: Input inline allowClear style (#23259)
* fix: Input allow clear icon

* update test case

* update snapshot
2020-04-14 23:04:23 +08:00
myeunhyuk
178ccbee6a Update resources.en-US.md (#23254) 2020-04-14 21:06:41 +08:00
myeunhyuk
d3b367ad04 docs: Update resources page sketch file (#23253) 2020-04-14 21:06:13 +08:00
Dongcheng Wang
ac5050f4ed doc(slider): value & defaultValue not consistent with definition (#23252) 2020-04-14 19:33:49 +08:00
nick
87da7bfe67 feat: add custom isImgurl prop to Upload Component (#23248)
* feat: customize isImageUrl support

* docs: Update Upload doc

* docs: Add isImgUrl default implement link

* docs: update default link address
2020-04-14 19:32:16 +08:00
zefeng
efd25100a5 fix: tree-select render blank in compact mode (#23231) 2020-04-14 19:17:42 +08:00
偏右
4ad5830eec fix: Select caret missing in Collapse (#23250)
close #23059
close #23175
2020-04-14 18:20:24 +08:00
Christian Fleschhut
54b11b2ae3 docs(Empty component): 📖 Fix typo in image prop description (#23251) 2020-04-14 18:20:14 +08:00
afc163
19a7b55a9f 🆙 upgrade intersection-observer 2020-04-14 17:32:09 +08:00
Tanmoy Bhowmik
e3d2754b1d fix: Fix popupClassName prop in timepicker (#23214)
* fix(time-picker): combine dropdownClassName and popupClassName prop

* test(time-picker): add test for popupClassName and dropdownClassName prop

* chore(time-picker): add demo for popupClassName prop

* test(time-picker): remove rc-picker dependency

* doc(time-picker): change default prop of popupClassName to undefined

* fix(time-picker): remove the use of dropdownClassName

* Apply suggestions from code review

Co-authored-by: 偏右 <afc163@gmail.com>
2020-04-14 16:49:58 +08:00
Evan Charlton
58c6900175 chore: Fix console warning typo (validate -> valid) (#23240)
Clean up the typos in the helpful console warning messages which get
emitted if the incorrect prop is passed to certain components.
2020-04-14 16:48:23 +08:00
xrkffgg
1855fef437 fix: fix select rtl (#23235)
* fix: fix select rtl

* fix lint

Co-Authored-By: Amumu <yoyo837@hotmail.com>

Co-authored-by: Amumu <yoyo837@hotmail.com>
2020-04-14 16:42:39 +08:00
二货机器人
c338569cff docs: Update Form required desc (#23238)
* Update index.zh-CN.md

* Update index.en-US.md
2020-04-14 15:41:15 +08:00
Amumu
2c6733b0c8 add release date (#23229) 2020-04-14 12:46:30 +08:00
偏右
b1f3587e02 Update visual.zh-CN.md (#23218) 2020-04-14 10:38:06 +08:00
Rustin
13fda44fb1 refactor(skeleton): rewrite with hook (#23206)
* refactor(skeleton): rewrite with hook

* fix(skeleton): refine lint and compile issues

* fix(skeleton): refine compile issues

* chore: ignore eslint warning
2020-04-14 10:30:14 +08:00
二货机器人
8c11676afa fix: Table selection childrenColumnName not work (#23205)
* fix childrenPropName

* test case

* update test case
2020-04-13 22:56:26 +08:00
Eric Wang
436d4b1be5 improvement: Fix types in form item (#22962)
* Fix types in form item

* use jsx.element
2020-04-13 21:30:55 +08:00
afc163
3f4f5864fe fix test case which fails a lot 2020-04-13 20:38:31 +08:00
afc163
59c0cdf3a2 fix test case which fails a lot 2020-04-13 20:21:30 +08:00
偏右
0ca9c69da2 release 4.1.3 (#23199) 2020-04-13 19:35:12 +08:00
HouXiancheng
8c3081788c fix: table fixed bug (#23181) 2020-04-13 19:32:50 +08:00
偏右
f7ead77f88 chore: Improve changelog workflow (#23198)
*  improve changelog workflow

* chore: fill missing changelog

* allow custom input
2020-04-13 19:04:49 +08:00
二货机器人
ca93757747 fix: vertial from label height (#23192) 2020-04-13 16:59:05 +08:00
xrkffgg
fca1367085 feat: add notification rtl config (#23185)
* feat: add notification rtl config

* test: add test
2020-04-13 15:45:49 +08:00
xrkffgg
d160016959 style: fix steps rtl (#23183) 2020-04-13 13:53:42 +08:00
Eric Wang
7bc3d4f222 chore: Refactor the button test to use typescript (#22953)
* Refactor the button test to use typescript

* update tsconfig.json

* Change file name as a workaround

* update antd-tools
2020-04-13 13:36:23 +08:00
HouXiancheng
653724b79e fix: tabs_animation_bug (#23151)
* fix: tabs_animation_bug

* fix: fix lint error

Co-authored-by: 侯先诚 <houxiancheng@houxianchengdeMacBook-Pro.local>
2020-04-13 12:19:06 +08:00
zefeng
65293f62d6 feat: add getThemeVar file to support theme config and fix 4.1.2 them… (#23171)
* feat: add getThemeVar file to support theme config and fix 4.1.2 theme config breaking change

* patch
2020-04-13 00:05:48 +08:00
baozefeng
9c2473ab25 Revert "feat: add getThemeVar file to support theme config and fix 4.1.2 theme config breaking change"
This reverts commit 3d9b891a26.
2020-04-12 22:48:53 +08:00
baozefeng
3d9b891a26 feat: add getThemeVar file to support theme config and fix 4.1.2 theme config breaking change 2020-04-12 22:48:10 +08:00
二货机器人
de68e37da2 fix @tabs-card-height (#23168) 2020-04-12 21:01:14 +08:00
二货机器人
12ce6aba06 fix: Safari12 fixed column (#23161)
* fix: Safari12 fixed column

* fix lint
2020-04-12 17:55:30 +08:00
二货机器人
6bb6c4c243 small size (#23160) 2020-04-12 15:33:43 +08:00
zefeng
5999aa7414 docs: update customize theme docs (#23159) 2020-04-12 15:32:15 +08:00
二货机器人
90e952a920 Merge pull request #23158 from ant-design/master-to-merge-feature
chore: Merge master into feature
2020-04-12 15:30:20 +08:00
afc163
78ec790311 resolve merge conflict 2020-04-12 14:44:29 +08:00
afc163
89ce33f5d8 update snapshot 2020-04-12 12:55:42 +08:00
Chiciuc Nicușor
eb90c5b0a0 fix: Use ElementOf<T> instead of array indexing (#23132) 2020-04-11 20:46:09 +08:00
二货机器人
deafd3fcce fix: compact group style (#23149)
* fix: compact group style

* updat snapshot
2020-04-11 20:33:08 +08:00
二货机器人
ff30366d22 chore: add preview (#23128)
* chore: add preview

* update template

* update ignore lint

* update template

* support quota analysis

* comment it

* trigger build

* trigger build

* force trigger
2020-04-11 19:52:55 +08:00
Joker Wang
f93f86123e fix: Pagination missing showTitle (#23134) (#23144)
* fix: Pagination missing showTitle (#23134)

* Update Chinese description of showTitle

Co-Authored-By: 偏右 <afc163@gmail.com>

Co-authored-by: 偏右 <afc163@gmail.com>
2020-04-11 16:36:12 +08:00
Chris Young
ca616647ce modify table size.less to accomodate size prop for footer padding (#23140) 2020-04-11 16:11:28 +08:00
二货机器人
50d908662e docs: Update Form FAQ (#23138)
* docs: Update Form FAQ

* Update index.en-US.md
2020-04-11 10:30:05 +08:00
偏右
bfd5d7c910 fix: PageHeader style breaks when title is too long (#23133)
* fix: PageHeader style breaks when title is too long

close #15664

*  update snapshot

* 💄 Improve PageHeader responsive design
2020-04-10 19:25:31 +08:00
二货机器人
49acc871b9 chore: Fix compile error (#23131) 2020-04-10 18:47:08 +08:00
二货机器人
77d45690c0 feat: Form.Item support initialValue & getValueProps (#22993)
* add getValueProps

* field initialValue

* add faq
2020-04-07 21:57:27 +08:00
二货机器人
77dd5af0eb Merge pull request #22998 from ant-design/master
chore: Feature merge master
2020-04-07 21:00:00 +08:00
偏右
939ea047ad Merge pull request #22952 from ant-design/master
chore: Merge master into feature
2020-04-06 19:13:37 +08:00
二货机器人
678168a74e Merge pull request #22880 from ant-design/master
chore: Feature merge master
2020-04-03 13:58:35 +08:00
二货机器人
1cc9ffdd3e Merge pull request #22823 from ant-design/master
feature merge master
2020-04-01 18:10:00 +08:00
873 changed files with 63089 additions and 26064 deletions

View File

@@ -1,38 +1,20 @@
const fs = require('fs');
const path = require('path');
// eslint-disable-next-line import/no-extraneous-dependencies
const packageInfo = require('./package.json');
const defaultVars = require('./scripts/default-vars');
const darkVars = require('./scripts/dark-vars');
const compactVars = require('./scripts/compact-vars');
function generateThemeFileContent(theme) {
return `const { ${theme}ThemeSingle } = require('./theme');\nconst defaultTheme = require('./default-theme');\n
module.exports = {
...defaultTheme,
...${theme}ThemeSingle
}`;
}
// We need compile additional content for antd user
function finalizeCompile() {
if (fs.existsSync(path.join(__dirname, './lib'))) {
// Build package.json version to lib/version/index.js
// prevent json-loader needing in user-side
const versionFilePath = path.join(process.cwd(), 'lib', 'version', 'index.js');
const versionFileContent = fs.readFileSync(versionFilePath).toString();
fs.writeFileSync(
versionFilePath,
versionFileContent.replace(
/require\(('|")\.\.\/\.\.\/package\.json('|")\)/,
`{ version: '${packageInfo.version}' }`,
),
);
// eslint-disable-next-line no-console
console.log('Wrote version into lib/version/index.js');
// Build package.json version to lib/version/index.d.ts
// prevent https://github.com/ant-design/ant-design/issues/4935
const versionDefPath = path.join(process.cwd(), 'lib', 'version', 'index.d.ts');
fs.writeFileSync(
versionDefPath,
`declare var _default: "${packageInfo.version}";\nexport default _default;\n`,
);
// eslint-disable-next-line no-console
console.log('Wrote version into lib/version/index.d.ts');
// Build a entry less file to dist/antd.less
const componentsPath = path.join(process.cwd(), 'components');
let componentsLessContent = '';
@@ -53,19 +35,34 @@ function finalizeCompile() {
function buildThemeFile(theme, vars) {
// Build less entry file: dist/antd.${theme}.less
fs.writeFileSync(
path.join(process.cwd(), 'dist', `antd.${theme}.less`),
`@import "../lib/style/${theme}.less";\n@import "../lib/style/components.less";`,
);
// eslint-disable-next-line no-console
console.log(`Built a entry less file to dist/antd.${theme}.less`);
if (theme !== 'default') {
fs.writeFileSync(
path.join(process.cwd(), 'dist', `antd.${theme}.less`),
`@import "../lib/style/${theme}.less";\n@import "../lib/style/components.less";`,
);
// eslint-disable-next-line no-console
console.log(`Built a entry less file to dist/antd.${theme}.less`);
} else {
fs.writeFileSync(
path.join(process.cwd(), 'dist', `default-theme.js`),
`module.exports = ${JSON.stringify(vars, null, 2)};\n`,
);
return;
}
// Build ${theme}.js: dist/${theme}-theme.js, for less-loader
fs.writeFileSync(
path.join(process.cwd(), 'dist', `theme.js`),
`const ${theme}ThemeSingle = ${JSON.stringify(vars, null, 2)};\n`,
{
flag: 'a',
},
);
fs.writeFileSync(
path.join(process.cwd(), 'dist', `${theme}-theme.js`),
`module.exports = ${JSON.stringify(vars, null, 2)};`,
generateThemeFileContent(theme),
);
// eslint-disable-next-line no-console
@@ -80,10 +77,47 @@ function finalizeDist() {
'@import "../lib/style/index.less";\n@import "../lib/style/components.less";',
);
// eslint-disable-next-line no-console
fs.writeFileSync(
path.join(process.cwd(), 'dist', 'theme.js'),
`const defaultTheme = require('./default-theme.js');\n`,
);
// eslint-disable-next-line no-console
console.log('Built a entry less file to dist/antd.less');
buildThemeFile('default', defaultVars);
buildThemeFile('dark', darkVars);
buildThemeFile('compact', compactVars);
fs.writeFileSync(
path.join(process.cwd(), 'dist', `theme.js`),
`
function getThemeVariables(options = {}) {
let themeVar = {
'hack': \`true;@import "\${require.resolve('antd/lib/style/color/colorPalette.less')}";\`,
...defaultTheme
};
if(options.dark) {
themeVar = {
...themeVar,
...darkThemeSingle
}
}
if(options.compact){
themeVar = {
...themeVar,
...compactThemeSingle
}
}
return themeVar;
}
module.exports = {
darkThemeSingle,
compactThemeSingle,
getThemeVariables
}`,
{
flag: 'a',
},
);
}
}
@@ -94,4 +128,5 @@ module.exports = {
dist: {
finalize: finalizeDist,
},
generateThemeFileContent,
};

14
.bundle-analyzerrc.json Normal file
View File

@@ -0,0 +1,14 @@
{
"files": [
{
"test": "./dist/antd.min.js",
"maxSize": "300 kB",
"compression": "gzip"
},
{
"test": "./dist/antd.min.css",
"maxSize": "65 kB",
"compression": "gzip"
}
]
}

View File

@@ -22,10 +22,10 @@ references:
ignore: gh-pages
- dist:
requires:
- setup
- setup
- compile:
requires:
- setup
- setup
- lint:
requires:
- setup
@@ -166,7 +166,7 @@ workflows:
<<: *workflow
triggers:
- schedule:
cron: "0 0 * * *"
cron: '0 0 * * *'
filters:
branches:
only:

View File

@@ -10,6 +10,10 @@ module.exports = {
'**/*.json',
],
modulePattern: [
{
pattern: /ConfigContext.*renderEmpty/ms,
module: '../empty',
},
{
pattern: /ConfigConsumer.*renderEmpty/ms,
module: '../empty',

1
.dockerignore Normal file
View File

@@ -0,0 +1 @@
node_modules/

View File

@@ -24,3 +24,5 @@ node_modules
_site
dist
**/*.d.ts
# Scripts
scripts/previewEditor/**/*

View File

@@ -1,4 +1,4 @@
const eslintrc = {
module.exports = {
extends: [
'airbnb',
'prettier',
@@ -31,6 +31,29 @@ const eslintrc = {
'@typescript-eslint/no-unused-expressions': 2,
},
},
{
files: ['*.md'],
globals: {
React: true,
ReactDOM: true,
mountNode: true,
},
rules: {
indent: 0,
'no-console': 0,
'no-plusplus': 0,
'eol-last': 0,
'no-script-url': 0,
'prefer-rest-params': 0,
'react/no-access-state-in-setstate': 0,
'react/destructuring-assignment': 0,
'react/no-multi-comp': 0,
'jsx-a11y/href-no-hash': 0,
'import/no-extraneous-dependencies': 0,
'import/no-unresolved': 0,
'jsx-a11y/control-has-associated-label': 0,
},
},
],
rules: {
camelcase: 0,
@@ -91,38 +114,12 @@ const eslintrc = {
'jest/no-test-callback': 0,
'jest/expect-expect': 0,
'react-hooks/rules-of-hooks': 2, // Checks rules of Hooks
"unicorn/better-regex": 2,
"unicorn/prefer-trim-start-end": 2,
"unicorn/expiring-todo-comments": 2,
"unicorn/no-abusive-eslint-disable": 2,
'unicorn/better-regex': 2,
'unicorn/prefer-trim-start-end': 2,
'unicorn/expiring-todo-comments': 2,
'unicorn/no-abusive-eslint-disable': 2,
},
globals: {
gtag: true,
},
};
if (process.env.RUN_ENV === 'DEMO') {
eslintrc.globals = Object.assign(eslintrc.globals, {
React: true,
ReactDOM: true,
mountNode: true,
});
Object.assign(eslintrc.rules, {
indent: 0,
'no-console': 0,
'no-plusplus': 0,
'eol-last': 0,
'no-script-url': 0,
'prefer-rest-params': 0,
'react/no-access-state-in-setstate': 0,
'react/destructuring-assignment': 0,
'react/no-multi-comp': 0,
'jsx-a11y/href-no-hash': 0,
'import/no-extraneous-dependencies': 0,
'import/no-unresolved': 0,
'jsx-a11y/control-has-associated-label': 0,
});
}
module.exports = eslintrc;

3
.github/FUNDING.yml vendored
View File

@@ -4,5 +4,6 @@ github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, u
open_collective: ant-design
patreon: ant_design
ko_fi: # Replace with a single Ko-fi username
issuehunt: ant-design/ant-design
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
custom: # Replace with a single custom sponsorship URL
custom: https://www.buymeacoffee.com/antdesign

View File

@@ -1,11 +0,0 @@
---
name: '⚠️ Please use new-issue.ant.design ⚠️'
about: The issue which is not created via http://new-issue.ant.design will be closed immediately.
labels:
---
The issue which is not created via http://new-issue.ant.design will be closed immediately.
---
注意:不是用 http://new-issue.ant.design 创建的 issue 会被立即关闭。

5
.github/ISSUE_TEMPLATE/config.yml vendored Normal file
View File

@@ -0,0 +1,5 @@
blank_issues_enabled: true
contact_links:
- 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.

View File

@@ -4,17 +4,20 @@ First of all, thank you for your contribution! 😄
New feature please send pull request to feature branch, and rest to master branch.
Pull request will be merged after one of collaborators approve.
Please makes sure that these form are filled before submitting your pull request, thank you!
-->
[[中文版模板 / Chinese template](https://github.com/ant-design/ant-design/blob/master/.github/PULL_REQUEST_TEMPLATE/pr_cn.md)]
-->
### 🤔 This is a ...
- [ ] New feature
- [ ] Bug fix
- [ ] Site / document update
- [ ] Site / documentation update
- [ ] Demo update
- [ ] Component style update
- [ ] TypeScript definition update
- [ ] Bundle size optimization
- [ ] Perfermance optimization
- [ ] Refactoring
- [ ] Code style optimization
- [ ] Test Case
@@ -48,7 +51,7 @@ Describe changes from userside, and list all potential break changes or other ri
### ☑️ Self Check before Merge
⚠️ Please check all items below before review. ⚠️
⚠️ Please check all items below before review. ⚠️
- [ ] Doc is updated/provided or not needed
- [ ] Demo is updated/provided or not needed

View File

@@ -13,8 +13,11 @@
- [ ] 新特性提交
- [ ] 日常 bug 修复
- [ ] 站点、文档改进
- [ ] 演示代码改进
- [ ] 组件样式改进
- [ ] TypeScript 定义更新
- [ ] 包体积优化
- [ ] 性能优化
- [ ] 重构
- [ ] 代码风格优化
- [ ] 测试用例
@@ -48,7 +51,7 @@
### ☑️ 请求合并前的自查清单
⚠️ 请自检并全部**勾选全部选项**。⚠️
⚠️ 请自检并全部**勾选全部选项**。⚠️
- [ ] 文档已补充或无须补充
- [ ] 代码演示已提供或无须提供

17
.github/workflows/gitleaks.yml vendored Normal file
View File

@@ -0,0 +1,17 @@
name: gitleaks
on: [push,pull_request]
jobs:
gitleaks:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: '1'
- name: wget
uses: wei/wget@v1
with:
args: -O .gitleaks.toml https://raw.githubusercontent.com/ycjcl868/gitleaks/master/.gitleaks.toml
- name: gitleaks-action
uses: zricethezav/gitleaks-action@master

View File

@@ -1,19 +1,11 @@
name: Lighthouse
on: push
name: CI
on: [push]
jobs:
lighthouse:
lighthouseci:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Audit URLs using Lighthouse
uses: treosh/lighthouse-ci-action@v2
with:
urls: |
https://ant.design
https://ant.design/docs/react/introduce-cn
https://ant.design/components/button-cn
- name: Save results
uses: actions/upload-artifact@v1
with:
name: lighthouse-results
path: '.lighthouseci' # This will save the Lighthouse results as .json files
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
- run: npm install && npm install -g @lhci/cli@0.4.x
- run: npm run site
- run: lhci autorun --upload.target=temporary-public-storage

View File

@@ -5,11 +5,10 @@ on: [push]
jobs:
to_gitee:
runs-on: ubuntu-latest
if: github.repository == 'ant-design/ant-design'
steps:
- uses: actions/checkout@v1
- uses: pixta-dev/repository-mirroring-action@v1
with:
target_repo_url:
git@gitee.com:ant-design/ant-design.git
ssh_private_key:
${{ secrets.GITEE_SSH_PRIVATE_KEY }}
- uses: actions/checkout@v1
- uses: pixta-dev/repository-mirroring-action@v1
with:
target_repo_url: git@gitee.com:ant-design/ant-design.git
ssh_private_key: ${{ secrets.GITEE_SSH_PRIVATE_KEY }}

View File

@@ -1,4 +1,4 @@
on:
on:
issue_comment:
types: [created]
name: Automatic Rebase
@@ -8,15 +8,10 @@ jobs:
if: github.event.issue.pull_request != '' && contains(github.event.comment.body, '/rebase')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Automatic Rebase
uses: cirrus-actions/rebase@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# https://github.community/t5/GitHub-Actions/Workflow-is-failing-if-no-job-can-be-ran-due-to-condition/m-p/38186#M3250
always_job:
name: Always run job
runs-on: ubuntu-latest
steps:
- name: Always run
run: echo "This job is used to prevent the workflow to fail when all other jobs are skipped."
- uses: actions/checkout@master
with:
fetch-depth: 0
- name: Automatic Rebase
uses: cirrus-actions/rebase@1.3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

9
.gitignore vendored
View File

@@ -25,6 +25,7 @@ nohup.out
_site
_data
dist
report.html
/lib
/es
elasticsearch-*
@@ -54,4 +55,10 @@ site/theme/template/Content/Article.jsx
site/theme/template/Content/EditButton.jsx
site/theme/template/Resources/*.jsx
site/theme/template/Resources/**/*.jsx
site/theme/template/NotFound.jsx
site/theme/template/NotFound.jsx
scripts/previewEditor/index.html
components/version/version.tsx
# Image snapshot diff
__diff_output__/
/jest-stare

24
.jest.image.js Normal file
View File

@@ -0,0 +1,24 @@
const { moduleNameMapper, transformIgnorePatterns } = require('./.jest');
// jest config for image snapshots
module.exports = {
setupFiles: ['./tests/setup.js'],
moduleFileExtensions: ['ts', 'tsx', 'js', 'md'],
moduleNameMapper,
transform: {
'\\.tsx?$': './node_modules/@ant-design/tools/lib/jest/codePreprocessor',
'\\.js$': './node_modules/@ant-design/tools/lib/jest/codePreprocessor',
'\\.md$': './node_modules/@ant-design/tools/lib/jest/demoPreprocessor',
'\\.(jpg|png|gif|svg)$': './node_modules/@ant-design/tools/lib/jest/imagePreprocessor',
},
testRegex: 'image\\.test\\.js$',
testEnvironment: 'node',
transformIgnorePatterns,
snapshotSerializers: ['enzyme-to-json/serializer'],
globals: {
'ts-jest': {
tsConfigFile: './tsconfig.test.json',
},
},
reporters: ['default', 'jest-stare'],
};

View File

@@ -1,12 +1,17 @@
const libDir = process.env.LIB_DIR;
const transformIgnorePatterns = [
'/dist/',
// Ignore modules without es dir.
// Update: @babel/runtime should also be transformed
'node_modules/(?!.*@babel)[^/]+?/(?!(es|node_modules)/)',
'node_modules/(?!.*@(babel|ant-design))[^/]+?/(?!(es|node_modules)/)',
];
function getTestRegex(libDir) {
if (libDir === 'dist') {
return 'demo\\.test\\.js$';
}
return '.*\\.test\\.(j|t)sx?$';
}
module.exports = {
verbose: true,
setupFiles: ['./tests/setup.js'],
@@ -21,14 +26,14 @@ module.exports = {
'^react-dnd-test-backend$': 'react-dnd-test-backend/dist/cjs',
'^react-dnd-test-utils$': 'react-dnd-test-utils/dist/cjs',
},
testPathIgnorePatterns: ['/node_modules/', 'dekko', 'node'],
testPathIgnorePatterns: ['/node_modules/', 'dekko', 'node', 'image.test.js'],
transform: {
'\\.tsx?$': './node_modules/@ant-design/tools/lib/jest/codePreprocessor',
'\\.js$': './node_modules/@ant-design/tools/lib/jest/codePreprocessor',
'\\.md$': './node_modules/@ant-design/tools/lib/jest/demoPreprocessor',
'\\.(jpg|png|gif|svg)$': './node_modules/@ant-design/tools/lib/jest/imagePreprocessor',
},
testRegex: `${libDir === 'dist' ? 'demo' : '.*'}\\.test\\.js$`,
testRegex: getTestRegex(process.env.LIB_DIR),
collectCoverageFrom: [
'components/**/*.{ts,tsx}',
'!components/*/style/index.tsx',

View File

@@ -12,13 +12,8 @@ module.exports = {
'\\.md$': './node_modules/@ant-design/tools/lib/jest/demoPreprocessor',
'\\.(jpg|png|gif|svg)$': './node_modules/@ant-design/tools/lib/jest/imagePreprocessor',
},
testRegex: 'demo\\.test\\.js$',
testRegex: 'demo\\.test\\.(j|t)s$',
testEnvironment: 'node',
transformIgnorePatterns,
snapshotSerializers: ['enzyme-to-json/serializer'],
globals: {
'ts-jest': {
tsConfigFile: './tsconfig.test.json',
},
},
};

View File

@@ -1,2 +1 @@
~*
dist/report.html

9
.remarkrc.js Normal file
View File

@@ -0,0 +1,9 @@
const config = {
plugins: [
'remark-preset-lint-recommended',
['remark-lint-list-item-indent', 'space'],
['remark-lint-no-literal-urls', false],
],
};
module.exports = config;

View File

@@ -1010,7 +1010,6 @@ zytjs <yitongzhao@163.com>
郭延豪(708674) <gyh9457@163.com>
愚指导-TZ <yutingzhao1991@sina.com>
杨小事er <Uiryzd@163.com>
杨小事er <uiryzd@163.com>
超能刚哥 <margox@foxmail.com>
马金花儿 <o.o@mug.dog>
रोहन मल्होत्रा <rohan.malhotra@adwyze.com>

View File

@@ -15,8 +15,327 @@ timeline: true
---
## 4.3.0
`2020-05-31`
- 🔥 Rewrite Tabs for better user experience. [#24552](https://github.com/ant-design/ant-design/pull/24552)
- Upload
- 🐞 Fix delete icon cannot be navigate via keyboard. [#24604](https://github.com/ant-design/ant-design/pull/24604) [@morenyang](https://github.com/morenyang)
- 🆕 `data` could return `Promise` now. [#24546](https://github.com/ant-design/ant-design/pull/24546) [@Kermit-Xuan](https://github.com/Kermit-Xuan)
- 🐞 Fix progress bar override by accident. [#24339](https://github.com/ant-design/ant-design/pull/24339) [@morenyang](https://github.com/morenyang)
- 🆕 Support `progress` to customize progress bar. [#24319](https://github.com/ant-design/ant-design/pull/24319) [@morenyang](https://github.com/morenyang)
- 🐞 Fix Steps `subtitle` transition style. [#24593](https://github.com/ant-design/ant-design/pull/24593)
- Table
- 🆕 Table support `rowSelection.hideSelectAll` to hide selectAll checkbox. [#24592](https://github.com/ant-design/ant-design/pull/24592) [@Kermit-Xuan](https://github.com/Kermit-Xuan)
- 🆕 `ellipsis` support `showTitle` to config `title` show. [#24056](https://github.com/ant-design/ant-design/pull/24056) [@lijinke666](https://github.com/lijinke666)
- 🆕 Table `columns` support `shouldCellUpdate`. [#23872](https://github.com/ant-design/ant-design/pull/23872)
- 🐞 Fix List warning about`React does not recognize colStyle prop`. [#24568](https://github.com/ant-design/ant-design/pull/24568)
- 🐞 Fix Progress with `steps` don't update `percent` expectedly. [#24534](https://github.com/ant-design/ant-design/pull/24534) [@ChuckJonas](https://github.com/ChuckJonas)
- Input
- 🐞 Fix Input.Password still show `value` attribute in DOM after blur it. [#24535](https://github.com/ant-design/ant-design/pull/24535)
- 🆕 Input.Passowrd support custom icon. [#23792](https://github.com/ant-design/ant-design/pull/23792) [@偏右](https://github.com/偏右)
- 💄 Add less variable `@input-disabled-color`. [#23775](https://github.com/ant-design/ant-design/pull/23775) [@alwaysloseall](https://github.com/alwaysloseall)
- Form
- 🐞 Fix Form.Item inline label collapsed when in narrow space. [#24531](https://github.com/ant-design/ant-design/pull/24531)
- 🐞 Fix Form.List field status sync logic and add a nest fields demo. [#24009](https://github.com/ant-design/ant-design/pull/24009)
- 🆕 Form support `validateTrigger` to config children fields validate trigger. [#23972](https://github.com/ant-design/ant-design/pull/23972)
- 🐞 Fix Cascader expand icon color when disabled. [#24521](https://github.com/ant-design/ant-design/pull/24521)
- Menu
- 🆕 Adjust text shows the first character when Menu is collapsed in `inline` mode. [#24330](https://github.com/ant-design/ant-design/pull/24330)
- 🆕 Menu.Item support `danger` prop. [#23785](https://github.com/ant-design/ant-design/pull/23785)
- 🐞 Fix Breadcrumb icon margin missing when using links. [#24490](https://github.com/ant-design/ant-design/pull/24490) [@EscapeB](https://github.com/EscapeB)
- Avatar
- 🐞 Fix Avatar `onError` trigger twice. [#24506](https://github.com/ant-design/ant-design/pull/24506) [@sanonz](https://github.com/sanonz)
- 🆕 Avatar support `gap` to set the unit distance between left and right sides. [#24357](https://github.com/ant-design/ant-design/pull/24357)
- 🐞 Fix Alert close icon `padding` style. [#24471](https://github.com/ant-design/ant-design/pull/24471)
- 🐞 Fix Tree `@tree-directory-selected-bg` don't work. [#24468](https://github.com/ant-design/ant-design/pull/24468) [@morenyang](https://github.com/morenyang)
- Typography
- 🆕 Support Typography.Paragraph custom expand style. [#24385](https://github.com/ant-design/ant-design/pull/24385) [@fireairforce](https://github.com/fireairforce)
- 🐞 Fix Typography `title` prop support. [#24440](https://github.com/ant-design/ant-design/pull/24440) [@Kermit-Xuan](https://github.com/Kermit-Xuan)
- 🆕 Typography.Text support `keyboard` style. [#24195](https://github.com/ant-design/ant-design/pull/24195)
- 🆕 Add Link component. [#24019](https://github.com/ant-design/ant-design/pull/24019)
- 🆕 Tooltip support `color` to config background color. [#23155](https://github.com/ant-design/ant-design/pull/23155)
- 🆕 Popconfirm can be closed by pressing `ESC` now. [#24420](https://github.com/ant-design/ant-design/pull/24420)
- 🆕 Tooltip `destroyTooltipOnHide` support `keepParent` config. [#24362](https://github.com/ant-design/ant-design/pull/24362) [@Kermit-Xuan](https://github.com/Kermit-Xuan)
- Button
- 💄 Improve button background variable usage. [#24372](https://github.com/ant-design/ant-design/pull/24372) [@morenyang](https://github.com/morenyang)
- 🆕 New `type="text"` Button. [#22552](https://github.com/ant-design/ant-design/pull/22552)
- 🆕 Notification support to config `prefixCls`. [#24295](https://github.com/ant-design/ant-design/pull/24295) [@tdida](https://github.com/tdida)
- 🆕 RangePicker `dateRender` support additional argument to detect is `start` or `end` field. [#24278](https://github.com/ant-design/ant-design/pull/24278)
- 🆕 Skeleton add `round` prop to enable paragraph and title show radius. [#24137](https://github.com/ant-design/ant-design/pull/24137) [@xilihuasi](https://github.com/xilihuasi)
- 🆕 Transfer support `oneWay` and `pagination`. [#24041](https://github.com/ant-design/ant-design/pull/24041)
- 💄 Descriptions add less variables `@descriptions-item-trailing-colon` and etc. [#24032](https://github.com/ant-design/ant-design/pull/24032) [@hengkx](https://github.com/hengkx)
- 🆕 Message Support customize `className` and `style`. [#24024](https://github.com/ant-design/ant-design/pull/24024) [@Kermit-Xuan](https://github.com/Kermit-Xuan)
- 🆕 ConfigProvider support `virtual` and `dropdownMatchSelectWidth`. [#23841](https://github.com/ant-design/ant-design/pull/23841) [@hengkx](https://github.com/hengkx)
- 🛠 Optimize dependencies to reduce overall package size. [#24584](https://github.com/ant-design/ant-design/pull/24584)
- 🐞 Fix `@ant-prefix` don't work in some styles. [#24459](https://github.com/ant-design/ant-design/pull/24459) [@morenyang](https://github.com/morenyang)
- 🌐 Localization
- 🇫🇮 Improve Typography `fi_FI` locale. [#24591](https://github.com/ant-design/ant-design/pull/24591) [@sagge](https://github.com/sagge)
- 🇧🇷 Improve `pt_BR` locale. [#24518](https://github.com/ant-design/ant-design/pull/24518) [@arturpfb](https://github.com/arturpfb)
- 🇬🇧 Improve Form `en_GB` locale. [#24404](https://github.com/ant-design/ant-design/pull/24404) [@morenyang](https://github.com/morenyang)
- RTL
- 💄 Optimize Tree checkbox style in RTL. [#24563](https://github.com/ant-design/ant-design/pull/24563)
- 💄 Optimize Calendar notice content text style in RTL. [#24528](https://github.com/ant-design/ant-design/pull/24528)
- 💄 Optimize Table filter dropdown style in RTL. [#24529](https://github.com/ant-design/ant-design/pull/24529)
- 💄 Fix Cascader dropdown style in RTL. [#24520](https://github.com/ant-design/ant-design/pull/24520)
- TypeScript
- Form export RuleObject and RuleRender types. [#24541](https://github.com/ant-design/ant-design/pull/24541) [@sorteam](https://github.com/sorteam)
## 4.2.5
`2020-05-25`
- 🐞 Fix Table selection arrow out of column when `size` is `small/middle`. [#24394](https://github.com/ant-design/ant-design/pull/24394)
- 🐞 Fix Input.TextArea clear icon disappears in Input.Group when hover it. [#24360](https://github.com/ant-design/ant-design/pull/24360) [@Mr-jiangzhiguo](https://github.com/Mr-jiangzhiguo)
- 🐞 Fixed an issue where the `RowSelection.onChange` will still be cached when the Table removes entries in `dataSource`. [#24338](https://github.com/ant-design/ant-design/pull/24338)
- 🐞 Adjust `useNotification` api instance to be same instance for each render. [#24337](https://github.com/ant-design/ant-design/pull/24337)
- 🐞 Fix Button `loading` transition animation missing and Modal `confirmLoading` not being reset. [#24328](https://github.com/ant-design/ant-design/pull/24328)
- 🐞 Fix Drawer cover background elements when it is not visible. [#24290](https://github.com/ant-design/ant-design/pull/24290)
- 🐞 Fix Cascader/Select/Table/TreeSelect text color when data empty. [#24279](https://github.com/ant-design/ant-design/pull/24279)
- 💄 Fix InputNumber operation button arrow is not centered. [#24266](https://github.com/ant-design/ant-design/pull/24266)
- 🐞 Fix Table with empty array `filteredValue` still highlight the filtered icon. [#24263](https://github.com/ant-design/ant-design/pull/24263)
- 🐞 Fix Cascader not support `number[]` value. [#24247](https://github.com/ant-design/ant-design/pull/24247)
- ⌨️ Fix Switch `autoFocus` trigger when `disabled` removed. Adjust style to avoid switch shaking. Remove blur logic when `onMouseUp` to improve acessibility. [#24254](https://github.com/ant-design/ant-design/pull/24254)
- 💄 Add Menu default `text-align` style. [#24253](https://github.com/ant-design/ant-design/pull/24253)
- 🛠 Refactor List code. [#24280](https://github.com/ant-design/ant-design/pull/24280) [@hengkx](https://github.com/hengkx)
- 🛠 Modify the Alert with hooks to support strict mode. [#24236](https://github.com/ant-design/ant-design/pull/24236) [@hengkx](https://github.com/hengkx)
- 🐞Fix Card perfermance bug when use with `react-split`. [#24425](https://github.com/ant-design/ant-design/pull/24425)
- TypeScript
- 🛠Cascader ts definition update. [#24393](https://github.com/ant-design/ant-design/pull/24393) [@zhangyu1818](https://github.com/zhangyu1818)
- 🐞 Fix TS error of `Could not find a declaration rc-upload`. [#24325](https://github.com/ant-design/ant-design/pull/24325)
- 🛠 Add children type to BackTop. [#24235](https://github.com/ant-design/ant-design/pull/24235)
## 4.2.4
`2020-05-18`
- 🐞 Revert Switch patch to fix handle position style issue with `unCheckedChildren`. [#24242](https://github.com/ant-design/ant-design/pull/24242)
- 💄 Adjust Upload icon default color to red in error status. [#24160](https://github.com/ant-design/ant-design/pull/24160)
- 💄 Adjust Dropdown arrow position a little higher. [#24215](https://github.com/ant-design/ant-design/pull/24215)
- 🌐 Form `defaultValidateMessages` support `ru_RU`. [#24219](https://github.com/ant-design/ant-design/pull/24219) [@aivinog1](https://github.com/aivinog1)
## 4.2.3
`2020-05-16`
- 🐞 Refactor `rc-progress` to resolve `h3g is not defined` error in `<script src="antd.min.js" />`. [#24127](https://github.com/ant-design/ant-design/pull/24127)
- 📖 Rewrote [Use in create-react-app](https://ant.design/docs/react/use-with-create-react-app). [#24184](https://github.com/ant-design/ant-design/pull/24184)
- Drawer
- 🐞 Fix Drawer `getContainer={false}` height overflow issue. [#24082](https://github.com/ant-design/ant-design/pull/24082)
- 🐞 Fix Drawer `mask={false}` animation not working. [#24082](https://github.com/ant-design/ant-design/pull/24082)
- BackTop
- 🛠 Refactor BackTop with hooks. [#23575](https://github.com/ant-design/ant-design/pull/23575)
- 🐞 Fix BackTop not working in iframe of Chrome. [#24194](https://github.com/ant-design/ant-design/pull/24194)
- DatePicker
- 🐞 Fix DatePicker with `showToday` not working with `disabledDate`. [#24190](https://github.com/ant-design/ant-design/pull/24190)
- 🐞 Fix DatePicker `renderExtraFooter` with long content exceed content width. [#24145](https://github.com/ant-design/ant-design/pull/24145)
- Button
- 🐞 Fix small Button align issue when customize theme. [#24097](https://github.com/ant-design/ant-design/pull/24097)
- 🐞 Fix Button children not working with Tooltip. [#24095](https://github.com/ant-design/ant-design/pull/24095)
- 🛠 Refactor Tooltip with hooks. [#23699](https://github.com/ant-design/ant-design/pull/23699)
- 🐞 Avoid `disabled` Upload.Dragger being triggered by clicking Form `label`. [#24202](https://github.com/ant-design/ant-design/pull/24202)
- 🐞 Fix Select selected option not interactive (such as `title` not working). [#24170](https://github.com/ant-design/ant-design/pull/24170)
- 🐞 Fix Switch shake in Safari and iOS Chrome. [#24122](https://github.com/ant-design/ant-design/pull/24122) [@lexlexa](https://github.com/lexlexa)
- 🐞 Carousel upgrade to `react-slick@0.26.1` to resolve some problems. [#24067](https://github.com/ant-design/ant-design/pull/24067)
- 🐞 Cascader will display `defaultValue` instead of empty string when no matched options. [#24058](https://github.com/ant-design/ant-design/pull/24058) [@Kermit-Xuan](https://github.com/Kermit-Xuan)
- 🌎 Improve `zh_TW` localisations. [#24065](https://github.com/ant-design/ant-design/pull/24065) [@wx1322](https://github.com/wx1322)
- 🐞 Fix Table `onChange` pagination type. [#24114](https://github.com/ant-design/ant-design/pull/24114) [@sorteam](https://github.com/sorteam)
- 💄 Add less variable `@card-head-extra-color`. [#24189](https://github.com/ant-design/ant-design/pull/24189)
- 💄 Adjust Pagination simple mode background to transparent. [#24152](https://github.com/ant-design/ant-design/pull/24152)
- 💄 Fix dark Menu link color. [#24110](https://github.com/ant-design/ant-design/pull/24110)
- RTL
- 💄 Fix Dropdown.Button default menu placement in RTL. [#24150](https://github.com/ant-design/ant-design/pull/24150)
- 💄 Fix Menu `border` in RTL. [#24101](https://github.com/ant-design/ant-design/pull/24101)
- 💄 Optimize Select multiple tag style in RTL. [#24112](https://github.com/ant-design/ant-design/pull/24112)
- 💄 Optimize Typography `expand` style in RTL. [#24084](https://github.com/ant-design/ant-design/pull/24084)
- 💄 Optimize Pagination slash style in RTL. [#24154](https://github.com/ant-design/ant-design/pull/24154)
## 4.2.2
`2020-05-11`
- 🐞 Fix `npm run version` install error. [#24059](https://github.com/ant-design/ant-design/pull/24059)
- 🐞 Fix Menu `@menu-item-font-size` not working. [#24052](https://github.com/ant-design/ant-design/pull/24052)
- 💄 Add `@modal-close-color` less variable. [#24053](https://github.com/ant-design/ant-design/pull/24053)
## 4.2.1
`2020-05-11`
- Form
- 🐞 Fix Form.Item get React warning for `getValueProps`. [#23875](https://github.com/ant-design/ant-design/pull/23875)
- 🐞 Fix Form.Item `help` style issue when `validateStatus` is not `error`. [#23945](https://github.com/ant-design/ant-design/pull/23945)
- Table
- 🐞 Fix selection column width issue when fix header. [#23806](https://github.com/ant-design/ant-design/pull/23806)
- 💄 Adjust selection column css selector priority to enable customize width. [#23914](https://github.com/ant-design/ant-design/pull/23914)
- DatePicker
- 🐞 Fix miss placeholder when `placeholder` is `undefined`. [#23818](https://github.com/ant-design/ant-design/pull/23818)
- 🐞 Fix clear icon color style. [#23811](https://github.com/ant-design/ant-design/pull/23811)
- Switch
- 🐞 Fix loading style for the dark theme. [#23766](https://github.com/ant-design/ant-design/pull/23766) [@vsn4ik](https://github.com/vsn4ik)
- 🐞 Fix `unCheckedChildren` not showing. [#23791](https://github.com/ant-design/ant-design/pull/23791)
- 🐞 Fix Upload error message location to scroll in the float layer. [#24001](https://github.com/ant-design/ant-design/pull/24001) [@mraiguo](https://github.com/mraiguo)
- 💄 Tweak Comment render unnecessary div style when `avatar` is empty. [#23994](https://github.com/ant-design/ant-design/pull/23994) [@Xuhao](https://github.com/Xuhao)
- 🐞 Fix Select `focus` border style in Input.Group. [#23985](https://github.com/ant-design/ant-design/pull/23985)
- 🐞 Fix Steps `subTitle` showing `[object Object]` title. [#23989](https://github.com/ant-design/ant-design/pull/23989)
- 💄 Tweak Select close icon position. [#23963](https://github.com/ant-design/ant-design/pull/23963)
- 🐞 Fix Drawer `width="50%"` hidden problem when no mask. [#23925](https://github.com/ant-design/ant-design/pull/23925)
- 🐞 Fix Textarea with `allowClear` has error height style. [#23835](https://github.com/ant-design/ant-design/pull/23835)
- 💄 Adjust Modal.xxx function async to avoid block React events. [#23826](https://github.com/ant-design/ant-design/pull/23826)
- 🐞 Fix Menu with controlled `openKeys` abnormal behavior when `inlineCollapsed` changed. [#23822](https://github.com/ant-design/ant-design/pull/23822)
- 🐞 Fix Button `loading` animation. [#23783](https://github.com/ant-design/ant-design/pull/23783)
- 🐞 Fix Slider `marks` selected problem when dragging. [#23773](https://github.com/ant-design/ant-design/pull/23773)
- 🛠 Timeline refactors with React Hooks. [#23631](https://github.com/ant-design/ant-design/pull/23631) [@hengkx](https://github.com/hengkx)
- 🌎 Localization
- 🇮🇷 Add Farsi `fa_IR` default locale template localisations. [#23926](https://github.com/ant-design/ant-design/pull/23926) [@NarimanMov](https://github.com/NarimanMov)
- 🇺🇸 Add default `en` default locale template localisations for Form. [#23859](https://github.com/ant-design/ant-design/pull/23859) [@mjfwebb](https://github.com/mjfwebb)
- 📦 Reduce bundle size
- 🗑 Reduce bundle size via removing `react-lifecycles-compat`. [#23969](https://github.com/ant-design/ant-design/pull/23969)
- 🛠 Reduce bundle size via excluding `package.json` from source code. [#23957](https://github.com/ant-design/ant-design/pull/23957)
- 🛠 Upgrade `rc-animate` to 3.x to reduce bundle size. [#23937](https://github.com/ant-design/ant-design/pull/23937)
- RTL
- 🐞 Fix Input clear icon style in RTL. [#23999](https://github.com/ant-design/ant-design/pull/23999)
- 🐞 Fix DatePicker panel style in RTL. [#24028](https://github.com/ant-design/ant-design/pull/24028) [@xrkffgg](https://github.com/xrkffgg)
- 💄 Optimize DatePicker active bar style in `RTL`. [#23981](https://github.com/ant-design/ant-design/pull/23981)
- 🐞 Fix Transfer search padding style in `RTL`. [#23962](https://github.com/ant-design/ant-design/pull/23962)
- 💄 Optimize Layout style of RTL. [#23921](https://github.com/ant-design/ant-design/pull/23921)
- 💄 Optimize Button `loading` style in RT. [#23776](https://github.com/ant-design/ant-design/pull/23776)
- 💄 Optimize Input.Search style in RTL. [#23797](https://github.com/ant-design/ant-design/pull/23797)
- TypeScript
- 🐞 Fix InputNumber `onChange` type. [#23871](https://github.com/ant-design/ant-design/pull/23871) [@jjhbw](https://github.com/jjhbw)
## 4.2.0
`2020-04-29`
- 🆕 List `grid` support all column count like 5. [#23630](https://github.com/ant-design/ant-design/pull/23630)
- 🆕 Divider add `plain` prop which allows a non-heading style divider text. [#23405](https://github.com/ant-design/ant-design/pull/23405)
- 🆕 Typography `ellipsis` support `onEllipsis` event handler. [#23414](https://github.com/ant-design/ant-design/pull/23414)
- 🆕 Space support `align` prop. [#23306](https://github.com/ant-design/ant-design/pull/23306)
- 🆕 Upload support `isImageUrl` to force trade file as image. [#23248](https://github.com/ant-design/ant-design/pull/23248) [@onjuju](https://github.com/onjuju)
- 🆕 Form.Item support `initialValue` and `getValueProps` props. [#22993](https://github.com/ant-design/ant-design/pull/22993)
- ConfigProvider
- 🆕 ConfigProvider support `getTargetContainer` to config Affix `target` props. [#23751](https://github.com/ant-design/ant-design/pull/23751)
- 🆕 ConfigProvider support `input` prop to config Input `autoComplete`. [#23455](https://github.com/ant-design/ant-design/pull/23455)
- 🐞 Fix ConfigProvider `getPopupContainer` not working on DatePicker and Slider. [#23594](https://github.com/ant-design/ant-design/pull/23594) [@hengkx](https://github.com/hengkx)
- Table
- 🆕 Table `summary` support fixed columns. [#23647](https://github.com/ant-design/ant-design/pull/23647)
- 🆕 Table support responsive columns. [#23298](https://github.com/ant-design/ant-design/pull/23298) [@vbudovski](https://github.com/vbudovski)
- 🐞 Fix Table pagination default position in RTL. [#23747](https://github.com/ant-design/ant-design/pull/23747)
- 🐞 Fix Table crash when `pageSize` is `undefined`. [#23724](https://github.com/ant-design/ant-design/pull/23724)
- 🐞 fix Table nested margin when size is `small` or `middle`. [#23602](https://github.com/ant-design/ant-design/pull/23602) [@hengkx](https://github.com/hengkx)
- 🐞 Fix RangePicker `ranges` tag color to primary color. [#23705](https://github.com/ant-design/ant-design/pull/23705)
- 🐞 Fix Transfer with custom empty style issue. [#23694](https://github.com/ant-design/ant-design/pull/23694) [@hengkx](https://github.com/hengkx)
- Input
- 🐞 Fix Password caret position. [#23633](https://github.com/ant-design/ant-design/pull/23633) [@huntdream](https://github.com/huntdream)
- 💄 Adjust Input.Search icon style. [#23406](https://github.com/ant-design/ant-design/pull/23406)
- Button
- 🐞 Fix Button align problem of icon only. [#23671](https://github.com/ant-design/ant-design/pull/23671)
- 🐞 Fix Button of icon only wrong `loading` style. [#23614](https://github.com/ant-design/ant-design/pull/23614)
- 🐞 fix Button cannot be directly called by `react-dnd`. [#23571](https://github.com/ant-design/ant-design/pull/23571) [@hengkx](https://github.com/hengkx)
- Menu
- 🆕 Menu Item and SubMenu support `icon` prop. [#23629](https://github.com/ant-design/ant-design/pull/23629)
- 🐞 Fix Menu duplicated shadow style. [#23664](https://github.com/ant-design/ant-design/pull/23664)
- 🐞 Fix Tag cannot be directly called by `react-dnd`. [#23632](https://github.com/ant-design/ant-design/pull/23632) [@hengkx](https://github.com/hengkx)
- Anchor
- 🐞 Fix Anchor Link with multiple `#` can not jump correctly. [#23595](https://github.com/ant-design/ant-design/pull/23595) [@wuzekang](https://github.com/wuzekang)
- 🐞 Fix Input with `suffix` align problem. [#23606](https://github.com/ant-design/ant-design/pull/23606)
- 💄 Select arrow won't rotate when open. [#23468](https://github.com/ant-design/ant-design/pull/23468)
- 💄 Rate support `direction`. [#23321](https://github.com/ant-design/ant-design/pull/23321)
- 💄 Adjust font-size in compact mode. [#23135](https://github.com/ant-design/ant-design/pull/23135)
- RTL
- 💄 Optimize Result button style in RTL. [#23733](https://github.com/ant-design/ant-design/pull/23733)
- 💄 Add Divider RTL support. [#23734](https://github.com/ant-design/ant-design/pull/23734)
- 💄 Fix Alert style in RTL when no-icon. [#23714](https://github.com/ant-design/ant-design/pull/23714)
- 💄 Optimize Table expand animation and pagination style in RTL. [#23706](https://github.com/ant-design/ant-design/pull/23706)
- 💄 Fix Table filter dropdown position in RTL. [#23695](https://github.com/ant-design/ant-design/pull/23695)
- 💄 Fix Table rowSelect icon style in RTL. [#23690](https://github.com/ant-design/ant-design/pull/23690)
- 💄 Optimize List style in RTL. [#23676](https://github.com/ant-design/ant-design/pull/23676)
- 💄 Add Calendar RTL. [#23394](https://github.com/ant-design/ant-design/pull/23394)
- 💄 Optimize Input.Search style in RTL. [#23424](https://github.com/ant-design/ant-design/pull/23424)
- 💄 Add Notification RTL config. [#23185](https://github.com/ant-design/ant-design/pull/23185)
- TypeScript
- 🐞 Fix PageHeader `tag` definition. [#23712](https://github.com/ant-design/ant-design/pull/23712) [@hengkx](https://github.com/hengkx)
- 🗑 Remove Button deprecated `type="danger"` TypeScript definition and warn it. [#23709](https://github.com/ant-design/ant-design/pull/23709)
- 🐞 Fix Table pagination `position` definition. [#23681](https://github.com/ant-design/ant-design/pull/23681) [@hengkx](https://github.com/hengkx)
## 4.1.5
`2020-04-25`
- 🐞 Fix Button.Group align style. [#23590](https://github.com/ant-design/ant-design/pull/23590)
- 🐞 Fix Select cannot trigger open by clicking arrow icon. [#23448](https://github.com/ant-design/ant-design/pull/23448)
- 🐞 Fix Form fields shake when `@form-item-margin-bottom` is customize and switching the validing info. [#23436](https://github.com/ant-design/ant-design/pull/23436) [@yoyo837](https://github.com/yoyo837)
- 🐞 Fix the first Divider render differently with others. [#23438](https://github.com/ant-design/ant-design/pull/23438)
- 🐞 Fix nest ConfigProvider missing `prefixCls` value. [#23423](https://github.com/ant-design/ant-design/pull/23423)
- 🐞 Fix Carousel tabbed Radio/Checkbox to non-active slide. [#23380](https://github.com/ant-design/ant-design/pull/23380)
- 🐞 Fix Tree with virtual scroll frozen by quick `loadData`. [#23581](https://github.com/ant-design/ant-design/pull/23581)
- 🐞 Fix Steps style in IE11 when direction is vertical. [#23561](https://github.com/ant-design/ant-design/pull/23561) [@AdrianoRuberto](https://github.com/AdrianoRuberto)
- 🐞 Fix Input.Search height affected by `suffix` and `react key` warning. [#23527](https://github.com/ant-design/ant-design/pull/23527)
- 🐞 Fix Menu behavior when hover on submenu gap. [#23511](https://github.com/ant-design/ant-design/pull/23511)
- 🐞 Fix Tree custom icon missing when node is loading data. [#23494](https://github.com/ant-design/ant-design/pull/23494)
- RTL
- 🐞 Fix Alert RTL style when set both `showIcon` and `closable`. [#23526](https://github.com/ant-design/ant-design/pull/23526)
- 🐞 Fix Button RTL style when loading. [#23399](https://github.com/ant-design/ant-design/pull/23399)
- 🐞 Fix Collapse that icon position is incorrect in RTL. [#23445](https://github.com/ant-design/ant-design/pull/23445)
- 🐞 Fix Select group label style in RTL. [#23404](https://github.com/ant-design/ant-design/pull/23404)
- 🐞 Fix Statistic RTL style. [#23397](https://github.com/ant-design/ant-design/pull/23397)
- TypeScript
- 🐞 Fix type definition of `selections` for Table. [#23462](https://github.com/ant-design/ant-design/pull/23462) [@xiaoxintang](https://github.com/xiaoxintang)
## 4.1.4
`2020-04-18`
- 🐞 Fix dark theme and compact theme not working. [#23243](https://github.com/ant-design/ant-design/pull/23243)
- 🐞 Fix Modal.info executed only once when has argument. [#23360](https://github.com/ant-design/ant-design/pull/23360)
- 🐞 Fix Dropdown submenu background missing. [#23296](https://github.com/ant-design/ant-design/pull/23296)
- 💄 Optimize PageHeader responsive behavior. [#23277](https://github.com/ant-design/ant-design/pull/23277)
- 🐞 Fix TreeSelect render blank in compact mode. [#23231](https://github.com/ant-design/ant-design/pull/23231)
- 🛎 Fix Checkbox and Switch console warning typo (validate -> a valid). [#23240](https://github.com/ant-design/ant-design/pull/23240) [@evancharlton](https://github.com/evancharlton)
- 🐞 Fix Table `rowSelection` params issue when `childrenColumnName` configured. [#23205](https://github.com/ant-design/ant-design/pull/23205)
- Input
- 🐞 Fix Input `type="color"` height issue. [#23351](https://github.com/ant-design/ant-design/pull/23351)
- 🐞 Fix Input width shaking when trigger clear icon. [#23259](https://github.com/ant-design/ant-design/pull/23259)
- 🐞 Fix Input.Search `size` not affected by ConfigProvider `componentSize`. [#23331](https://github.com/ant-design/ant-design/pull/23331)
- Select
- 🐞 Fix multiple Select show remove icon when `disabled`. [#23295](https://github.com/ant-design/ant-design/pull/23295)
- 🐞 Fix Select custom `suffixIcon` cannot be access. [#23274](https://github.com/ant-design/ant-design/pull/23274)
- 🐞 Fix Select search input caret missing in Collapse. [#23250](https://github.com/ant-design/ant-design/pull/23250)
- Globalization
- 🇨🇳 Form validation messages support internalization and add zh_CN locale. [#23165](https://github.com/ant-design/ant-design/pull/23165) [@hengkx](https://github.com/hengkx)
- 🌐 Add missing translations in he_IL. [#23302](https://github.com/ant-design/ant-design/pull/23302) [@MishaKav](https://github.com/MishaKav)
- 🌐 Add missing translations in ru_RU. [#23303](https://github.com/ant-design/ant-design/pull/23303) [@MishaKav](https://github.com/MishaKav)
- TypeScript
- 🔷 Form.Item type upgrade. [#22962](https://github.com/ant-design/ant-design/pull/22962) [@fa93hws](https://github.com/fa93hws)
- 🔷 Tree type upgrade. [#23348](https://github.com/ant-design/ant-design/pull/23348) [@yoyo837](https://github.com/yoyo837)
- 🐞 Pass `popupClassName` prop to `rc-picker`. [#23214](https://github.com/ant-design/ant-design/pull/23214) [@tanmoyopenroot](https://github.com/tanmoyopenroot)
- RTL
- 💄 Fix Select RTL style. [#23235](https://github.com/ant-design/ant-design/pull/23235)
- 💄 Fix Menu RTL style. [#23319](https://github.com/ant-design/ant-design/pull/23319)
## 4.1.3
`2020-04-13`
- 💄 Adjust Form.Item `label` height style in vertical layout. [#23192](https://github.com/ant-design/ant-design/pull/23192)
- 🐞 Fix `Variable is undefined` when importing dark or compact theme and provide a `getThemeVariables` methold for getting theme variables easily. [#23171](https://github.com/ant-design/ant-design/pull/23171)
- 🐞 Fix PageHeader style breaks when `title` is too long and improve it's responsive design. [#23133](https://github.com/ant-design/ant-design/pull/23133)
- Tabs
- 🐞 Fix Tabs `@tabs-card-height` less variable not working. [#23168](https://github.com/ant-design/ant-design/pull/23168)
- 🐞 Fix Tabs cannot be displayed in Safari 13. [#23151](https://github.com/ant-design/ant-design/pull/23151) [@imhxc](https://github.com/imhxc)
- Table
- 🐞 Fix Table fixed columns cannot pin in Safari 12. [#23161](https://github.com/ant-design/ant-design/pull/23161)
- 🐞 Fix Table `summary` padding in small size. [#23140](https://github.com/ant-design/ant-design/pull/23140) [@someyoungideas](https://github.com/someyoungideas)
- 🐞 Fix Select align style with different size. [#23160](https://github.com/ant-design/ant-design/pull/23160)
- 🐞 Fix RangePicker under Input.Group style issue. [#23149](https://github.com/ant-design/ant-design/pull/23149)
- 🐞 Fix Pagination missing TypeScript definition of `showTitle`. [#23144](https://github.com/ant-design/ant-design/pull/23144) [@DongchengWang](https://github.com/DongchengWang)
## 4.1.2
`2020-04-10`
- Menu
- 🐞 Fix Menu SubMenu background in dark mode. [#22981](https://github.com/ant-design/ant-design/pull/22981) [@AshoneA](https://github.com/AshoneA)
- 🐞 Fix long SubMenu title being overlayed by arrow icon. [#23028](https://github.com/ant-design/ant-design/pull/23028) [@wwyx778](https://github.com/wwyx778)
@@ -52,6 +371,8 @@ timeline: true
## 4.1.1
`2020-04-05`
- 🐞 Fix Tabs panel focus outline style. [#22752](https://github.com/ant-design/ant-design/pull/22752) [@MrHeer](https://github.com/MrHeer)
- 🐞 Fix Input affix with popup element can not get click focus. [#22887](https://github.com/ant-design/ant-design/pull/22887)
- Table

View File

@@ -15,8 +15,327 @@ timeline: true
---
## 4.3.0
`2020-05-31`
- 🔥 重做 Tabs 以提升多标签在不同环境下的用户体验。[#24552](https://github.com/ant-design/ant-design/pull/24552)
- Upload
- 🐞 解决删除图标键盘无法导航操作的问题。[#24604](https://github.com/ant-design/ant-design/pull/24604) [@morenyang](https://github.com/morenyang)
- 🆕 `data` 属性支持返回 `Promise`。[#24546](https://github.com/ant-design/ant-design/pull/24546) [@Kermit-Xuan](https://github.com/Kermit-Xuan)
- 🐞 修复的进度条类型会被意外覆盖的问题。[#24339](https://github.com/ant-design/ant-design/pull/24339) [@morenyang](https://github.com/morenyang)
- 🆕 添加 `progress` 属性以支持自定义进度条。[#24319](https://github.com/ant-design/ant-design/pull/24319) [@morenyang](https://github.com/morenyang)
- 🐞 修复 Steps `subtitle` hover 渐变过渡。[#24593](https://github.com/ant-design/ant-design/pull/24593)
- Table
- 🆕 Table 新增 `rowSelection.hideSelectAll` 用于隐藏全选框。[#24592](https://github.com/ant-design/ant-design/pull/24592) [@Kermit-Xuan](https://github.com/Kermit-Xuan)
- 🆕 `ellipsis` 支持 `showTitle` 以关闭自动设置 `title` 属性。[#24056](https://github.com/ant-design/ant-design/pull/24056) [@lijinke666](https://github.com/lijinke666)
- 🆕 Table `columns` 支持 `shouldCellUpdate` 属性。[#23872](https://github.com/ant-design/ant-design/pull/23872)
- 🐞 修复 List 报 `React does not recognize colStyle prop` 的问题。[#24568](https://github.com/ant-design/ant-design/pull/24568)
- 🐞 修复步骤 Progress `percent` 样式未正确更新的问题。[#24534](https://github.com/ant-design/ant-design/pull/24534) [@ChuckJonas](https://github.com/ChuckJonas)
- Input
- 🐞 修复 Input.Password 一个明文显示 `value` 的问题。[#24535](https://github.com/ant-design/ant-design/pull/24535)
- 🆕 Input.Passowrd 支持自定义图标。[#23792](https://github.com/ant-design/ant-design/pull/23792) [@偏右](https://github.com/偏右)
- 💄 添加 `@input-disabled-color` less 变量。[#23775](https://github.com/ant-design/ant-design/pull/23775) [@alwaysloseall](https://github.com/alwaysloseall)
- Form
- 🐞 修复 Form.Item 内联样式下 label 在狭窄空间被挤压的问题。[#24531](https://github.com/ant-design/ant-design/pull/24531)
- 🐞 修复 Form.List 字段状态同步逻辑并添加嵌套字段示例。[#24009](https://github.com/ant-design/ant-design/pull/24009)
- 🆕 Form 添加 `validateTrigger` 支持全局设置子字段校验时机。[#23972](https://github.com/ant-design/ant-design/pull/23972)
- 🐞 修复 Cascader 下拉框中扩展按钮在禁用时的颜色。[#24521](https://github.com/ant-design/ant-design/pull/24521)
- Menu
- 🆕 调整 Menu `inline` 模式下未设置 icon 的菜单收起时文字显示第一个字符。[#24330](https://github.com/ant-design/ant-design/pull/24330)
- 🆕 Menu.Item 支持 `danger` 属性。[#23785](https://github.com/ant-design/ant-design/pull/23785)
- 🐞 修复 Breadcrumb 内使用链接时图标间距丢失的问题。[#24490](https://github.com/ant-design/ant-design/pull/24490) [@EscapeB](https://github.com/EscapeB)
- Avatar
- 🐞 修复 Avatar `onError` 会触发两次的问题。[#24506](https://github.com/ant-design/ant-design/pull/24506) [@sanonz](https://github.com/sanonz)
- 🆕 Avatar 新增 `gap` 来设置字符类型距离左右两侧边界单位像素。[#24357](https://github.com/ant-design/ant-design/pull/24357)
- 🐞 修复 Alert 关闭按钮 `padding` 样式。[#24471](https://github.com/ant-design/ant-design/pull/24471)
- 🐞 修复 Tree `@tree-directory-selected-bg` 变量不生效的问题。[#24468](https://github.com/ant-design/ant-design/pull/24468) [@morenyang](https://github.com/morenyang)
- Typography
- 🆕 Typography.Paragraph 支持自定义展开样式。[#24385](https://github.com/ant-design/ant-design/pull/24385) [@fireairforce](https://github.com/fireairforce)
- 🐞 修复 Typography 不支持 `title` 属性的问题。[#24440](https://github.com/ant-design/ant-design/pull/24440) [@Kermit-Xuan](https://github.com/Kermit-Xuan)
- 🆕 Typography.Text 支持 `keyboard` 样式。[#24195](https://github.com/ant-design/ant-design/pull/24195)
- 🆕 添加 Link 组件。[#24019](https://github.com/ant-design/ant-design/pull/24019)
- 🆕 Tooltip 支持配置背景颜色。[#23155](https://github.com/ant-design/ant-design/pull/23155)
- 🆕 Popconfirm 支持按 `ESC` 关闭。[#24420](https://github.com/ant-design/ant-design/pull/24420)
- 🆕 Tooltip `destroyTooltipOnHide` 支持 `keepParent` 配置。[#24362](https://github.com/ant-design/ant-design/pull/24362) [@Kermit-Xuan](https://github.com/Kermit-Xuan)
- Button
- 💄 优化 Button 背景 less 变量的影响范围。[#24372](https://github.com/ant-design/ant-design/pull/24372) [@morenyang](https://github.com/morenyang)
- 🆕 新增文本类型按钮 `type="text"`。[#22552](https://github.com/ant-design/ant-design/pull/22552)
- 🆕 Notification 支持全局配置 `prefixCls`。[#24295](https://github.com/ant-design/ant-design/pull/24295) [@tdida](https://github.com/tdida)
- 🆕 RangePicker `dateRender` 支持额外参数来判断是 `start` 还是 `end` 字段。[#24278](https://github.com/ant-design/ant-design/pull/24278)
- 🆕 Skeleton 添加 `round` 属性,允许段落和标题显示圆角。[#24137](https://github.com/ant-design/ant-design/pull/24137) [@xilihuasi](https://github.com/xilihuasi)
- 🆕 Transfer 支持 `oneWay` 配置单向选择以及 `pagination` 配置分页。[#24041](https://github.com/ant-design/ant-design/pull/24041)
- 💄 Descriptions 新增 `@descriptions-item-trailing-colon` 等 less 变量。[#24032](https://github.com/ant-design/ant-design/pull/24032) [@hengkx](https://github.com/hengkx)
- 🆕 Message 支持自定义样式通过使用`className``style`。[#24024](https://github.com/ant-design/ant-design/pull/24024) [@Kermit-Xuan](https://github.com/Kermit-Xuan)
- 🆕 ConfigProvider 支持 `virtual``dropdownMatchSelectWidth` 配置。[#23841](https://github.com/ant-design/ant-design/pull/23841) [@hengkx](https://github.com/hengkx)
- 🛠 优化依赖以减少总体打包尺寸。[#24584](https://github.com/ant-design/ant-design/pull/24584)
- 🐞 修复 `@ant-prefix` 变量在部分样式里不生效的问题。[#24459](https://github.com/ant-design/ant-design/pull/24459) [@morenyang](https://github.com/morenyang)
- 🌐 国际化
- 🇫🇮 改进 Typography `fi_FI` 国际化。[#24591](https://github.com/ant-design/ant-design/pull/24591) [@sagge](https://github.com/sagge)
- 🇧🇷 改进 `pt_BR` 国际化。[#24518](https://github.com/ant-design/ant-design/pull/24518) [@arturpfb](https://github.com/arturpfb)
- 🇬🇧 改进 Form `en_GB` 国际化。[#24404](https://github.com/ant-design/ant-design/pull/24404) [@morenyang](https://github.com/morenyang)
- RTL
- 💄 优化 Tree RTL 模式下选项框样式。[#24563](https://github.com/ant-design/ant-design/pull/24563)
- 💄 优化 Calendar 通知事项文字在 RTL 模式下的样式。[#24528](https://github.com/ant-design/ant-design/pull/24528)
- 💄 优化 Table 筛选下拉框在 RTL 模式下样式。[#24529](https://github.com/ant-design/ant-design/pull/24529)
- 💄 优化 Cascader RTL 模式下拉框的样式。[#24520](https://github.com/ant-design/ant-design/pull/24520)
- TypeScript
- Form 导出 RuleObject 与 RuleRender 定义。[#24541](https://github.com/ant-design/ant-design/pull/24541) [@sorteam](https://github.com/sorteam)
## 4.2.5
`2020-05-25`
- 🐞 修复 Table 在 `dataSource` 移除条目时,`rowSelection.onChange` 仍然会缓存的问题。[#24338](https://github.com/ant-design/ant-design/pull/24338)
- 🐞 修复 Table 的选中箭头在 `size=small/middle` 时超出的问题。[#24394](https://github.com/ant-design/ant-design/pull/24394)
- 🐞 修复 Input.Group 内 Input.TextArea `hover` 时清除图标消失的问题。[#24360](https://github.com/ant-design/ant-design/pull/24360) [@Mr-jiangzhiguo](https://github.com/Mr-jiangzhiguo)
- 🐞 修复 Notificiation 使用 `useNotificiation` 时无限 render 的行为。[#24337](https://github.com/ant-design/ant-design/pull/24337)
- 🐞 修复 Button `loading` 切换动画丢失和 Modal `confirmLoading` 按钮未复位的问题。[#24328](https://github.com/ant-design/ant-design/pull/24328)
- 🐞 修复 Drawer 关闭后依然会遮挡页面元素的问题。[#24290](https://github.com/ant-design/ant-design/pull/24290)
- 🐞 修复 Cascader/Select/Table/TreeSelect 空数据时字体的颜色。[#24279](https://github.com/ant-design/ant-design/pull/24279)
- 💄 优化 InputNumber 操作按钮居中样式。[#24266](https://github.com/ant-design/ant-design/pull/24266)
- 🐞 修复 Table 在 `filteredValue` 使用空数组时仍然会高亮过滤图标的问题。[#24263](https://github.com/ant-design/ant-design/pull/24263)
- 🐞 修复 Cascader 不支持 `number[]` 类型 `value` 的问题。[#24247](https://github.com/ant-design/ant-design/pull/24247)
- ⌨️ 修复 Switch `autoFocus``disabled` 移除后会触发的问题,调整样式以避免切换时额外的抖动,并移除鼠标点击失焦逻辑以提升无障碍体验。[#24254](https://github.com/ant-design/ant-design/pull/24254)
- 💄 增加 Menu 默认 `text-align` 样式定义以修复被外部样式影响的问题。[#24253](https://github.com/ant-design/ant-design/pull/24253)
- 🛠 用 hooks 重构 List。[#24280](https://github.com/ant-design/ant-design/pull/24280) [@hengkx](https://github.com/hengkx)
- 🛠 用 hooks 重构 Alert 以支持严格模式。[#24236](https://github.com/ant-design/ant-design/pull/24236) [@hengkx](https://github.com/hengkx)
- 🐞 修复 Card 和 `react-split` 一起使用时卡顿的问题。[#24425](https://github.com/ant-design/ant-design/pull/24425)
- TypeScript
- 🛠 优化 Cascader 的 TypeScript 定义。[#24393](https://github.com/ant-design/ant-design/pull/24393) [@zhangyu1818](https://github.com/zhangyu1818)
- 🐞 修复 Upload TypeScript 报错:`Could not find a declaration rc-upload` 的问题。[#24325](https://github.com/ant-design/ant-design/pull/24325)
- 🛠 BackTop 增加 `children` 定义。[#24235](https://github.com/ant-design/ant-design/pull/24235)
## 4.2.4
`2020-05-18`
- 🐞 回滚 Switch 以修复配置 `unCheckedChildren` 时,控制点位置样式问题。[#24242](https://github.com/ant-design/ant-design/pull/24242)
- 💄 调整 Upload 错误状态图标的颜色默认为红色。[#24160](https://github.com/ant-design/ant-design/pull/24160)
- 💄 向上微调 Dropdown 箭头位置。[#24215](https://github.com/ant-design/ant-design/pull/24215)
- 🌐 Form `defaultValidateMessages` 支持 `ru_RU`。[#24219](https://github.com/ant-design/ant-design/pull/24219) [@aivinog1](https://github.com/aivinog1)
## 4.2.3
`2020-05-16`
- 🐞 重构 `rc-progress` 以解决 `<script src="antd.min.js" />` 会抛出 `h3g is not defined` 的问题。[#24127](https://github.com/ant-design/ant-design/pull/24127)
- 📖 重写了 [在 create-react-app 中使用](https://ant.design/docs/react/use-with-create-react-app-cn)。[#24184](https://github.com/ant-design/ant-design/pull/24184)
- Drawer
- 🐞 修复 Drawer `getContainer={false}` 时的高度问题。[#24082](https://github.com/ant-design/ant-design/pull/24082)
- 🐞 修复 Drawer `mask={false}` 时隐藏动画不生效的问题。[#24082](https://github.com/ant-design/ant-design/pull/24082)
- BackTop
- 🛠 BackTop 使用 hooks 重构。[#23575](https://github.com/ant-design/ant-design/pull/23575)
- 🐞 修复 BackTop 在 Chrome 的 iframe 里不生效的问题。[#24194](https://github.com/ant-design/ant-design/pull/24194)
- DatePicker
- 🐞 修复 DatePicker `disabledDate` 不会作用到 `showToday` 上的问题。[#24190](https://github.com/ant-design/ant-design/pull/24190)
- 🐞 修复 DatePicker `renderExtraFooter` 内容过长超出容器宽度的问题。[#24145](https://github.com/ant-design/ant-design/pull/24145)
- Button
- 🐞 修复 Button 内图标无法使用 Tooltip 的问题。[#24095](https://github.com/ant-design/ant-design/pull/24095)
- 🐞 修复定制主题时小号 Button 错位的问题。[#24097](https://github.com/ant-design/ant-design/pull/24097)
- 🛠 Tooltip 使用 hooks 重构。[#23699](https://github.com/ant-design/ant-design/pull/23699)
- 🐞 修复 Upload.Dragger 禁用时依然会被 Form `label` 触发的问题。[#24202](https://github.com/ant-design/ant-design/pull/24202)
- 🐞 修复 Select 回填选项无法进行交互的问题(如 `title` 不生效)。[#24170](https://github.com/ant-design/ant-design/pull/24170)
- 🐞 修复 Switch 在 Safari 和 iOS Chrome 上点击时错位的问题。[#24122](https://github.com/ant-design/ant-design/pull/24122) [@lexlexa](https://github.com/lexlexa)
- 🐞 Carousel 更新依赖到 `react-slick@0.26.1` 以修正一些问题。[#24067](https://github.com/ant-design/ant-design/pull/24067)
- 🐞 Cascader 没有匹配任何选项时展示 `defaultValue` 而不是空字符串。[#24058](https://github.com/ant-design/ant-design/pull/24058) [@Kermit-Xuan](https://github.com/Kermit-Xuan)
- 🌎 完善繁体中文国际化。[#24065](https://github.com/ant-design/ant-design/pull/24065) [@wx1322](https://github.com/wx1322)
- 🐞 修复 Table `onChange` pagination 参数定义。[#24114](https://github.com/ant-design/ant-design/pull/24114) [@sorteam](https://github.com/sorteam)
- 💄 新增 less 变量 `@card-head-extra-color`。[#24189](https://github.com/ant-design/ant-design/pull/24189)
- 💄 调整 Pagination 简洁模式下按钮的背景色为透明。[#24152](https://github.com/ant-design/ant-design/pull/24152)
- 💄 修复暗色 Menu 内的链接颜色。[#24110](https://github.com/ant-design/ant-design/pull/24110)
- RTL
- 💄 修复 Dropdown.Button 下拉框在 RTL 模式下默认位置。[#24150](https://github.com/ant-design/ant-design/pull/24150)
- 💄 优化 Pagination 分隔符在 RTL 下的样式。[#24154](https://github.com/ant-design/ant-design/pull/24154)
- 💄 修复 Menu 在 RTL 下的 `border` 样式。[#24101](https://github.com/ant-design/ant-design/pull/24101)
- 💄 优化 Select 多选项在 RTL 模式下样式。[#24112](https://github.com/ant-design/ant-design/pull/24112)
- 💄 优化 Typography `expand` 在 RTL 下的样式。[#24084](https://github.com/ant-design/ant-design/pull/24084)
## 4.2.2
`2020-05-11`
- 🐞 修复安装 antd `npm run version` 报错的问题。[#24059](https://github.com/ant-design/ant-design/pull/24059)
- 🐞 修复 Menu `@menu-item-font-size` 变量失效的问题。[#24052](https://github.com/ant-design/ant-design/pull/24052)
- 💄 新增 `@modal-close-color` less 变量。[#24053](https://github.com/ant-design/ant-design/pull/24053)
## 4.2.1
`2020-05-11`
- Form
- 🐞 修复 Form.Item 使用 `getValueProps` React 会报警的问题。[#23875](https://github.com/ant-design/ant-design/pull/23875)
- 🐞 修复 Form.Item `help``validateStatus` 不是 `error` 时的样式问题。[#23945](https://github.com/ant-design/ant-design/pull/23945)
- Table
- 🐞 修复 Table 固定表头时选择列的宽度问题。[#23806](https://github.com/ant-design/ant-design/pull/23806)
- 💄 调整 Table 选择列 css 选择器优先级以支持自定义宽度。[#23914](https://github.com/ant-design/ant-design/pull/23914)
- DatePicker
- 🐞 修复在 `placeholder``undefined` 时不展示的问题。[#23818](https://github.com/ant-design/ant-design/pull/23818)
- 🐞 修复清除图标的颜色。[#23811](https://github.com/ant-design/ant-design/pull/23811)
- Switch
- 🐞 修复暗色主题下的加载样式。[#23766](https://github.com/ant-design/ant-design/pull/23766) [@vsn4ik](https://github.com/vsn4ik)
- 🐞 修复 `unCheckedChildren` 不显示的问题。[#23791](https://github.com/ant-design/ant-design/pull/23791)
- 🐞 修复 Upload 在浮层中错误提示滚动定位问题。[#24001](https://github.com/ant-design/ant-design/pull/24001) [@mraiguo](https://github.com/mraiguo)
- 💄 调整 Comment 中 `avatar` 为空时不必要的 div 样式[#23994](https://github.com/ant-design/ant-design/pull/23994) [@Xuhao](https://github.com/Xuhao)
- 🐞 修复 Input.Group 中 Select 选项 `focus` 边框样式[#23985](https://github.com/ant-design/ant-design/pull/23985)
- 🐞 修复 Steps `subTitle` 上会显示 `[object Object]` 提示的问题。[#23989](https://github.com/ant-design/ant-design/pull/23989)
- 💄 微调 Select 移除图标的位置。[#23963](https://github.com/ant-design/ant-design/pull/23963)
- 🐞 修复无遮罩的 Drawer 设置 `50%` 宽度时不显示的问题。[#23925](https://github.com/ant-design/ant-design/pull/23925)
- 🐞 修复 Textarea 开启 `allowClear` 时高度错误的问题。[#23835](https://github.com/ant-design/ant-design/pull/23835)
- 💄 调整 Modal.xxx 方法为异步以防止其影响 React 事件响应。[#23826](https://github.com/ant-design/ant-design/pull/23826)
- 🐞 修复受控模式 Menu `inlineCollapsed` 折叠时的表现。[#23822](https://github.com/ant-design/ant-design/pull/23822)
- 🐞 修复 Button `loading` 动画切换不平滑的问题。[#23783](https://github.com/ant-design/ant-design/pull/23783)
- 🐞 修复 Slider 拖拽中选中 `marks` 文本的问题。[#23773](https://github.com/ant-design/ant-design/pull/23773)
- 🛠 Timeline 使用 React Hooks 重构。[#23631](https://github.com/ant-design/ant-design/pull/23631) [@hengkx](https://github.com/hengkx)
- 🌎 国际化
- 🇮🇷 增加波斯语 `fa_IR` 国际化默认提示模板。[#23926](https://github.com/ant-design/ant-design/pull/23926) [@NarimanMov](https://github.com/NarimanMov)
- 🇺🇸 增加 Form `en` 国际化默认提示模板[#23859](https://github.com/ant-design/ant-design/pull/23859) [@mjfwebb](https://github.com/mjfwebb)
- 📦 包体积优化
- 🗑 移除 `react-lifecycles-compat` 依赖以优化包体积。[#23969](https://github.com/ant-design/ant-design/pull/23969)
- 🛠 源码中不再引用 `package.json` 从而优化了一点包体积。[#23957](https://github.com/ant-design/ant-design/pull/23957)
- 🛠 更新 `rc-animate` 到 3.x 以优化包体积。[#23937](https://github.com/ant-design/ant-design/pull/23937)
- RTL
- 🐞 修复 Input 在 RTL 模式下清空按钮的样式。[#23999](https://github.com/ant-design/ant-design/pull/23999)
- 🐞 修复 DatePicker 下拉框在 RTL 模式下样式。[#24028](https://github.com/ant-design/ant-design/pull/24028) [@xrkffgg](https://github.com/xrkffgg)
- 💄 优化 DatePick 在 `RTL` 模式下的激活条样式。[#23981](https://github.com/ant-design/ant-design/pull/23981)
- 🐞 修复 Transfer 查询框在 `RTL` 模式下的边距样式。[#23962](https://github.com/ant-design/ant-design/pull/23962)
- 💄 优化 Layout RTL 样式。[#23921](https://github.com/ant-design/ant-design/pull/23921)
- 💄 优化 Button `loading` 状态在 RTL 下样式。[#23776](https://github.com/ant-design/ant-design/pull/23776)
- 💄 优化 Input.Search RTL 样式。[#23797](https://github.com/ant-design/ant-design/pull/23797)
- TypeScript
- 🐞 修复 InputNumber `onChange` 类型。[#23871](https://github.com/ant-design/ant-design/pull/23871) [@jjhbw](https://github.com/jjhbw)
## 4.2.0
`2020-04-29`
- 🆕 List `grid` 支持所有分栏数字,比如分为 5 栏。[#23630](https://github.com/ant-design/ant-design/pull/23630)
- 🆕 Divider 新增 `plain` 属性,可用于设置一个非标题样式的分割文字。[#23405](https://github.com/ant-design/ant-design/pull/23405)
- 🆕 Typography `ellipsis` 支持 `onEllipsis` 事件。[#23414](https://github.com/ant-design/ant-design/pull/23414)
- 🆕 Space 支持 `align` 属性。[#23306](https://github.com/ant-design/ant-design/pull/23306)
- 🆕 Upload 添加 `isImageUrl` 属性以强制将文件作为图标文件。[#23248](https://github.com/ant-design/ant-design/pull/23248) [@onjuju](https://github.com/onjuju)
- 🆕 Form.Item 支持 `initialValue``getValueProps` 属性。[#22993](https://github.com/ant-design/ant-design/pull/22993)
- ConfigProvider
- 🆕 ConfigProvider 支持 `getTargetContainer` 以配置 Affix `target` 属性。[#23751](https://github.com/ant-design/ant-design/pull/23751)
- 🆕 ConfigProvider 添加 `input` 属性以支持全局化配置 Input `autoComplete` 的默认值。[#23455](https://github.com/ant-design/ant-design/pull/23455)
- 🐞 修复 ConfigProvider `getPopupContainer` 对 DatePicker 和 Slider 不生效的问题。[#23594](https://github.com/ant-design/ant-design/pull/23594) [@hengkx](https://github.com/hengkx)
- Table
- 🆕 Table `summary` 支持固定列。[#23647](https://github.com/ant-design/ant-design/pull/23647)
- 🆕 Table 支持响应式展现列。[#23298](https://github.com/ant-design/ant-design/pull/23298) [@vbudovski](https://github.com/vbudovski)
- 🐞 修复 Table pagination 在 RTL 下默认位置。[#23747](https://github.com/ant-design/ant-design/pull/23747)
- 🐞 修复 Table 在 `pageSize``undefined` 时崩溃的问题。[#23724](https://github.com/ant-design/ant-design/pull/23724)
- 🐞 修复 Table 大小为 `small``middle` 时嵌套表格错位的问题。[#23602](https://github.com/ant-design/ant-design/pull/23602) [@hengkx](https://github.com/hengkx)
- 🐞 修正 RangePicker 范围标签的颜色为主色。[#23705](https://github.com/ant-design/ant-design/pull/23705)
- 🐞 修复 Transfer 为空自定义图片样式问题。[#23694](https://github.com/ant-design/ant-design/pull/23694) [@hengkx](https://github.com/hengkx)
- Input
- 🐞 修复 Password 组件输入光标位置。[#23633](https://github.com/ant-design/ant-design/pull/23633) [@huntdream](https://github.com/huntdream)
- 💄 调整 Input.Search 的搜索图标样式。[#23406](https://github.com/ant-design/ant-design/pull/23406)
- Button
- 🐞 修复 Button 图标类型按钮的对齐问题。[#23671](https://github.com/ant-design/ant-design/pull/23671)
- 🐞 修复 Button 图标按钮 `loading` 样式错误的问题。[#23614](https://github.com/ant-design/ant-design/pull/23614)
- 🐞 解决 Button 无法直接被 `react-dnd` 调用的问题。[#23571](https://github.com/ant-design/ant-design/pull/23571) [@hengkx](https://github.com/hengkx)
- Menu
- 🆕 Menu Item 和 SubMenu 新增 `icon` 属性。[#23629](https://github.com/ant-design/ant-design/pull/23629)
- 🐞 修复 Menu 菜单重复阴影的问题。[#23664](https://github.com/ant-design/ant-design/pull/23664)
- 🐞 解决 Tag 无法直接被 `react-dnd` 调用的问题。[#23632](https://github.com/ant-design/ant-design/pull/23632) [@hengkx](https://github.com/hengkx)
- Anchor
- 🐞 修复 Anchor Link 包含多个 `#` 时无法跳转的问题。[#23595](https://github.com/ant-design/ant-design/pull/23595) [@wuzekang](https://github.com/wuzekang)
- 🐞 修复 Input 带 `suffix` 时的元素对齐问题。[#23606](https://github.com/ant-design/ant-design/pull/23606)
- 💄 Select 箭头打开时不再翻转。[#23468](https://github.com/ant-design/ant-design/pull/23468)
- 💄 新增 Rate 的 `direction` 支持优化。[#23321](https://github.com/ant-design/ant-design/pull/23321)
- 💄 调整紧凑模式下默认的字体大小。[#23135](https://github.com/ant-design/ant-design/pull/23135)
- RTL
- 💄 优化 Result RTL 下按钮样式。[#23733](https://github.com/ant-design/ant-design/pull/23733)
- 💄 新增 Divider RTL 支持。[#23734](https://github.com/ant-design/ant-design/pull/23734)
- 💄 修复 Alert 在 RTL 下无 icon 的间隔问题。[#23714](https://github.com/ant-design/ant-design/pull/23714)
- 💄 优化 Table RTL 模式下扩展按钮动画与分页样式问题。[#23706](https://github.com/ant-design/ant-design/pull/23706)
- 💄 修复 Table 筛选下拉框在 RTL 下的位置。[#23695](https://github.com/ant-design/ant-design/pull/23695)
- 💄 修复 Table 勾选框图标 RTL 样式。[#23690](https://github.com/ant-design/ant-design/pull/23690)
- 💄 优化 List RTL 样式。[#23676](https://github.com/ant-design/ant-design/pull/23676)
- 💄 新增 Calendar RTL 支持。[#23394](https://github.com/ant-design/ant-design/pull/23394)
- 💄 优化 Input.Search RTL 样式。[#23424](https://github.com/ant-design/ant-design/pull/23424)
- 💄 增加 Notification RTL 设置。[#23185](https://github.com/ant-design/ant-design/pull/23185)
- TypeScript
- 🐞 修复 PageHeader `tag` 属性定义错误。[#23712](https://github.com/ant-design/ant-design/pull/23712) [@hengkx](https://github.com/hengkx)
- 🗑 移除已废弃的 Button `type="danger"` TypeScript 定义并增加警告信息。[#23709](https://github.com/ant-design/ant-design/pull/23709)
- 🐞 修复 Table pagination `position` Typescript 定义错误。[#23681](https://github.com/ant-design/ant-design/pull/23681) [@hengkx](https://github.com/hengkx)
## 4.1.5
`2020-04-25`
- 🐞 修复 Button.Group 中按钮没有对齐的问题。[#23590](https://github.com/ant-design/ant-design/pull/23590)
- 🐞 修复 Select 箭头图标点击无法触发下拉的问题。[#23448](https://github.com/ant-design/ant-design/pull/23448)
- 🐞 修复 Form 自定义 `@form-item-margin-bottom` 变量时表单校验抖动的问题。[#23436](https://github.com/ant-design/ant-design/pull/23436) [@yoyo837](https://github.com/yoyo837)
- 🐞 修复第一个 Divider 渲染时样式不一致的问题。[#23438](https://github.com/ant-design/ant-design/pull/23438)
- 🐞 修复嵌套 ConfigProvider 会丢失 `prefixCls` 值的问题。[#23423](https://github.com/ant-design/ant-design/pull/23423)
- 🐞 修复 Carousel 键盘切换到非活跃 slide 上的 Radio/Checkbox 的问题。[#23380](https://github.com/ant-design/ant-design/pull/23380)
- 🐞 修复 Tree 使用虚拟滚动时会因为 `loadData` 更新过快而锁死的问题。[#23581](https://github.com/ant-design/ant-design/pull/23581)
- 🐞 修复 Steps 组件竖直展示时在 IE11 下样式错误的问题。[#23561](https://github.com/ant-design/ant-design/pull/23561) [@AdrianoRuberto](https://github.com/AdrianoRuberto)
- 🐞 修复 Input.Search 高度被 `suffix` 撑高的问题和报 `react key` 重复警告的问题。[#23527](https://github.com/ant-design/ant-design/pull/23527)
- 🐞 修复 Menu 鼠标移到缝隙处子菜单会消失的问题。[#23511](https://github.com/ant-design/ant-design/pull/23511)
- 🐞 修复 Tree 自定义图标在加载状态下消失的问题。[#23494](https://github.com/ant-design/ant-design/pull/23494)
- RTL
- 🐞 修复 Alert 在 `showIcon``closable` 都存在时的 RTL 样式问题。[#23526](https://github.com/ant-design/ant-design/pull/23526)
- 🐞 修复 Button 在 RTL 下 loading 样式不正确的问题。[#23399](https://github.com/ant-design/ant-design/pull/23399)
- 🐞 修复 Collapse 在 RTL 下切换图标位置不正确的问题。[#23445](https://github.com/ant-design/ant-design/pull/23445)
- 🐞 修复 Select 分组名称的 RTL 样式问题。[#23404](https://github.com/ant-design/ant-design/pull/23404)
- 🐞 修复 Statistic 的 RTL 样式不正确的问题。[#23397](https://github.com/ant-design/ant-design/pull/23397)
- TypeScript
- 🐞 修复 Table 的 `selections` 类型定义。[#23462](https://github.com/ant-design/ant-design/pull/23462) [@xiaoxintang](https://github.com/xiaoxintang)
## 4.1.4
`2020-04-18`
- 🐞 修复暗黑主题和紧凑主题不生效的问题。[#23243](https://github.com/ant-design/ant-design/pull/23243)
- 🐞 修复 Modal.info 等方法的 `onOk` 函数有参数时只触发一次的问题。[#23360](https://github.com/ant-design/ant-design/pull/23360)
- 🐞 修复 Dropdown 弹出菜单背景样式问题。[#23296](https://github.com/ant-design/ant-design/pull/23296)
- 💄 优化 PageHeader 的响应式表现。[#23277](https://github.com/ant-design/ant-design/pull/23277)
- 🐞 修复紧凑模式下树选择出现空白。[#23231](https://github.com/ant-design/ant-design/pull/23231)
- 🛎 修改 Checkbox 和 Switch 中控制台输出的错别字 (validate -> a valid)。[#23240](https://github.com/ant-design/ant-design/pull/23240) [@evancharlton](https://github.com/evancharlton)
- 🐞 修复 Table `rowSelection` 在设置 `childrenColumnName` 时事件参数不正确的问题。[#23205](https://github.com/ant-design/ant-design/pull/23205)
- Input
- 🐞 修复 Input `type="color"` 的高度问题。[#23351](https://github.com/ant-design/ant-design/pull/23351)
- 🐞 修复 Input 设置 `allowClear` 内联展示时,触发清除按钮样式抖动的问题。[#23259](https://github.com/ant-design/ant-design/pull/23259)
- 🐞 修复 Input.Search 全局设置 `size` 不生效问题。[#23331](https://github.com/ant-design/ant-design/pull/23331)
- Select
- 🐞 修复 Select 多选时设置 `disabled` 选项仍然会展示移除按钮的问题。[#23295](https://github.com/ant-design/ant-design/pull/23295)
- 🐞 修复 Select 自定义 `suffixIcon` 无法交互的问题。[#23274](https://github.com/ant-design/ant-design/pull/23274)
- 🐞 修复 Select 输入光标在 Collapse 内不显示的问题。[#23250](https://github.com/ant-design/ant-design/pull/23250)
- 国际化
- 🌐 Form 校验信息支持国际化并增加中文文案。[#23165](https://github.com/ant-design/ant-design/pull/23165) [@hengkx](https://github.com/hengkx)
- 🌐 完善希伯来语(以色列) 国际化。[#23302](https://github.com/ant-design/ant-design/pull/23302) [@MishaKav](https://github.com/MishaKav)
- 🌐 完善俄语国际化。[#23303](https://github.com/ant-design/ant-design/pull/23303) [@MishaKav](https://github.com/MishaKav)
- TypeScript
- 🔷 更新 Tree 的类型定义。[#23348](https://github.com/ant-design/ant-design/pull/23348) [@yoyo837](https://github.com/yoyo837)
- 🔷 更新 Form Item 的类型定义。[#22962](https://github.com/ant-design/ant-design/pull/22962) [@fa93hws](https://github.com/fa93hws)
- 🐞 修复 Slider 组件 `value``defaultValue` 文档与 TypeScript 定义不一致的问题。[#23252](https://github.com/ant-design/ant-design/pull/23252) [@DongchengWang](https://github.com/DongchengWang)
- RTL
- 🐞 修复 Menu RTL 样式。[#23319](https://github.com/ant-design/ant-design/pull/23319)
- 💄 修复 Select 的 RTL 样式。[#23235](https://github.com/ant-design/ant-design/pull/23235)
## 4.1.3
`2020-04-13`
- 💄 调整 Form.Item `label` 在垂直布局下的高度样式。[#23192](https://github.com/ant-design/ant-design/pull/23192)
- 🐞 修复引用暗黑或紧凑主题时提示 `Variable is undefined` 的问题,并提供 `getThemeVariables` 方便获取对应主题变量。[#23171](https://github.com/ant-design/ant-design/pull/23171)
- 🐞 修复 PageHeader `title` 超长时布局被破坏的问题并优化响应式表现。[#23133](https://github.com/ant-design/ant-design/pull/23133)
- Tabs
- 🐞 修复 Tabs `@tabs-card-height` less 变量无效的问题。[#23168](https://github.com/ant-design/ant-design/pull/23168)
- 🐞 修复 Tabs 在 Safair 浏览器下无法显示的问题。[#23151](https://github.com/ant-design/ant-design/pull/23151) [@imhxc](https://github.com/imhxc)
- Table
- 🐞 修复 Table 固定列在 Safari 12 中不能固定的问题。[#23161](https://github.com/ant-design/ant-design/pull/23161)
- 🐞 修复 Table `summary` 在小尺寸下的内边距样式。[#23140](https://github.com/ant-design/ant-design/pull/23140) [@someyoungideas](https://github.com/someyoungideas)
- 🐞 修复 Select 不同尺寸下的对齐样式问题。[#23160](https://github.com/ant-design/ant-design/pull/23160)
- 🐞 修复 RangePicker 在 Input.Group 内的样式问题。[#23149](https://github.com/ant-design/ant-design/pull/23149)
- 🐞 修复 Pagination 缺少 `showTitle` TypeScript 定义的问题。[#23144](https://github.com/ant-design/ant-design/pull/23144) [@DongchengWang](https://github.com/DongchengWang)
## 4.1.2
`2020-04-10`
- Menu
- 🐞 修复暗色 Menu 弹出菜单背景色为白色的问题。[#22981](https://github.com/ant-design/ant-design/pull/22981) [@AshoneA](https://github.com/AshoneA)
- 🐞 修复 SubMenu 标题过长而导致被箭头图标部分覆盖的问题。[#23028](https://github.com/ant-design/ant-design/pull/23028) [@wwyx778](https://github.com/wwyx778)
@@ -52,6 +371,8 @@ timeline: true
## 4.1.1
`2020-04-05`
- 🐞 移除 Tabs 的内容区域的 focus 蓝色轮廓线。[#22752](https://github.com/ant-design/ant-design/pull/22752) [@MrHeer](https://github.com/MrHeer)
- 🐞 修复 Input 前后缀添加弹出元素不能点击获得焦点的问题。[#22887](https://github.com/ant-design/ant-design/pull/22887)
- Table

View File

@@ -34,7 +34,7 @@ This Code of Conduct applies both within project spaces and in public spaces whe
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at xingmin.zhu@alipay.com. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at [xingmin.zhu@alipay.com.](mailto:xingmin.zhu@alipay.com.) The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.

7
Dockerfile.ui-test Normal file
View File

@@ -0,0 +1,7 @@
FROM buildkite/puppeteer:latest
RUN mkdir /app
WORKDIR /app
COPY package.json ./
RUN npm install
ENV PATH="${PATH}:/app/node_modules/.bin"
COPY . .

View File

@@ -1,5 +1,5 @@
<p align="center">
<a href="http://ant.design">
<a href="https://ant.design">
<img width="200" src="https://gw.alipayobjects.com/zos/rmsportal/KDpgvguMpGfqaHPjicRK.svg">
</a>
</p>
@@ -10,15 +10,44 @@
Uma solução empresarial de design e biblioteca UI para React.
[![CircleCI branch](https://img.shields.io/circleci/project/github/ant-design/ant-design/master.svg?style=flat-square)](https://circleci.com/gh/ant-design/ant-design) ![CI Status](https://github.com/ant-design/ant-design/workflows/test/badge.svg) [![Codecov](https://img.shields.io/codecov/c/github/ant-design/ant-design/master.svg?style=flat-square)](https://codecov.io/gh/ant-design/ant-design/branch/master) [![](https://flat.badgen.net/npm/v/antd?icon=npm)](https://www.npmjs.com/package/antd) [![NPM downloads](http://img.shields.io/npm/dm/antd.svg?style=flat-square)](http://npmjs.com/antd)
[![CircleCI status][circleci-image]][circleci-url] [![CI status][github-action-image]][github-action-url] [![codecov][codecov-image]][codecov-url] [![NPM version][npm-image]][npm-url] [![NPM downloads][download-image]][download-url]
[![Dependencies](https://img.shields.io/david/ant-design/ant-design.svg?style=flat-square)](https://david-dm.org/ant-design/ant-design) [![DevDependencies](https://img.shields.io/david/dev/ant-design/ant-design.svg?style=flat-square)](https://david-dm.org/ant-design/ant-design?type=dev) [![Total alerts](https://flat.badgen.net/lgtm/alerts/g/ant-design/ant-design)](https://lgtm.com/projects/g/ant-design/ant-design/alerts/) [![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fant-design%2Fant-design.svg?type=shield)](https://app.fossa.io/projects/git%2Bgithub.com%2Fant-design%2Fant-design?ref=badge_shield) [![Issues need help](https://flat.badgen.net/github/label-issues/ant-design/ant-design/help%20wanted/open)](https://github.com/ant-design/ant-design/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22)
[![david deps][david-image]][david-url] [![david devDeps][david-dev-image]][david-dev-url] [![Total alerts][lgtm-image]][lgtm-url] [![FOSSA Status][fossa-image]][fossa-url] [![Issues need help][help-wanted-image]][help-wanted-url]
[![](https://img.shields.io/twitter/follow/AntDesignUI.svg?label=Ant%20Design&style=social)](https://twitter.com/AntDesignUI) [![Gitter](https://img.shields.io/gitter/room/ant-design/ant-design-english.svg?style=flat-square&logoWidth=20&logo=data%3Aimage%2Fsvg%2Bxml%3Bbase64%2CPD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4NCjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgd2lkdGg9IjEyMzUiIGhlaWdodD0iNjUwIiB2aWV3Qm94PSIwIDAgNzQxMCAzOTAwIj4NCjxyZWN0IHdpZHRoPSI3NDEwIiBoZWlnaHQ9IjM5MDAiIGZpbGw9IiNiMjIyMzQiLz4NCjxwYXRoIGQ9Ik0wLDQ1MEg3NDEwbTAsNjAwSDBtMCw2MDBINzQxMG0wLDYwMEgwbTAsNjAwSDc0MTBtMCw2MDBIMCIgc3Ryb2tlPSIjZmZmIiBzdHJva2Utd2lkdGg9IjMwMCIvPg0KPHJlY3Qgd2lkdGg9IjI5NjQiIGhlaWdodD0iMjEwMCIgZmlsbD0iIzNjM2I2ZSIvPg0KPGcgZmlsbD0iI2ZmZiI%2BDQo8ZyBpZD0iczE4Ij4NCjxnIGlkPSJzOSI%2BDQo8ZyBpZD0iczUiPg0KPGcgaWQ9InM0Ij4NCjxwYXRoIGlkPSJzIiBkPSJNMjQ3LDkwIDMxNy41MzQyMzAsMzA3LjA4MjAzOSAxMzIuODczMjE4LDE3Mi45MTc5NjFIMzYxLjEyNjc4MkwxNzYuNDY1NzcwLDMwNy4wODIwMzl6Ii8%2BDQo8dXNlIHhsaW5rOmhyZWY9IiNzIiB5PSI0MjAiLz4NCjx1c2UgeGxpbms6aHJlZj0iI3MiIHk9Ijg0MCIvPg0KPHVzZSB4bGluazpocmVmPSIjcyIgeT0iMTI2MCIvPg0KPC9nPg0KPHVzZSB4bGluazpocmVmPSIjcyIgeT0iMTY4MCIvPg0KPC9nPg0KPHVzZSB4bGluazpocmVmPSIjczQiIHg9IjI0NyIgeT0iMjEwIi8%2BDQo8L2c%2BDQo8dXNlIHhsaW5rOmhyZWY9IiNzOSIgeD0iNDk0Ii8%2BDQo8L2c%2BDQo8dXNlIHhsaW5rOmhyZWY9IiNzMTgiIHg9Ijk4OCIvPg0KPHVzZSB4bGluazpocmVmPSIjczkiIHg9IjE5NzYiLz4NCjx1c2UgeGxpbms6aHJlZj0iI3M1IiB4PSIyNDcwIi8%2BDQo8L2c%2BDQo8L3N2Zz4%3D)](https://gitter.im/ant-design/ant-design-english?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) [![Join the chat at https://gitter.im/ant-design/ant-design](https://img.shields.io/gitter/room/ant-design/ant-design.svg?style=flat-square&logoWidth=20&logo=data%3Aimage%2Fsvg%2Bxml%3Bbase64%2CPD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4NCjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgd2lkdGg9IjkwMCIgaGVpZ2h0PSI2MDAiIHZpZXdCb3g9IjAgMCAzMCAyMCI%2BDQo8ZGVmcz4NCjxwYXRoIGlkPSJzIiBkPSJNMCwtMSAwLjU4Nzc4NSwwLjgwOTAxNyAtMC45NTEwNTcsLTAuMzA5MDE3SDAuOTUxMDU3TC0wLjU4Nzc4NSwwLjgwOTAxN3oiIGZpbGw9IiNmZmRlMDAiLz4NCjwvZGVmcz4NCjxyZWN0IHdpZHRoPSIzMCIgaGVpZ2h0PSIyMCIgZmlsbD0iI2RlMjkxMCIvPg0KPHVzZSB4bGluazpocmVmPSIjcyIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoNSw1KSBzY2FsZSgzKSIvPg0KPHVzZSB4bGluazpocmVmPSIjcyIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMTAsMikgcm90YXRlKDIzLjAzNjI0MykiLz4NCjx1c2UgeGxpbms6aHJlZj0iI3MiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDEyLDQpIHJvdGF0ZSg0NS44Njk4OTgpIi8%2BDQo8dXNlIHhsaW5rOmhyZWY9IiNzIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgxMiw3KSByb3RhdGUoNjkuOTQ1Mzk2KSIvPg0KPHVzZSB4bGluazpocmVmPSIjcyIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMTAsOSkgcm90YXRlKDIwLjY1OTgwOCkiLz4NCjwvc3ZnPg%3D%3D)](https://gitter.im/ant-design/ant-design?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![Follow Twitter][twitter-image]][twitter-url] [![Gitter][gitter-english-image]][gitter-english-url] [![Gitter][gitter-chinese-image]][gitter-chinese-url] [![[SemVer stability]][semver-stability-image]][semver-stability-url]
[npm-image]: http://img.shields.io/npm/v/antd.svg?style=flat-square
[npm-url]: http://npmjs.org/package/antd
[circleci-image]: https://img.shields.io/travis/com/ant-design/ant-design.svg?style=flat-square
[circleci-url]: https://travis-ci.com/ant-design/ant-design
[github-action-image]: https://github.com/ant-design/ant-design/workflows/test/badge.svg
[github-action-url]: https://github.com/ant-design/ant-design/actions?query=workflow%3Atest
[codecov-image]: https://img.shields.io/codecov/c/github/ant-design/ant-design/master.svg?style=flat-square
[codecov-url]: https://codecov.io/gh/ant-design/ant-design/branch/master
[david-image]: https://img.shields.io/david/ant-design/ant-design?style=flat-square
[david-dev-url]: https://david-dm.org/ant-design/ant-design?type=dev
[david-dev-image]: https://img.shields.io/david/dev/ant-design/ant-design?style=flat-square
[david-url]: https://david-dm.org/ant-design/ant-design
[download-image]: https://img.shields.io/npm/dm/antd.svg?style=flat-square
[download-url]: https://npmjs.org/package/antd
[lgtm-image]: https://flat.badgen.net/lgtm/alerts/g/ant-design/ant-design
[lgtm-url]: https://lgtm.com/projects/g/ant-design/ant-design/alerts/
[fossa-image]: https://app.fossa.io/api/projects/git%2Bgithub.com%2Fant-design%2Fant-design.svg?type=shield
[fossa-url]: https://app.fossa.io/projects/git%2Bgithub.com%2Fant-design%2Fant-design?ref=badge_shield
[help-wanted-image]: https://flat.badgen.net/github/label-issues/ant-design/ant-design/help%20wanted/open
[help-wanted-url]: https://github.com/ant-design/ant-design/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22
[twitter-image]: https://img.shields.io/twitter/follow/AntDesignUI.svg?label=Ant%20Design&style=social
[twitter-url]: https://twitter.com/AntDesignUI
[gitter-english-image]: https://img.shields.io/gitter/room/ant-design/ant-design-english.svg?style=flat-square&logoWidth=18&logo=data%3Aimage%2Fsvg%2Bxml%3Bbase64%2CPD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4NCjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgd2lkdGg9IjEyMzUiIGhlaWdodD0iNjUwIiB2aWV3Qm94PSIwIDAgNzQxMCAzOTAwIj4NCjxyZWN0IHdpZHRoPSI3NDEwIiBoZWlnaHQ9IjM5MDAiIGZpbGw9IiNiMjIyMzQiLz4NCjxwYXRoIGQ9Ik0wLDQ1MEg3NDEwbTAsNjAwSDBtMCw2MDBINzQxMG0wLDYwMEgwbTAsNjAwSDc0MTBtMCw2MDBIMCIgc3Ryb2tlPSIjZmZmIiBzdHJva2Utd2lkdGg9IjMwMCIvPg0KPHJlY3Qgd2lkdGg9IjI5NjQiIGhlaWdodD0iMjEwMCIgZmlsbD0iIzNjM2I2ZSIvPg0KPGcgZmlsbD0iI2ZmZiI%2BDQo8ZyBpZD0iczE4Ij4NCjxnIGlkPSJzOSI%2BDQo8ZyBpZD0iczUiPg0KPGcgaWQ9InM0Ij4NCjxwYXRoIGlkPSJzIiBkPSJNMjQ3LDkwIDMxNy41MzQyMzAsMzA3LjA4MjAzOSAxMzIuODczMjE4LDE3Mi45MTc5NjFIMzYxLjEyNjc4MkwxNzYuNDY1NzcwLDMwNy4wODIwMzl6Ii8%2BDQo8dXNlIHhsaW5rOmhyZWY9IiNzIiB5PSI0MjAiLz4NCjx1c2UgeGxpbms6aHJlZj0iI3MiIHk9Ijg0MCIvPg0KPHVzZSB4bGluazpocmVmPSIjcyIgeT0iMTI2MCIvPg0KPC9nPg0KPHVzZSB4bGluazpocmVmPSIjcyIgeT0iMTY4MCIvPg0KPC9nPg0KPHVzZSB4bGluazpocmVmPSIjczQiIHg9IjI0NyIgeT0iMjEwIi8%2BDQo8L2c%2BDQo8dXNlIHhsaW5rOmhyZWY9IiNzOSIgeD0iNDk0Ii8%2BDQo8L2c%2BDQo8dXNlIHhsaW5rOmhyZWY9IiNzMTgiIHg9Ijk4OCIvPg0KPHVzZSB4bGluazpocmVmPSIjczkiIHg9IjE5NzYiLz4NCjx1c2UgeGxpbms6aHJlZj0iI3M1IiB4PSIyNDcwIi8%2BDQo8L2c%2BDQo8L3N2Zz4%3D
[gitter-english-url]: https://gitter.im/ant-design/ant-design-english?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge
[gitter-chinese-image]: https://img.shields.io/gitter/room/ant-design/ant-design.svg?style=flat-square&logoWidth=18&logo=data%3Aimage%2Fsvg%2Bxml%3Bbase64%2CPD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4NCjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgd2lkdGg9IjkwMCIgaGVpZ2h0PSI2MDAiIHZpZXdCb3g9IjAgMCAzMCAyMCI%2BDQo8ZGVmcz4NCjxwYXRoIGlkPSJzIiBkPSJNMCwtMSAwLjU4Nzc4NSwwLjgwOTAxNyAtMC45NTEwNTcsLTAuMzA5MDE3SDAuOTUxMDU3TC0wLjU4Nzc4NSwwLjgwOTAxN3oiIGZpbGw9IiNmZmRlMDAiLz4NCjwvZGVmcz4NCjxyZWN0IHdpZHRoPSIzMCIgaGVpZ2h0PSIyMCIgZmlsbD0iI2RlMjkxMCIvPg0KPHVzZSB4bGluazpocmVmPSIjcyIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoNSw1KSBzY2FsZSgzKSIvPg0KPHVzZSB4bGluazpocmVmPSIjcyIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMTAsMikgcm90YXRlKDIzLjAzNjI0MykiLz4NCjx1c2UgeGxpbms6aHJlZj0iI3MiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDEyLDQpIHJvdGF0ZSg0NS44Njk4OTgpIi8%2BDQo8dXNlIHhsaW5rOmhyZWY9IiNzIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgxMiw3KSByb3RhdGUoNjkuOTQ1Mzk2KSIvPg0KPHVzZSB4bGluazpocmVmPSIjcyIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMTAsOSkgcm90YXRlKDIwLjY1OTgwOCkiLz4NCjwvc3ZnPg%3D%3D
[gitter-chinese-url]: https://gitter.im/ant-design/ant-design?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge
[semver-stability-url]: https://dependabot.com/compatibility-score.html/?dependency-name=antd&package-manager=npm_and_yarn&new-version=latest
[semver-stability-image]: https://api.dependabot.com/badges/compatibility_score?dependency-name=antd&package-manager=npm_and_yarn&target-version=latest&version-scheme=semver
</div>
[![](https://gw.alipayobjects.com/mdn/rms_08e378/afts/img/A*Yl83RJhUE7kAAAAAAAAAAABkARQnAQ)](http://ant.design)
[![](https://gw.alipayobjects.com/mdn/rms_08e378/afts/img/A*Yl83RJhUE7kAAAAAAAAAAABkARQnAQ)](https://ant.design)
[English](./README.md) | Português | [简体中文](./README-zh_CN.md)
@@ -33,7 +62,7 @@ Uma solução empresarial de design e biblioteca UI para React.
## 🖥 Suporte aos ambientes
- Navegadores modernos e Internet Explorer 11+ (com [polyfills](https://ant.design/docs/react/getting-started#Compatibility))
- Navegadores modernos e Internet Explorer 11 (com [polyfills](https://ant.design/docs/react/getting-started#Compatibility))
- Renderização no lado do servidor (server-side)
- [Electron](https://www.electronjs.org/)
@@ -70,21 +99,20 @@ Importe o estilo manualmente:
import 'antd/dist/antd.css'; // ou 'antd/dist/antd.less'
```
Ou use [babel-plugin-import](https://ant.design/docs/react/getting-started#Import-on-Demand).
### TypeScript
Veja [Uso no Typescript](https://ant.design/docs/react/use-in-typescript).
## 🌍 Internacionalização
Veja [i18n](http://ant.design/docs/react/i18n).
Veja [i18n](https://ant.design/docs/react/i18n).
## 🔗 Links
- [Página inicial](http://ant.design/)
- [Componentes](http://ant.design/docs/react/introduce)
- [Página inicial](https://ant.design/)
- [Componentes](https://ant.design/components/overview)
- [Ant Design Pro](http://pro.ant.design/)
- [Ant Design Charts](https://charts.ant.design)
- [Change Log](CHANGELOG.en-US.md)
- [rc-components](http://react-component.github.io/)
- [Mobile UI](http://mobile.ant.design)
@@ -101,7 +129,7 @@ Veja [i18n](http://ant.design/docs/react/i18n).
- [FAQ](https://ant.design/docs/react/faq)
- [CodeSandbox Template](https://u.ant.design/codesandbox-repro) para relatório de erros
- [Awesome Ant Design](https://github.com/websemantics/awesome-ant-design)
- [Customize Theme](http://ant.design/docs/react/customize-theme)
- [Customize Theme](https://ant.design/docs/react/customize-theme)
- [How to Apply for Being A Collaborator](https://github.com/ant-design/ant-design/wiki/Collaborators#how-to-apply-for-being-a-collaborator)
## ⌨️ Desenvolvimento

View File

@@ -1,5 +1,5 @@
<p align="center">
<a href="http://ant.design">
<a href="https://ant.design">
<img width="200" src="https://gw.alipayobjects.com/zos/rmsportal/KDpgvguMpGfqaHPjicRK.svg">
</a>
</p>
@@ -10,15 +10,44 @@
一套企业级 UI 设计语言和 React 组件库。
[![CircleCI branch](https://img.shields.io/circleci/project/github/ant-design/ant-design/master.svg?style=flat-square)](https://circleci.com/gh/ant-design/ant-design) ![CI Status](https://github.com/ant-design/ant-design/workflows/Node%20CI/badge.svg) [![Codecov](https://img.shields.io/codecov/c/github/ant-design/ant-design/master.svg?style=flat-square)](https://codecov.io/gh/ant-design/ant-design/branch/master) [![](https://flat.badgen.net/npm/v/antd?icon=npm)](https://www.npmjs.com/package/antd) [![NPM downloads](http://img.shields.io/npm/dm/antd.svg?style=flat-square)](http://npmjs.com/antd)
[![CircleCI status][circleci-image]][circleci-url] [![CI status][github-action-image]][github-action-url] [![codecov][codecov-image]][codecov-url] [![NPM version][npm-image]][npm-url] [![NPM downloads][download-image]][download-url]
[![Dependencies](https://img.shields.io/david/ant-design/ant-design.svg?style=flat-square)](https://david-dm.org/ant-design/ant-design) [![DevDependencies](https://img.shields.io/david/dev/ant-design/ant-design.svg?style=flat-square)](https://david-dm.org/ant-design/ant-design?type=dev) [![Total alerts](https://flat.badgen.net/lgtm/alerts/g/ant-design/ant-design)](https://lgtm.com/projects/g/ant-design/ant-design/alerts/) [![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fant-design%2Fant-design.svg?type=shield)](https://app.fossa.io/projects/git%2Bgithub.com%2Fant-design%2Fant-design?ref=badge_shield) [![Issues need help](https://flat.badgen.net/github/label-issues/ant-design/ant-design/help%20wanted/open)](https://github.com/ant-design/ant-design/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22)
[![david deps][david-image]][david-url] [![david devDeps][david-dev-image]][david-dev-url] [![Total alerts][lgtm-image]][lgtm-url] [![FOSSA Status][fossa-image]][fossa-url] [![Issues need help][help-wanted-image]][help-wanted-url]
[![](https://img.shields.io/twitter/follow/AntDesignUI.svg?label=Ant%20Design&style=social)](https://twitter.com/AntDesignUI) [![Gitter](https://img.shields.io/gitter/room/ant-design/ant-design-english.svg?style=flat-square&logoWidth=20&logo=data%3Aimage%2Fsvg%2Bxml%3Bbase64%2CPD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4NCjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgd2lkdGg9IjEyMzUiIGhlaWdodD0iNjUwIiB2aWV3Qm94PSIwIDAgNzQxMCAzOTAwIj4NCjxyZWN0IHdpZHRoPSI3NDEwIiBoZWlnaHQ9IjM5MDAiIGZpbGw9IiNiMjIyMzQiLz4NCjxwYXRoIGQ9Ik0wLDQ1MEg3NDEwbTAsNjAwSDBtMCw2MDBINzQxMG0wLDYwMEgwbTAsNjAwSDc0MTBtMCw2MDBIMCIgc3Ryb2tlPSIjZmZmIiBzdHJva2Utd2lkdGg9IjMwMCIvPg0KPHJlY3Qgd2lkdGg9IjI5NjQiIGhlaWdodD0iMjEwMCIgZmlsbD0iIzNjM2I2ZSIvPg0KPGcgZmlsbD0iI2ZmZiI%2BDQo8ZyBpZD0iczE4Ij4NCjxnIGlkPSJzOSI%2BDQo8ZyBpZD0iczUiPg0KPGcgaWQ9InM0Ij4NCjxwYXRoIGlkPSJzIiBkPSJNMjQ3LDkwIDMxNy41MzQyMzAsMzA3LjA4MjAzOSAxMzIuODczMjE4LDE3Mi45MTc5NjFIMzYxLjEyNjc4MkwxNzYuNDY1NzcwLDMwNy4wODIwMzl6Ii8%2BDQo8dXNlIHhsaW5rOmhyZWY9IiNzIiB5PSI0MjAiLz4NCjx1c2UgeGxpbms6aHJlZj0iI3MiIHk9Ijg0MCIvPg0KPHVzZSB4bGluazpocmVmPSIjcyIgeT0iMTI2MCIvPg0KPC9nPg0KPHVzZSB4bGluazpocmVmPSIjcyIgeT0iMTY4MCIvPg0KPC9nPg0KPHVzZSB4bGluazpocmVmPSIjczQiIHg9IjI0NyIgeT0iMjEwIi8%2BDQo8L2c%2BDQo8dXNlIHhsaW5rOmhyZWY9IiNzOSIgeD0iNDk0Ii8%2BDQo8L2c%2BDQo8dXNlIHhsaW5rOmhyZWY9IiNzMTgiIHg9Ijk4OCIvPg0KPHVzZSB4bGluazpocmVmPSIjczkiIHg9IjE5NzYiLz4NCjx1c2UgeGxpbms6aHJlZj0iI3M1IiB4PSIyNDcwIi8%2BDQo8L2c%2BDQo8L3N2Zz4%3D)](https://gitter.im/ant-design/ant-design-english?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) [![Join the chat at https://gitter.im/ant-design/ant-design](https://img.shields.io/gitter/room/ant-design/ant-design.svg?style=flat-square&logoWidth=20&logo=data%3Aimage%2Fsvg%2Bxml%3Bbase64%2CPD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4NCjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgd2lkdGg9IjkwMCIgaGVpZ2h0PSI2MDAiIHZpZXdCb3g9IjAgMCAzMCAyMCI%2BDQo8ZGVmcz4NCjxwYXRoIGlkPSJzIiBkPSJNMCwtMSAwLjU4Nzc4NSwwLjgwOTAxNyAtMC45NTEwNTcsLTAuMzA5MDE3SDAuOTUxMDU3TC0wLjU4Nzc4NSwwLjgwOTAxN3oiIGZpbGw9IiNmZmRlMDAiLz4NCjwvZGVmcz4NCjxyZWN0IHdpZHRoPSIzMCIgaGVpZ2h0PSIyMCIgZmlsbD0iI2RlMjkxMCIvPg0KPHVzZSB4bGluazpocmVmPSIjcyIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoNSw1KSBzY2FsZSgzKSIvPg0KPHVzZSB4bGluazpocmVmPSIjcyIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMTAsMikgcm90YXRlKDIzLjAzNjI0MykiLz4NCjx1c2UgeGxpbms6aHJlZj0iI3MiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDEyLDQpIHJvdGF0ZSg0NS44Njk4OTgpIi8%2BDQo8dXNlIHhsaW5rOmhyZWY9IiNzIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgxMiw3KSByb3RhdGUoNjkuOTQ1Mzk2KSIvPg0KPHVzZSB4bGluazpocmVmPSIjcyIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMTAsOSkgcm90YXRlKDIwLjY1OTgwOCkiLz4NCjwvc3ZnPg%3D%3D)](https://gitter.im/ant-design/ant-design?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![Follow Twitter][twitter-image]][twitter-url] [![Gitter][gitter-english-image]][gitter-english-url] [![Gitter][gitter-chinese-image]][gitter-chinese-url] [![[SemVer stability]][semver-stability-image]][semver-stability-url]
[npm-image]: http://img.shields.io/npm/v/antd.svg?style=flat-square
[npm-url]: http://npmjs.org/package/antd
[circleci-image]: https://img.shields.io/travis/com/ant-design/ant-design.svg?style=flat-square
[circleci-url]: https://travis-ci.com/ant-design/ant-design
[github-action-image]: https://github.com/ant-design/ant-design/workflows/test/badge.svg
[github-action-url]: https://github.com/ant-design/ant-design/actions?query=workflow%3Atest
[codecov-image]: https://img.shields.io/codecov/c/github/ant-design/ant-design/master.svg?style=flat-square
[codecov-url]: https://codecov.io/gh/ant-design/ant-design/branch/master
[david-image]: https://img.shields.io/david/ant-design/ant-design?style=flat-square
[david-dev-url]: https://david-dm.org/ant-design/ant-design?type=dev
[david-dev-image]: https://img.shields.io/david/dev/ant-design/ant-design?style=flat-square
[david-url]: https://david-dm.org/ant-design/ant-design
[download-image]: https://img.shields.io/npm/dm/antd.svg?style=flat-square
[download-url]: https://npmjs.org/package/antd
[lgtm-image]: https://flat.badgen.net/lgtm/alerts/g/ant-design/ant-design
[lgtm-url]: https://lgtm.com/projects/g/ant-design/ant-design/alerts/
[fossa-image]: https://app.fossa.io/api/projects/git%2Bgithub.com%2Fant-design%2Fant-design.svg?type=shield
[fossa-url]: https://app.fossa.io/projects/git%2Bgithub.com%2Fant-design%2Fant-design?ref=badge_shield
[help-wanted-image]: https://flat.badgen.net/github/label-issues/ant-design/ant-design/help%20wanted/open
[help-wanted-url]: https://github.com/ant-design/ant-design/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22
[twitter-image]: https://img.shields.io/twitter/follow/AntDesignUI.svg?label=Ant%20Design&style=social
[twitter-url]: https://twitter.com/AntDesignUI
[gitter-english-image]: https://img.shields.io/gitter/room/ant-design/ant-design-english.svg?style=flat-square&logoWidth=18&logo=data%3Aimage%2Fsvg%2Bxml%3Bbase64%2CPD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4NCjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgd2lkdGg9IjEyMzUiIGhlaWdodD0iNjUwIiB2aWV3Qm94PSIwIDAgNzQxMCAzOTAwIj4NCjxyZWN0IHdpZHRoPSI3NDEwIiBoZWlnaHQ9IjM5MDAiIGZpbGw9IiNiMjIyMzQiLz4NCjxwYXRoIGQ9Ik0wLDQ1MEg3NDEwbTAsNjAwSDBtMCw2MDBINzQxMG0wLDYwMEgwbTAsNjAwSDc0MTBtMCw2MDBIMCIgc3Ryb2tlPSIjZmZmIiBzdHJva2Utd2lkdGg9IjMwMCIvPg0KPHJlY3Qgd2lkdGg9IjI5NjQiIGhlaWdodD0iMjEwMCIgZmlsbD0iIzNjM2I2ZSIvPg0KPGcgZmlsbD0iI2ZmZiI%2BDQo8ZyBpZD0iczE4Ij4NCjxnIGlkPSJzOSI%2BDQo8ZyBpZD0iczUiPg0KPGcgaWQ9InM0Ij4NCjxwYXRoIGlkPSJzIiBkPSJNMjQ3LDkwIDMxNy41MzQyMzAsMzA3LjA4MjAzOSAxMzIuODczMjE4LDE3Mi45MTc5NjFIMzYxLjEyNjc4MkwxNzYuNDY1NzcwLDMwNy4wODIwMzl6Ii8%2BDQo8dXNlIHhsaW5rOmhyZWY9IiNzIiB5PSI0MjAiLz4NCjx1c2UgeGxpbms6aHJlZj0iI3MiIHk9Ijg0MCIvPg0KPHVzZSB4bGluazpocmVmPSIjcyIgeT0iMTI2MCIvPg0KPC9nPg0KPHVzZSB4bGluazpocmVmPSIjcyIgeT0iMTY4MCIvPg0KPC9nPg0KPHVzZSB4bGluazpocmVmPSIjczQiIHg9IjI0NyIgeT0iMjEwIi8%2BDQo8L2c%2BDQo8dXNlIHhsaW5rOmhyZWY9IiNzOSIgeD0iNDk0Ii8%2BDQo8L2c%2BDQo8dXNlIHhsaW5rOmhyZWY9IiNzMTgiIHg9Ijk4OCIvPg0KPHVzZSB4bGluazpocmVmPSIjczkiIHg9IjE5NzYiLz4NCjx1c2UgeGxpbms6aHJlZj0iI3M1IiB4PSIyNDcwIi8%2BDQo8L2c%2BDQo8L3N2Zz4%3D
[gitter-english-url]: https://gitter.im/ant-design/ant-design-english?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge
[gitter-chinese-image]: https://img.shields.io/gitter/room/ant-design/ant-design.svg?style=flat-square&logoWidth=18&logo=data%3Aimage%2Fsvg%2Bxml%3Bbase64%2CPD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4NCjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgd2lkdGg9IjkwMCIgaGVpZ2h0PSI2MDAiIHZpZXdCb3g9IjAgMCAzMCAyMCI%2BDQo8ZGVmcz4NCjxwYXRoIGlkPSJzIiBkPSJNMCwtMSAwLjU4Nzc4NSwwLjgwOTAxNyAtMC45NTEwNTcsLTAuMzA5MDE3SDAuOTUxMDU3TC0wLjU4Nzc4NSwwLjgwOTAxN3oiIGZpbGw9IiNmZmRlMDAiLz4NCjwvZGVmcz4NCjxyZWN0IHdpZHRoPSIzMCIgaGVpZ2h0PSIyMCIgZmlsbD0iI2RlMjkxMCIvPg0KPHVzZSB4bGluazpocmVmPSIjcyIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoNSw1KSBzY2FsZSgzKSIvPg0KPHVzZSB4bGluazpocmVmPSIjcyIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMTAsMikgcm90YXRlKDIzLjAzNjI0MykiLz4NCjx1c2UgeGxpbms6aHJlZj0iI3MiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDEyLDQpIHJvdGF0ZSg0NS44Njk4OTgpIi8%2BDQo8dXNlIHhsaW5rOmhyZWY9IiNzIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgxMiw3KSByb3RhdGUoNjkuOTQ1Mzk2KSIvPg0KPHVzZSB4bGluazpocmVmPSIjcyIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMTAsOSkgcm90YXRlKDIwLjY1OTgwOCkiLz4NCjwvc3ZnPg%3D%3D
[gitter-chinese-url]: https://gitter.im/ant-design/ant-design?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge
[semver-stability-url]: https://dependabot.com/compatibility-score.html/?dependency-name=antd&package-manager=npm_and_yarn&new-version=latest
[semver-stability-image]: https://api.dependabot.com/badges/compatibility_score?dependency-name=antd&package-manager=npm_and_yarn&target-version=latest&version-scheme=semver
</div>
[![](https://gw.alipayobjects.com/mdn/rms_08e378/afts/img/A*Ey3wTo-5__QAAAAAAAAAAABkARQnAQ)](http://ant.design/index-cn)
[![](https://gw.alipayobjects.com/mdn/rms_08e378/afts/img/A*Ey3wTo-5__QAAAAAAAAAAABkARQnAQ)](https://ant.design/index-cn)
[English](./README.md) | [Português](./README-pt_BR.md) | 简体中文
@@ -31,9 +60,9 @@
- 🌍 数十个国际化语言支持。
- 🎨 深入每个细节的主题定制能力。
## 🖥 支持环境
## 🖥 兼容环境
- 现代浏览器和 IE11 及以上
- 现代浏览器和 IE11(需要 [polyfills](https://ant.design/docs/react/getting-started-cn#兼容性)
- 支持服务端渲染。
- [Electron](https://www.electronjs.org/)
@@ -70,8 +99,6 @@ const App = () => (
import 'antd/dist/antd.css'; // or 'antd/dist/antd.less'
```
你也可以使用 [babel-plugin-import](https://ant.design/docs/react/getting-started-cn#按需加载)。
### 🌈 定制主题
参考 [定制主题](https://ant.design/docs/react/customize-theme-cn) 文档。
@@ -82,13 +109,14 @@ import 'antd/dist/antd.css'; // or 'antd/dist/antd.less'
## 🌍 国际化
参考 [国际化文档](http://ant.design/docs/react/i18n-cn)。
参考 [国际化文档](https://ant.design/docs/react/i18n-cn)。
## 🔗 链接
- [首页](http://ant.design/)
- [组件库](http://ant.design/docs/react/introduce)
- [首页](https://ant.design/)
- [组件库](https://ant.design/components/overview-cn)
- [Ant Design Pro](http://pro.ant.design/)
- [Ant Design Charts](https://charts.ant.design)
- [更新日志](CHANGELOG.en-US.md)
- [React 底层基础组件](http://react-component.github.io/)
- [移动端组件](http://mobile.ant.design)
@@ -106,7 +134,7 @@ import 'antd/dist/antd.css'; // or 'antd/dist/antd.less'
- [常见问题](https://ant.design/docs/react/faq-cn)
- [CodeSandbox 模板](https://u.ant.design/codesandbox-repro) for bug reports
- [Awesome Ant Design](https://github.com/websemantics/awesome-ant-design)
- [定制主题](http://ant.design/docs/react/customize-theme-cn)
- [定制主题](https://ant.design/docs/react/customize-theme-cn)
- [成为社区协作成员](https://github.com/ant-design/ant-design/wiki/Collaborators#how-to-apply-for-being-a-collaborator)
## ⌨️ 本地开发

View File

@@ -1,5 +1,5 @@
<p align="center">
<a href="http://ant.design">
<a href="https://ant.design">
<img width="200" src="https://gw.alipayobjects.com/zos/rmsportal/KDpgvguMpGfqaHPjicRK.svg">
</a>
</p>
@@ -14,7 +14,7 @@ An enterprise-class UI design language and React UI library.
[![david deps][david-image]][david-url] [![david devDeps][david-dev-image]][david-dev-url] [![Total alerts][lgtm-image]][lgtm-url] [![FOSSA Status][fossa-image]][fossa-url] [![Issues need help][help-wanted-image]][help-wanted-url]
[![Follow Twitter][twitter-image]][twitter-url] [![Gitter][gitter-english-image]][gitter-english-url] [![Gitter][gitter-chinese-image]][gitter-chinese-url]
[![Follow Twitter][twitter-image]][twitter-url] [![Gitter][gitter-english-image]][gitter-english-url] [![Gitter][gitter-chinese-image]][gitter-chinese-url] [![[SemVer stability]][semver-stability-image]][semver-stability-url]
[npm-image]: http://img.shields.io/npm/v/antd.svg?style=flat-square
[npm-url]: http://npmjs.org/package/antd
@@ -24,30 +24,30 @@ An enterprise-class UI design language and React UI library.
[github-action-url]: https://github.com/ant-design/ant-design/actions?query=workflow%3Atest
[codecov-image]: https://img.shields.io/codecov/c/github/ant-design/ant-design/master.svg?style=flat-square
[codecov-url]: https://codecov.io/gh/ant-design/ant-design/branch/master
[david-image]: https://david-dm.org/ant-design/ant-design/status.svg?style=flat-square
[david-image]: https://img.shields.io/david/ant-design/ant-design?style=flat-square
[david-dev-url]: https://david-dm.org/ant-design/ant-design?type=dev
[david-dev-image]: https://david-dm.org/ant-design/ant-design/dev-status.svg?style=flat-square
[david-dev-image]: https://img.shields.io/david/dev/ant-design/ant-design?style=flat-square
[david-url]: https://david-dm.org/ant-design/ant-design
[download-image]: https://img.shields.io/npm/dm/antd.svg?style=flat-square
[download-url]: https://npmjs.org/package/antd
[lgtm-image]: https://flat.badgen.net/lgtm/alerts/g/ant-design/ant-design
[lgtm-url]: https://lgtm.com/projects/g/ant-design/ant-design/alerts/
[lgtm-image]: https://flat.badgen.net/lgtm/alerts/g/ant-design/ant-design
[lgtm-url]: https://lgtm.com/projects/g/ant-design/ant-design/alerts/
[fossa-image]: https://app.fossa.io/api/projects/git%2Bgithub.com%2Fant-design%2Fant-design.svg?type=shield
[fossa-url]: https://app.fossa.io/projects/git%2Bgithub.com%2Fant-design%2Fant-design?ref=badge_shield
[help-wanted-image]: https://flat.badgen.net/github/label-issues/ant-design/ant-design/help%20wanted/open
[help-wanted-url]: https://github.com/ant-design/ant-design/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22
[twitter-image]: https://img.shields.io/twitter/follow/AntDesignUI.svg?label=Ant%20Design&style=social
[twitter-url]: https://twitter.com/AntDesignUI
[gitter-english-image]: https://img.shields.io/gitter/room/ant-design/ant-design-english.svg?style=flat-square&logoWidth=20&logo=data%3Aimage%2Fsvg%2Bxml%3Bbase64%2CPD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4NCjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgd2lkdGg9IjEyMzUiIGhlaWdodD0iNjUwIiB2aWV3Qm94PSIwIDAgNzQxMCAzOTAwIj4NCjxyZWN0IHdpZHRoPSI3NDEwIiBoZWlnaHQ9IjM5MDAiIGZpbGw9IiNiMjIyMzQiLz4NCjxwYXRoIGQ9Ik0wLDQ1MEg3NDEwbTAsNjAwSDBtMCw2MDBINzQxMG0wLDYwMEgwbTAsNjAwSDc0MTBtMCw2MDBIMCIgc3Ryb2tlPSIjZmZmIiBzdHJva2Utd2lkdGg9IjMwMCIvPg0KPHJlY3Qgd2lkdGg9IjI5NjQiIGhlaWdodD0iMjEwMCIgZmlsbD0iIzNjM2I2ZSIvPg0KPGcgZmlsbD0iI2ZmZiI%2BDQo8ZyBpZD0iczE4Ij4NCjxnIGlkPSJzOSI%2BDQo8ZyBpZD0iczUiPg0KPGcgaWQ9InM0Ij4NCjxwYXRoIGlkPSJzIiBkPSJNMjQ3LDkwIDMxNy41MzQyMzAsMzA3LjA4MjAzOSAxMzIuODczMjE4LDE3Mi45MTc5NjFIMzYxLjEyNjc4MkwxNzYuNDY1NzcwLDMwNy4wODIwMzl6Ii8%2BDQo8dXNlIHhsaW5rOmhyZWY9IiNzIiB5PSI0MjAiLz4NCjx1c2UgeGxpbms6aHJlZj0iI3MiIHk9Ijg0MCIvPg0KPHVzZSB4bGluazpocmVmPSIjcyIgeT0iMTI2MCIvPg0KPC9nPg0KPHVzZSB4bGluazpocmVmPSIjcyIgeT0iMTY4MCIvPg0KPC9nPg0KPHVzZSB4bGluazpocmVmPSIjczQiIHg9IjI0NyIgeT0iMjEwIi8%2BDQo8L2c%2BDQo8dXNlIHhsaW5rOmhyZWY9IiNzOSIgeD0iNDk0Ii8%2BDQo8L2c%2BDQo8dXNlIHhsaW5rOmhyZWY9IiNzMTgiIHg9Ijk4OCIvPg0KPHVzZSB4bGluazpocmVmPSIjczkiIHg9IjE5NzYiLz4NCjx1c2UgeGxpbms6aHJlZj0iI3M1IiB4PSIyNDcwIi8%2BDQo8L2c%2BDQo8L3N2Zz4%3D
[gitter-english-image]: https://img.shields.io/gitter/room/ant-design/ant-design-english.svg?style=flat-square&logoWidth=18&logo=data%3Aimage%2Fsvg%2Bxml%3Bbase64%2CPD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4NCjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgd2lkdGg9IjEyMzUiIGhlaWdodD0iNjUwIiB2aWV3Qm94PSIwIDAgNzQxMCAzOTAwIj4NCjxyZWN0IHdpZHRoPSI3NDEwIiBoZWlnaHQ9IjM5MDAiIGZpbGw9IiNiMjIyMzQiLz4NCjxwYXRoIGQ9Ik0wLDQ1MEg3NDEwbTAsNjAwSDBtMCw2MDBINzQxMG0wLDYwMEgwbTAsNjAwSDc0MTBtMCw2MDBIMCIgc3Ryb2tlPSIjZmZmIiBzdHJva2Utd2lkdGg9IjMwMCIvPg0KPHJlY3Qgd2lkdGg9IjI5NjQiIGhlaWdodD0iMjEwMCIgZmlsbD0iIzNjM2I2ZSIvPg0KPGcgZmlsbD0iI2ZmZiI%2BDQo8ZyBpZD0iczE4Ij4NCjxnIGlkPSJzOSI%2BDQo8ZyBpZD0iczUiPg0KPGcgaWQ9InM0Ij4NCjxwYXRoIGlkPSJzIiBkPSJNMjQ3LDkwIDMxNy41MzQyMzAsMzA3LjA4MjAzOSAxMzIuODczMjE4LDE3Mi45MTc5NjFIMzYxLjEyNjc4MkwxNzYuNDY1NzcwLDMwNy4wODIwMzl6Ii8%2BDQo8dXNlIHhsaW5rOmhyZWY9IiNzIiB5PSI0MjAiLz4NCjx1c2UgeGxpbms6aHJlZj0iI3MiIHk9Ijg0MCIvPg0KPHVzZSB4bGluazpocmVmPSIjcyIgeT0iMTI2MCIvPg0KPC9nPg0KPHVzZSB4bGluazpocmVmPSIjcyIgeT0iMTY4MCIvPg0KPC9nPg0KPHVzZSB4bGluazpocmVmPSIjczQiIHg9IjI0NyIgeT0iMjEwIi8%2BDQo8L2c%2BDQo8dXNlIHhsaW5rOmhyZWY9IiNzOSIgeD0iNDk0Ii8%2BDQo8L2c%2BDQo8dXNlIHhsaW5rOmhyZWY9IiNzMTgiIHg9Ijk4OCIvPg0KPHVzZSB4bGluazpocmVmPSIjczkiIHg9IjE5NzYiLz4NCjx1c2UgeGxpbms6aHJlZj0iI3M1IiB4PSIyNDcwIi8%2BDQo8L2c%2BDQo8L3N2Zz4%3D
[gitter-english-url]: https://gitter.im/ant-design/ant-design-english?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge
[gitter-chinese-image]: https://img.shields.io/gitter/room/ant-design/ant-design.svg?style=flat-square&logoWidth=20&logo=data%3Aimage%2Fsvg%2Bxml%3Bbase64%2CPD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4NCjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgd2lkdGg9IjkwMCIgaGVpZ2h0PSI2MDAiIHZpZXdCb3g9IjAgMCAzMCAyMCI%2BDQo8ZGVmcz4NCjxwYXRoIGlkPSJzIiBkPSJNMCwtMSAwLjU4Nzc4NSwwLjgwOTAxNyAtMC45NTEwNTcsLTAuMzA5MDE3SDAuOTUxMDU3TC0wLjU4Nzc4NSwwLjgwOTAxN3oiIGZpbGw9IiNmZmRlMDAiLz4NCjwvZGVmcz4NCjxyZWN0IHdpZHRoPSIzMCIgaGVpZ2h0PSIyMCIgZmlsbD0iI2RlMjkxMCIvPg0KPHVzZSB4bGluazpocmVmPSIjcyIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoNSw1KSBzY2FsZSgzKSIvPg0KPHVzZSB4bGluazpocmVmPSIjcyIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMTAsMikgcm90YXRlKDIzLjAzNjI0MykiLz4NCjx1c2UgeGxpbms6aHJlZj0iI3MiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDEyLDQpIHJvdGF0ZSg0NS44Njk4OTgpIi8%2BDQo8dXNlIHhsaW5rOmhyZWY9IiNzIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgxMiw3KSByb3RhdGUoNjkuOTQ1Mzk2KSIvPg0KPHVzZSB4bGluazpocmVmPSIjcyIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMTAsOSkgcm90YXRlKDIwLjY1OTgwOCkiLz4NCjwvc3ZnPg%3D%3D
[gitter-chinese-image]: https://img.shields.io/gitter/room/ant-design/ant-design.svg?style=flat-square&logoWidth=18&logo=data%3Aimage%2Fsvg%2Bxml%3Bbase64%2CPD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4NCjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgd2lkdGg9IjkwMCIgaGVpZ2h0PSI2MDAiIHZpZXdCb3g9IjAgMCAzMCAyMCI%2BDQo8ZGVmcz4NCjxwYXRoIGlkPSJzIiBkPSJNMCwtMSAwLjU4Nzc4NSwwLjgwOTAxNyAtMC45NTEwNTcsLTAuMzA5MDE3SDAuOTUxMDU3TC0wLjU4Nzc4NSwwLjgwOTAxN3oiIGZpbGw9IiNmZmRlMDAiLz4NCjwvZGVmcz4NCjxyZWN0IHdpZHRoPSIzMCIgaGVpZ2h0PSIyMCIgZmlsbD0iI2RlMjkxMCIvPg0KPHVzZSB4bGluazpocmVmPSIjcyIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoNSw1KSBzY2FsZSgzKSIvPg0KPHVzZSB4bGluazpocmVmPSIjcyIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMTAsMikgcm90YXRlKDIzLjAzNjI0MykiLz4NCjx1c2UgeGxpbms6aHJlZj0iI3MiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDEyLDQpIHJvdGF0ZSg0NS44Njk4OTgpIi8%2BDQo8dXNlIHhsaW5rOmhyZWY9IiNzIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgxMiw3KSByb3RhdGUoNjkuOTQ1Mzk2KSIvPg0KPHVzZSB4bGluazpocmVmPSIjcyIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMTAsOSkgcm90YXRlKDIwLjY1OTgwOCkiLz4NCjwvc3ZnPg%3D%3D
[gitter-chinese-url]: https://gitter.im/ant-design/ant-design?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge
[semver-stability-url]: https://dependabot.com/compatibility-score.html/?dependency-name=antd&package-manager=npm_and_yarn&new-version=latest
[semver-stability-image]: https://api.dependabot.com/badges/compatibility_score?dependency-name=antd&package-manager=npm_and_yarn&target-version=latest&version-scheme=semver
</div>
[![](https://gw.alipayobjects.com/mdn/rms_08e378/afts/img/A*Yl83RJhUE7kAAAAAAAAAAABkARQnAQ)](http://ant.design)
[![](https://gw.alipayobjects.com/mdn/rms_08e378/afts/img/A*Yl83RJhUE7kAAAAAAAAAAABkARQnAQ)](https://ant.design)
English | [Português](./README-pt_BR.md) | [简体中文](./README-zh_CN.md)
@@ -62,7 +62,7 @@ English | [Português](./README-pt_BR.md) | [简体中文](./README-zh_CN.md)
## 🖥 Environment Support
- Modern browsers and Internet Explorer 11+ (with [polyfills](https://ant.design/docs/react/getting-started#Compatibility))
- Modern browsers and Internet Explorer 11 (with [polyfills](https://stackoverflow.com/questions/57020976/polyfills-in-2019-for-ie11))
- Server-side Rendering
- [Electron](https://www.electronjs.org/)
@@ -88,7 +88,7 @@ import { Button, DatePicker } from 'antd';
const App = () => (
<>
<Button type="primary">PRESS ME</Button>
<DatePicker />
<DatePicker placeholder="select date" />
</>
);
```
@@ -99,21 +99,20 @@ And import style manually:
import 'antd/dist/antd.css'; // or 'antd/dist/antd.less'
```
Or use [babel-plugin-import](https://ant.design/docs/react/getting-started#Import-on-Demand).
### TypeScript
See [Use in TypeScript](https://ant.design/docs/react/use-in-typescript).
`antd` is written in TypeScript with complete definitions, check [Use in TypeScript](https://ant.design/docs/react/use-in-typescript) to getting started.
## 🌍 Internationalization
See [i18n](http://ant.design/docs/react/i18n).
Dozens of languages supported in `antd`, see [i18n](https://ant.design/docs/react/i18n).
## 🔗 Links
- [Home page](http://ant.design/)
- [Components](http://ant.design/docs/react/introduce)
- [Home page](https://ant.design/)
- [Components](https://ant.design/components/overview)
- [Ant Design Pro](http://pro.ant.design/)
- [Ant Design Charts](https://charts.ant.design)
- [Change Log](CHANGELOG.en-US.md)
- [rc-components](http://react-component.github.io/)
- [Mobile UI](http://mobile.ant.design)
@@ -130,7 +129,7 @@ See [i18n](http://ant.design/docs/react/i18n).
- [FAQ](https://ant.design/docs/react/faq)
- [CodeSandbox Template](https://u.ant.design/codesandbox-repro) for bug reports
- [Awesome Ant Design](https://github.com/websemantics/awesome-ant-design)
- [Customize Theme](http://ant.design/docs/react/customize-theme)
- [Customize Theme](https://ant.design/docs/react/customize-theme)
- [How to Apply for Being A Collaborator](https://github.com/ant-design/ant-design/wiki/Collaborators#how-to-apply-for-being-a-collaborator)
## ⌨️ Development

View File

@@ -12,50 +12,106 @@ pool:
vmImage: 'ubuntu-latest'
stages:
- stage: site
jobs:
- job: Build_Site
steps:
- checkout: self
displayName: 'Checkout'
clean: true
fetchDepth: 1
- task: NodeTool@0
displayName: 'Install Node.js'
inputs:
versionSpec: '12.13.1'
- script: npm install
displayName: 'Install modules'
- script: |
node ./scripts/azure-github-comment.js "[![Prepare preview](https://user-images.githubusercontent.com/5378891/72351368-2c979e00-371b-11ea-9652-eb4e825d745e.gif)](https://dev.azure.com/ant-design/ant-design/_build/results?buildId=$(Build.BuildId))"
displayName: 'Comment on github'
- script: npm run site
displayName: 'Build sites'
- script: ls -al _site/
displayName: 'List build'
- script: |
export DEPLOY_DOMAIN=https://preview-${SYSTEM_PULLREQUEST_PULLREQUESTNUMBER}-ant-design.surge.sh
echo "Deploy to $DEPLOY_DOMAIN"
npx surge --project ./_site --domain $DEPLOY_DOMAIN
displayName: 'Deploy Site'
- script: |
export DEPLOY_DOMAIN=https://preview-${SYSTEM_PULLREQUEST_PULLREQUESTNUMBER}-ant-design.surge.sh
node ./scripts/azure-github-comment.js "[<img width="306" src="https://user-images.githubusercontent.com/5378891/72400743-23dbb200-3785-11ea-9d13-1a2d92743846.png">]($DEPLOY_DOMAIN)"
displayName: 'Update comment on github'
- job: Build_Site_Failed
dependsOn: Build_Site
condition: failed()
steps:
- checkout: self
displayName: 'Checkout'
clean: true
fetchDepth: 1
- task: NodeTool@0
displayName: 'Install Node.js'
inputs:
versionSpec: '12.13.1'
- script: npm install
displayName: 'Install modules'
- script: |
node ./scripts/azure-github-comment.js "[<img width="534" src="https://user-images.githubusercontent.com/5378891/75333447-1e63a280-58c1-11ea-975d-235367fd1522.png">](https://dev.azure.com/ant-design/ant-design/_build/results?buildId=$(Build.BuildId))"
displayName: 'Comment on github'
- stage: site
jobs:
- job: Build_Site
steps:
- checkout: self
displayName: 'Checkout'
clean: true
fetchDepth: 1
- task: NodeTool@0
displayName: 'Install Node.js'
inputs:
versionSpec: '12.13.1'
- script: npm install
displayName: 'Install modules'
- script: |
node ./scripts/azure-github-comment.js "[![Prepare preview](https://user-images.githubusercontent.com/5378891/72351368-2c979e00-371b-11ea-9652-eb4e825d745e.gif)](https://dev.azure.com/ant-design/ant-design/_build/results?buildId=$(Build.BuildId))"
displayName: 'Comment on github'
- script: npm run site
displayName: 'Build sites'
- script: ls -al _site/
displayName: 'List build'
- script: |
export DEPLOY_DOMAIN=https://preview-${SYSTEM_PULLREQUEST_PULLREQUESTNUMBER}-ant-design.surge.sh
echo "Deploy to $DEPLOY_DOMAIN"
npx surge --project ./_site --domain $DEPLOY_DOMAIN
displayName: 'Deploy Site'
- script: |
export DEPLOY_DOMAIN=https://preview-${SYSTEM_PULLREQUEST_PULLREQUESTNUMBER}-ant-design.surge.sh
node ./scripts/azure-github-comment.js "[<img width="306" src="https://user-images.githubusercontent.com/5378891/72400743-23dbb200-3785-11ea-9d13-1a2d92743846.png">]($DEPLOY_DOMAIN)"
displayName: 'Update comment on github'
- job: Build_Site_Failed
dependsOn: Build_Site
condition: failed()
steps:
- checkout: self
displayName: 'Checkout'
clean: true
fetchDepth: 1
- task: NodeTool@0
displayName: 'Install Node.js'
inputs:
versionSpec: '12.13.1'
- script: npm install
displayName: 'Install modules'
- script: |
node ./scripts/azure-github-comment.js "[<img width="534" src="https://user-images.githubusercontent.com/5378891/75333447-1e63a280-58c1-11ea-975d-235367fd1522.png">](https://dev.azure.com/ant-design/ant-design/_build/results?buildId=$(Build.BuildId))"
displayName: 'Comment on github'
- stage: ui
dependsOn: []
jobs:
- job: UI_Test
steps:
- checkout: self
displayName: 'Checkout'
clean: true
fetchDepth: 1
- task: NodeTool@0
displayName: 'Install Node.js'
inputs:
versionSpec: '12.16.3'
- script: npm install
displayName: 'Install modules'
- script: |
node ./scripts/azure-github-comment.js -ui "[![UI Testing](https://user-images.githubusercontent.com/14831261/82744255-6bfc8800-9da8-11ea-9017-857933e8433b.gif)](https://dev.azure.com/ant-design/ant-design/_build/results?buildId=$(Build.BuildId))"
displayName: 'Comment on github'
- script: npm run test-image
displayName: 'UI Test'
- task: PublishPipelineArtifact@1
inputs:
targetPath: $(System.DefaultWorkingDirectory)/jest-stare
artifactName: jestStare
condition: failed()
- script: |
node ./scripts/azure-github-comment.js -ui "[<img width="306" src="https://user-images.githubusercontent.com/14831261/82744259-6e5ee200-9da8-11ea-8479-685f6e280b77.jpg">](https://dev.azure.com/ant-design/ant-design/_build/results?buildId=$(Build.BuildId))"
displayName: 'Update comment on github'
- job: UI_Test_Failed
dependsOn: UI_Test
condition: failed()
steps:
- checkout: self
displayName: 'Checkout'
clean: true
fetchDepth: 1
- task: NodeTool@0
displayName: 'Install Node.js'
inputs:
versionSpec: '12.13.1'
- script: npm install
displayName: 'Install modules'
- task: DownloadPipelineArtifact@2
inputs:
artifact: jestStare
path: './jest-stare'
- script: ls -al ./jest-stare
displayName: 'List report'
- script: |
export DEPLOY_DOMAIN=https://ui-test-${SYSTEM_PULLREQUEST_PULLREQUESTNUMBER}-ant-design.surge.sh
echo "Deploy to $DEPLOY_DOMAIN"
npx surge --project ./jest-stare --domain $DEPLOY_DOMAIN
displayName: 'Deploy Report Site'
- script: |
node ./scripts/azure-github-comment.js -ui "[<img width="306" src="https://user-images.githubusercontent.com/14831261/82744257-6dc64b80-9da8-11ea-80cf-05b2279a5602.jpg">](https://ui-test-${SYSTEM_PULLREQUEST_PULLREQUESTNUMBER}-ant-design.surge.sh)"
displayName: 'Update comment on github'

View File

@@ -1,58 +0,0 @@
const __NULL__ = { notExist: true };
export function spyElementPrototypes(Element, properties) {
const propNames = Object.keys(properties);
const originDescriptors = {};
propNames.forEach(propName => {
const originDescriptor = Object.getOwnPropertyDescriptor(Element.prototype, propName);
originDescriptors[propName] = originDescriptor || __NULL__;
const spyProp = properties[propName];
if (typeof spyProp === 'function') {
// If is a function
Element.prototype[propName] = function spyFunc(...args) {
return spyProp.call(this, originDescriptor, ...args);
};
} else {
// Otherwise tread as a property
Object.defineProperty(Element.prototype, propName, {
...spyProp,
set(value) {
if (spyProp.set) {
return spyProp.set.call(this, originDescriptor, value);
}
return originDescriptor.set(value);
},
get() {
if (spyProp.get) {
return spyProp.get.call(this, originDescriptor);
}
return originDescriptor.get();
},
});
}
});
return {
mockRestore() {
propNames.forEach(propName => {
const originDescriptor = originDescriptors[propName];
if (originDescriptor === __NULL__) {
delete Element.prototype[propName];
} else if (typeof originDescriptor === 'function') {
Element.prototype[propName] = originDescriptor;
} else {
Object.defineProperty(Element.prototype, propName, originDescriptor);
}
});
},
};
}
export function spyElementPrototype(Element, propName, property) {
return spyElementPrototypes(Element, {
[propName]: property,
});
}

View File

@@ -1,11 +1,57 @@
/**
* @jest-environment node
*/
import getScroll from '../getScroll';
describe('getScroll', () => {
it('getScroll return 0 in node envioronment', async () => {
it('getScroll target null', async () => {
expect(getScroll(null, true)).toBe(0);
expect(getScroll(null, false)).toBe(0);
});
it('getScroll window', async () => {
const scrollToSpy = jest.spyOn(window, 'scrollTo').mockImplementation((x, y) => {
window.pageXOffset = x;
window.pageYOffset = y;
});
window.scrollTo(200, 400);
expect(getScroll(window, true)).toBe(400);
expect(getScroll(window, false)).toBe(200);
scrollToSpy.mockRestore();
});
it('getScroll document', async () => {
const scrollToSpy = jest.spyOn(window, 'scrollTo').mockImplementation((x, y) => {
document.documentElement.scrollLeft = x;
document.documentElement.scrollTop = y;
});
window.scrollTo(200, 400);
expect(getScroll(document, true)).toBe(400);
expect(getScroll(document, false)).toBe(200);
scrollToSpy.mockRestore();
});
it('getScroll div', async () => {
const div = document.createElement('div');
const scrollToSpy = jest.spyOn(window, 'scrollTo').mockImplementation((x, y) => {
div.scrollLeft = x;
div.scrollTop = y;
});
window.scrollTo(200, 400);
expect(getScroll(div, true)).toBe(400);
expect(getScroll(div, false)).toBe(200);
scrollToSpy.mockRestore();
});
it('getScroll documentElement', async () => {
const div = {};
const scrollToSpy = jest.spyOn(window, 'scrollTo').mockImplementation((x, y) => {
div.scrollLeft = null;
div.scrollTop = null;
div.documentElement = {};
div.documentElement.scrollLeft = x;
div.documentElement.scrollTop = y;
});
window.scrollTo(200, 400);
expect(getScroll(div, true)).toBe(400);
expect(getScroll(div, false)).toBe(200);
scrollToSpy.mockRestore();
});
});

View File

@@ -0,0 +1,11 @@
/**
* @jest-environment node
*/
import getScroll from '../getScroll';
describe('getScroll node', () => {
it('getScroll return 0 in node environment', async () => {
expect(getScroll(null, true)).toBe(0);
expect(getScroll(null, false)).toBe(0);
});
});

View File

@@ -46,4 +46,21 @@ describe('Test ScrollTo function', () => {
await sleep(20);
expect(div.scrollTop).toBe(1000);
});
it('test getContainer document - option', async () => {
scrollTo(1000, {
getContainer: () => document,
});
await sleep(20);
expect(document.documentElement.scrollTop).toBe(1000);
});
it('test duration - option', async () => {
scrollTo(1000, {
duration: 1100,
getContainer: () => document,
});
await sleep(20);
expect(document.documentElement.scrollTop).toBe(1000);
});
});

View File

@@ -0,0 +1,12 @@
import React from 'react';
import { mount } from 'enzyme';
import TransButton from '../transButton';
describe('transButton component', () => {
it('disabled should update style', () => {
const wrapper = mount(<TransButton disabled />);
expect(wrapper.find('div').first().props().style).toEqual(
expect.objectContaining({ pointerEvents: 'none' }),
);
});
});

View File

@@ -18,24 +18,42 @@ describe('Wave component', () => {
it('isHidden works', () => {
const TEST_NODE_ENV = process.env.NODE_ENV;
process.env.NODE_ENV = 'development';
const wrapper = mount(<Wave><button type="button">button</button></Wave>);
const wrapper = mount(
<Wave>
<button type="button">button</button>
</Wave>,
);
expect(wrapper.find('button').getDOMNode().className).toBe('');
wrapper.find('button').getDOMNode().click();
expect(wrapper.find('button').getDOMNode().hasAttribute('ant-click-animating-without-extra-node')).toBe(false);
expect(
wrapper.find('button').getDOMNode().hasAttribute('ant-click-animating-without-extra-node'),
).toBe(false);
wrapper.unmount();
process.env.NODE_ENV = TEST_NODE_ENV;
});
it('isHidden is mocked', () => {
const wrapper = mount(<Wave><button type="button">button</button></Wave>);
const wrapper = mount(
<Wave>
<button type="button">button</button>
</Wave>,
);
expect(wrapper.find('button').getDOMNode().className).toBe('');
wrapper.find('button').getDOMNode().click();
expect(wrapper.find('button').getDOMNode().getAttribute('ant-click-animating-without-extra-node')).toBe('false');
expect(
wrapper.find('button').getDOMNode().getAttribute('ant-click-animating-without-extra-node'),
).toBe('false');
wrapper.unmount();
});
it('wave color is grey', async () => {
const wrapper = mount(<Wave><button type="button" style={{ borderColor: 'rgb(0, 0, 0)' }}>button</button></Wave>);
const wrapper = mount(
<Wave>
<button type="button" style={{ borderColor: 'rgb(0, 0, 0)' }}>
button
</button>
</Wave>,
);
wrapper.find('button').getDOMNode().click();
await sleep(0);
const styles = document.getElementsByTagName('style');
@@ -44,7 +62,13 @@ describe('Wave component', () => {
});
it('wave color is not grey', async () => {
const wrapper = mount(<Wave><button type="button" style={{ borderColor: 'red' }}>button</button></Wave>);
const wrapper = mount(
<Wave>
<button type="button" style={{ borderColor: 'red' }}>
button
</button>
</Wave>,
);
wrapper.find('button').getDOMNode().click();
await sleep(200);
const styles = document.getElementsByTagName('style');
@@ -54,7 +78,11 @@ describe('Wave component', () => {
});
it('read wave color from border-top-color', async () => {
const wrapper = mount(<Wave><div style={{ borderTopColor: 'blue' }}>button</div></Wave>);
const wrapper = mount(
<Wave>
<div style={{ borderTopColor: 'blue' }}>button</div>
</Wave>,
);
wrapper.find('div').getDOMNode().click();
await sleep(0);
const styles = document.getElementsByTagName('style');
@@ -64,7 +92,11 @@ describe('Wave component', () => {
});
it('read wave color from background color', async () => {
const wrapper = mount(<Wave><div style={{ backgroundColor: 'green' }}>button</div></Wave>);
const wrapper = mount(
<Wave>
<div style={{ backgroundColor: 'green' }}>button</div>
</Wave>,
);
wrapper.find('div').getDOMNode().click();
await sleep(0);
const styles = document.getElementsByTagName('style');
@@ -74,7 +106,11 @@ describe('Wave component', () => {
});
it('read wave color from border firstly', async () => {
const wrapper = mount(<Wave><div style={{ borderColor: 'yellow', backgroundColor: 'green' }}>button</div></Wave>);
const wrapper = mount(
<Wave>
<div style={{ borderColor: 'yellow', backgroundColor: 'green' }}>button</div>
</Wave>,
);
wrapper.find('div').getDOMNode().click();
await sleep(0);
const styles = document.getElementsByTagName('style');
@@ -84,7 +120,13 @@ describe('Wave component', () => {
});
it('hidden element with -leave className', async () => {
const wrapper = mount(<Wave><button type="button" className="xx-leave">button</button></Wave>);
const wrapper = mount(
<Wave>
<button type="button" className="xx-leave">
button
</button>
</Wave>,
);
wrapper.find('button').getDOMNode().click();
await sleep(0);
const styles = document.getElementsByTagName('style');
@@ -95,7 +137,9 @@ describe('Wave component', () => {
it('ConfigProvider csp', async () => {
const wrapper = mount(
<ConfigProvider csp={{ nonce: 'YourNonceCode' }}>
<Wave><button type="button">button</button></Wave>
<Wave>
<button type="button">button</button>
</Wave>
</ConfigProvider>,
);
wrapper.find('button').getDOMNode().click();

View File

@@ -1,4 +1,4 @@
import { tuple } from './type';
import { ElementOf, tuple } from './type';
export const PresetStatusColorTypes = tuple('success', 'processing', 'error', 'default', 'warning');
// eslint-disable-next-line import/prefer-default-export
@@ -18,5 +18,5 @@ export const PresetColorTypes = tuple(
'lime',
);
export type PresetColorType = typeof PresetColorTypes[number];
export type PresetStatusColorType = typeof PresetStatusColorTypes[number];
export type PresetColorType = ElementOf<typeof PresetColorTypes>;
export type PresetStatusColorType = ElementOf<typeof PresetStatusColorTypes>;

View File

@@ -0,0 +1,7 @@
import devWarning, { resetWarned } from 'rc-util/lib/warning';
export { resetWarned };
export default (valid: boolean, component: string, message: string): void => {
devWarning(valid, `[antd: ${component}] ${message}`);
};

View File

@@ -1,4 +1,4 @@
import React from 'react';
import * as React from 'react';
export type RenderFunction = () => React.ReactNode;

View File

@@ -9,6 +9,7 @@ interface Motion {
motionEnter?: boolean;
motionLeave?: boolean;
motionLeaveImmediately?: boolean; // Trigger leave motion immediately
motionDeadline?: number;
removeOnLeave?: boolean;
leavedClassName?: string;
onAppearStart?: MotionFunc;
@@ -35,6 +36,7 @@ const collapseMotion: Motion = {
onEnterActive: getRealHeight,
onLeaveStart: getCurrentHeight,
onLeaveActive: getCollapsedHeight,
motionDeadline: 500,
};
export default collapseMotion;

View File

@@ -2,7 +2,7 @@
* Deprecated. We should replace the animation with pure react motion instead of modify style directly.
* If you are creating new component with animation, please use `./motion`.
*/
import cssAnimation from 'css-animation';
import cssAnimation from '@ant-design/css-animation';
import raf from 'raf';
function animate(node: HTMLElement, show: boolean, done: () => void) {

View File

@@ -1,8 +1,17 @@
import * as React from 'react';
// eslint-disable-next-line import/prefer-default-export
export function cloneElement(element: React.ReactNode, ...restArgs: any[]) {
if (!React.isValidElement(element)) return element;
export const isValidElement = React.isValidElement;
return React.cloneElement(element, ...restArgs);
export function replaceElement(
element: React.ReactNode,
replacement: React.ReactNode,
props: any,
): React.ReactNode {
if (!isValidElement(element)) return replacement;
return React.cloneElement(element, typeof props === 'function' ? props() : props);
}
export function cloneElement(element: React.ReactNode, props?: any): React.ReactElement {
return replaceElement(element, element, props) as React.ReactElement;
}

View File

@@ -1,4 +1,4 @@
import React from 'react';
import * as React from 'react';
export function fillRef<T>(ref: React.Ref<T>, node: T) {
if (typeof ref === 'function') {

View File

@@ -26,15 +26,10 @@ const responsiveObserve = {
matchHandlers: {},
dispatch(pointMap: ScreenMap) {
screens = pointMap;
if (subscribers.length < 1) {
return false;
}
subscribers.forEach(item => {
item.func(screens);
});
return true;
return subscribers.length >= 1;
},
subscribe(func: SubscribeFunc) {
if (subscribers.length === 0) {

View File

@@ -24,8 +24,8 @@ export default function scrollTo(y: number, options: ScrollToOptions = {}) {
const nextScrollTop = easeInOutCubic(time > duration ? duration : time, scrollTop, y, duration);
if (isWindow(container)) {
(container as Window).scrollTo(window.pageXOffset, nextScrollTop);
} else if (container instanceof Document) {
container.documentElement.scrollTop = nextScrollTop;
} else if (container instanceof HTMLDocument || container.constructor.name === 'HTMLDocument') {
(container as HTMLDocument).documentElement.scrollTop = nextScrollTop;
} else {
(container as HTMLElement).scrollTop = nextScrollTop;
}

View File

@@ -9,6 +9,7 @@ interface TransButtonProps extends React.HTMLAttributes<HTMLDivElement> {
onClick?: (e?: React.MouseEvent<HTMLDivElement>) => void;
noStyle?: boolean;
autoFocus?: boolean;
disabled?: boolean;
}
const inlineStyle: React.CSSProperties = {
@@ -63,7 +64,24 @@ class TransButton extends React.Component<TransButtonProps> {
}
render() {
const { style, noStyle, ...restProps } = this.props;
const { style, noStyle, disabled, ...restProps } = this.props;
let mergedStyle: React.CSSProperties = {};
if (!noStyle) {
mergedStyle = {
...inlineStyle,
};
}
if (disabled) {
mergedStyle.pointerEvents = 'none';
}
mergedStyle = {
...mergedStyle,
...style,
};
return (
<div
@@ -73,7 +91,7 @@ class TransButton extends React.Component<TransButtonProps> {
{...restProps}
onKeyDown={this.onKeyDown}
onKeyUp={this.onKeyUp}
style={{ ...(!noStyle ? inlineStyle : null), ...style }}
style={mergedStyle}
/>
);
}

View File

@@ -1,7 +0,0 @@
import warning, { resetWarned } from 'rc-util/lib/warning';
export { resetWarned };
export default (valid: boolean, component: string, message: string): void => {
warning(valid, `[antd: ${component}] ${message}`);
};

View File

@@ -1,8 +1,8 @@
import * as React from 'react';
import { findDOMNode } from 'react-dom';
import TransitionEvents from 'css-animation/lib/Event';
import TransitionEvents from '@ant-design/css-animation/lib/Event';
import raf from './raf';
import { ConfigConsumer, ConfigConsumerProps, CSPConfig } from '../config-provider';
import { ConfigConsumer, ConfigConsumerProps, CSPConfig, ConfigContext } from '../config-provider';
let styleForPesudo: HTMLStyleElement | null;
@@ -24,6 +24,8 @@ function isNotGrey(color: string) {
}
export default class Wave extends React.Component<{ insertExtraNode?: boolean }> {
static contextType = ConfigContext;
private instance?: {
cancel: () => void;
};
@@ -40,6 +42,8 @@ export default class Wave extends React.Component<{ insertExtraNode?: boolean }>
private csp?: CSPConfig;
context: ConfigConsumerProps;
componentDidMount() {
const node = findDOMNode(this) as HTMLElement;
if (!node || node.nodeType !== 1) {
@@ -66,7 +70,8 @@ export default class Wave extends React.Component<{ insertExtraNode?: boolean }>
const { insertExtraNode } = this.props;
this.extraNode = document.createElement('div');
const { extraNode } = this;
extraNode.className = 'ant-click-animating-node';
const { getPrefixCls } = this.context;
extraNode.className = `${getPrefixCls('')}-click-animating-node`;
const attributeName = this.getAttributeName();
node.setAttribute(attributeName, 'true');
// Not white or transparnt or grey
@@ -86,7 +91,9 @@ export default class Wave extends React.Component<{ insertExtraNode?: boolean }>
extraNode.style.borderColor = waveColor;
styleForPesudo.innerHTML = `
[ant-click-animating-without-extra-node='true']::after, .ant-click-animating-node {
[${getPrefixCls('')}-click-animating-without-extra-node='true']::after, .${getPrefixCls(
'',
)}-click-animating-node {
--antd-wave-shadow-color: ${waveColor};
}`;
if (!document.body.contains(styleForPesudo)) {
@@ -121,8 +128,11 @@ export default class Wave extends React.Component<{ insertExtraNode?: boolean }>
};
getAttributeName() {
const { getPrefixCls } = this.context;
const { insertExtraNode } = this.props;
return insertExtraNode ? 'ant-click-animating' : 'ant-click-animating-without-extra-node';
return insertExtraNode
? `${getPrefixCls('')}-click-animating`
: `${getPrefixCls('')}-click-animating-without-extra-node`;
}
bindAnimationEvent = (node: HTMLElement) => {

View File

@@ -1,201 +0,0 @@
import React from 'react';
import { mount } from 'enzyme';
import Affix from '..';
import { getObserverEntities } from '../utils';
import Button from '../../button';
import { spyElementPrototype } from '../../__tests__/util/domHook';
import rtlTest from '../../../tests/shared/rtlTest';
import { sleep } from '../../../tests/utils';
const events = {};
class AffixMounter extends React.Component {
componentDidMount() {
this.container.addEventListener = jest.fn().mockImplementation((event, cb) => {
events[event] = cb;
});
}
getTarget = () => this.container;
render() {
return (
<div
ref={node => {
this.container = node;
}}
className="container"
>
<Affix
className="fixed"
target={this.getTarget}
ref={ele => {
this.affix = ele;
}}
{...this.props}
>
<Button type="primary">Fixed at the top of container</Button>
</Affix>
</div>
);
}
}
describe('Affix Render', () => {
rtlTest(Affix);
let wrapper;
let domMock;
const classRect = {
container: {
top: 0,
bottom: 100,
},
};
beforeAll(() => {
domMock = spyElementPrototype(HTMLElement, 'getBoundingClientRect', function mockBounding() {
return (
classRect[this.className] || {
top: 0,
bottom: 0,
}
);
});
});
afterAll(() => {
domMock.mockRestore();
});
const movePlaceholder = async top => {
classRect.fixed = {
top,
bottom: top,
};
events.scroll({
type: 'scroll',
});
await sleep(20);
};
it('Anchor render perfectly', async () => {
document.body.innerHTML = '<div id="mounter" />';
wrapper = mount(<AffixMounter />, { attachTo: document.getElementById('mounter') });
await sleep(20);
await movePlaceholder(0);
expect(wrapper.instance().affix.state.affixStyle).toBeFalsy();
await movePlaceholder(-100);
expect(wrapper.instance().affix.state.affixStyle).toBeTruthy();
await movePlaceholder(0);
expect(wrapper.instance().affix.state.affixStyle).toBeFalsy();
});
it('support offsetBottom', async () => {
document.body.innerHTML = '<div id="mounter" />';
wrapper = mount(<AffixMounter offsetBottom={0} />, {
attachTo: document.getElementById('mounter'),
});
await sleep(20);
await movePlaceholder(300);
expect(wrapper.instance().affix.state.affixStyle).toBeTruthy();
await movePlaceholder(0);
expect(wrapper.instance().affix.state.affixStyle).toBeFalsy();
await movePlaceholder(300);
expect(wrapper.instance().affix.state.affixStyle).toBeTruthy();
});
it('updatePosition when offsetTop changed', async () => {
document.body.innerHTML = '<div id="mounter" />';
wrapper = mount(<AffixMounter offsetTop={0} />, {
attachTo: document.getElementById('mounter'),
});
await sleep(20);
await movePlaceholder(-100);
expect(wrapper.instance().affix.state.affixStyle.top).toBe(0);
wrapper.setProps({
offsetTop: 10,
});
await sleep(20);
expect(wrapper.instance().affix.state.affixStyle.top).toBe(10);
});
describe('updatePosition when target changed', () => {
it('function change', () => {
document.body.innerHTML = '<div id="mounter" />';
const container = document.querySelector('#id');
const getTarget = () => container;
wrapper = mount(<Affix target={getTarget} />);
wrapper.setProps({ target: null });
expect(wrapper.instance().state.status).toBe(0);
expect(wrapper.instance().state.affixStyle).toBe(undefined);
expect(wrapper.instance().state.placeholderStyle).toBe(undefined);
});
it('instance change', async () => {
const getObserverLength = () => Object.keys(getObserverEntities()).length;
const container = document.createElement('div');
document.body.appendChild(container);
let target = container;
const originLength = getObserverLength();
const getTarget = () => target;
wrapper = mount(<Affix target={getTarget} />);
await sleep(50);
expect(getObserverLength()).toBe(originLength + 1);
target = null;
wrapper.setProps({});
wrapper.update();
await sleep(50);
expect(getObserverLength()).toBe(originLength);
});
});
describe('updatePosition when size changed', () => {
function test(name, index) {
it(name, async () => {
document.body.innerHTML = '<div id="mounter" />';
const updateCalled = jest.fn();
wrapper = mount(<AffixMounter offsetBottom={0} onTestUpdatePosition={updateCalled} />, {
attachTo: document.getElementById('mounter'),
});
await sleep(20);
await movePlaceholder(300);
expect(wrapper.instance().affix.state.affixStyle).toBeTruthy();
await sleep(20);
wrapper.update();
// Mock trigger resize
updateCalled.mockReset();
wrapper
.find('ResizeObserver')
.at(index)
.instance()
.onResize([{ target: { getBoundingClientRect: () => ({ width: 99, height: 99 }) } }]);
await sleep(20);
expect(updateCalled).toHaveBeenCalled();
});
}
test('inner', 0);
test('outer', 1);
});
});

View File

@@ -0,0 +1,230 @@
import React from 'react';
import { mount, ReactWrapper, HTMLAttributes } from 'enzyme';
import ResizeObserverImpl from 'rc-resize-observer';
import Affix, { AffixProps, AffixState } from '..';
import { getObserverEntities } from '../utils';
import Button from '../../button';
import rtlTest from '../../../tests/shared/rtlTest';
import { sleep } from '../../../tests/utils';
const events: Partial<Record<keyof HTMLElementEventMap, (ev: Partial<Event>) => void>> = {};
class AffixMounter extends React.Component<{
offsetBottom?: number;
offsetTop?: number;
onTestUpdatePosition?(): void;
}> {
private container: HTMLDivElement;
public affix: Affix;
componentDidMount() {
this.container.addEventListener = jest
.fn()
.mockImplementation((event: keyof HTMLElementEventMap, cb: (ev: Partial<Event>) => void) => {
events[event] = cb;
});
}
getTarget = () => this.container;
render() {
return (
<div
ref={node => {
this.container = node!;
}}
className="container"
>
<Affix
className="fixed"
target={this.getTarget}
ref={ele => {
this.affix = ele!;
}}
{...this.props}
>
<Button type="primary">Fixed at the top of container</Button>
</Affix>
</div>
);
}
}
describe('Affix Render', () => {
rtlTest(Affix);
const domMock = jest.spyOn(HTMLElement.prototype, 'getBoundingClientRect');
let affixMounterWrapper: ReactWrapper<unknown, unknown, AffixMounter>;
let affixWrapper: ReactWrapper<AffixProps, AffixState, Affix>;
const classRect: Record<string, DOMRect> = {
container: {
top: 0,
bottom: 100,
} as DOMRect,
};
beforeAll(() => {
domMock.mockImplementation(function fn(this: HTMLElement) {
return (
classRect[this.className] || {
top: 0,
bottom: 0,
}
);
});
});
afterAll(() => {
domMock.mockRestore();
});
const movePlaceholder = async (top: number) => {
classRect.fixed = {
top,
bottom: top,
} as DOMRect;
if (events.scroll == null) {
throw new Error('scroll should be set');
}
events.scroll({
type: 'scroll',
});
await sleep(20);
};
it('Anchor render perfectly', async () => {
document.body.innerHTML = '<div id="mounter" />';
affixMounterWrapper = mount(<AffixMounter />, { attachTo: document.getElementById('mounter') });
await sleep(20);
await movePlaceholder(0);
expect(affixMounterWrapper.instance().affix.state.affixStyle).toBeFalsy();
await movePlaceholder(-100);
expect(affixMounterWrapper.instance().affix.state.affixStyle).toBeTruthy();
await movePlaceholder(0);
expect(affixMounterWrapper.instance().affix.state.affixStyle).toBeFalsy();
});
it('support offsetBottom', async () => {
document.body.innerHTML = '<div id="mounter" />';
affixMounterWrapper = mount(<AffixMounter offsetBottom={0} />, {
attachTo: document.getElementById('mounter'),
});
await sleep(20);
await movePlaceholder(300);
expect(affixMounterWrapper.instance().affix.state.affixStyle).toBeTruthy();
await movePlaceholder(0);
expect(affixMounterWrapper.instance().affix.state.affixStyle).toBeFalsy();
await movePlaceholder(300);
expect(affixMounterWrapper.instance().affix.state.affixStyle).toBeTruthy();
});
it('updatePosition when offsetTop changed', async () => {
document.body.innerHTML = '<div id="mounter" />';
affixMounterWrapper = mount(<AffixMounter offsetTop={0} />, {
attachTo: document.getElementById('mounter'),
});
await sleep(20);
await movePlaceholder(-100);
expect(affixMounterWrapper.instance().affix.state.affixStyle?.top).toBe(0);
affixMounterWrapper.setProps({
offsetTop: 10,
});
await sleep(20);
expect(affixMounterWrapper.instance().affix.state.affixStyle?.top).toBe(10);
});
describe('updatePosition when target changed', () => {
it('function change', () => {
document.body.innerHTML = '<div id="mounter" />';
const container = document.querySelector('#id') as HTMLDivElement;
const getTarget = () => container;
affixWrapper = mount(<Affix target={getTarget}>{null}</Affix>);
affixWrapper.setProps({ target: () => null });
expect(affixWrapper.instance().state.status).toBe(0);
expect(affixWrapper.instance().state.affixStyle).toBe(undefined);
expect(affixWrapper.instance().state.placeholderStyle).toBe(undefined);
});
it('instance change', async () => {
const getObserverLength = () => Object.keys(getObserverEntities()).length;
const container = document.createElement('div');
document.body.appendChild(container);
let target: HTMLDivElement | null = container;
const originLength = getObserverLength();
const getTarget = () => target;
affixWrapper = mount(<Affix target={getTarget}>{null}</Affix>);
await sleep(50);
expect(getObserverLength()).toBe(originLength + 1);
target = null;
affixWrapper.setProps({});
affixWrapper.update();
await sleep(50);
expect(getObserverLength()).toBe(originLength);
});
});
describe('updatePosition when size changed', () => {
it.each([
{ name: 'inner', index: 0 },
{ name: 'outer', index: 1 },
])(name, async ({ index }) => {
document.body.innerHTML = '<div id="mounter" />';
const updateCalled = jest.fn();
affixMounterWrapper = mount(
<AffixMounter offsetBottom={0} onTestUpdatePosition={updateCalled} />,
{
attachTo: document.getElementById('mounter'),
},
);
await sleep(20);
await movePlaceholder(300);
expect(affixMounterWrapper.instance().affix.state.affixStyle).toBeTruthy();
await sleep(20);
affixMounterWrapper.update();
// Mock trigger resize
updateCalled.mockReset();
const resizeObserverInstance: ReactWrapper<
HTMLAttributes,
unknown,
ResizeObserverImpl
> = affixMounterWrapper.find('ResizeObserver') as any;
resizeObserverInstance
.at(index)
.instance()
.onResize(
[
{
target: {
getBoundingClientRect: () => ({ width: 99, height: 99 }),
} as Element,
contentRect: {} as DOMRect,
},
],
({} as unknown) as ResizeObserver,
);
await sleep(20);
expect(updateCalled).toHaveBeenCalled();
});
});
});

View File

@@ -2,6 +2,7 @@
category: Components
type: Navigation
title: Affix
cover: https://gw.alipayobjects.com/zos/alicdn/SQGCQ7gOO/Affix.svg
---
Wrap Affix around another component to make it stick the viewport.

View File

@@ -2,7 +2,7 @@ import * as React from 'react';
import classNames from 'classnames';
import omit from 'omit.js';
import ResizeObserver from 'rc-resize-observer';
import { ConfigConsumer, ConfigConsumerProps } from '../config-provider';
import { ConfigContext, ConfigConsumerProps } from '../config-provider';
import { throttleByAnimationFrameDecorator } from '../_util/throttleByAnimationFrame';
import {
@@ -32,7 +32,7 @@ export interface AffixProps {
target?: () => Window | HTMLElement | null;
prefixCls?: string;
className?: string;
children: React.ReactElement;
children: React.ReactNode;
}
enum AffixStatus {
@@ -50,9 +50,7 @@ export interface AffixState {
}
class Affix extends React.Component<AffixProps, AffixState> {
static defaultProps = {
target: getDefaultTarget,
};
static contextType = ConfigContext;
state: AffixState = {
status: AffixStatus.None,
@@ -66,14 +64,27 @@ class Affix extends React.Component<AffixProps, AffixState> {
private timeout: number;
context: ConfigConsumerProps;
private getTargetFunc() {
const { getTargetContainer } = this.context;
const { target } = this.props;
if (target !== undefined) {
return target;
}
return getTargetContainer || getDefaultTarget;
}
// Event handler
componentDidMount() {
const { target } = this.props;
if (target) {
const targetFunc = this.getTargetFunc();
if (targetFunc) {
// [Legacy] Wait for parent component ref has its value.
// We should use target as directly element instead of function which makes element check hard.
this.timeout = setTimeout(() => {
addObserveTarget(target(), this);
addObserveTarget(targetFunc(), this);
// Mock Event object.
this.updatePosition();
});
@@ -82,10 +93,10 @@ class Affix extends React.Component<AffixProps, AffixState> {
componentDidUpdate(prevProps: AffixProps) {
const { prevTarget } = this.state;
const { target } = this.props;
const targetFunc = this.getTargetFunc();
let newTarget = null;
if (target) {
newTarget = target() || null;
if (targetFunc) {
newTarget = targetFunc() || null;
}
if (prevTarget !== newTarget) {
@@ -141,15 +152,16 @@ class Affix extends React.Component<AffixProps, AffixState> {
// =================== Measure ===================
measure = () => {
const { status, lastAffix } = this.state;
const { target, onChange } = this.props;
if (status !== AffixStatus.Prepare || !this.fixedNode || !this.placeholderNode || !target) {
const { onChange } = this.props;
const targetFunc = this.getTargetFunc();
if (status !== AffixStatus.Prepare || !this.fixedNode || !this.placeholderNode || !targetFunc) {
return;
}
const offsetTop = this.getOffsetTop();
const offsetBottom = this.getOffsetBottom();
const targetNode = target();
const targetNode = targetFunc();
if (!targetNode) {
return;
}
@@ -220,15 +232,15 @@ class Affix extends React.Component<AffixProps, AffixState> {
@throttleByAnimationFrameDecorator()
lazyUpdatePosition() {
const { target } = this.props;
const targetFunc = this.getTargetFunc();
const { affixStyle } = this.state;
// Check position change before measure to make Safari smooth
if (target && affixStyle) {
if (targetFunc && affixStyle) {
const offsetTop = this.getOffsetTop();
const offsetBottom = this.getOffsetBottom();
const targetNode = target();
const targetNode = targetFunc();
if (targetNode && this.placeholderNode) {
const targetRect = getTargetRect(targetNode);
const placeholderReact = getTargetRect(this.placeholderNode);
@@ -249,7 +261,8 @@ class Affix extends React.Component<AffixProps, AffixState> {
}
// =================== Render ===================
renderAffix = ({ getPrefixCls }: ConfigConsumerProps) => {
render = () => {
const { getPrefixCls } = this.context;
const { affixStyle, placeholderStyle } = this.state;
const { prefixCls, children } = this.props;
const className = classNames({
@@ -283,10 +296,6 @@ class Affix extends React.Component<AffixProps, AffixState> {
</ResizeObserver>
);
};
render() {
return <ConfigConsumer>{this.renderAffix}</ConfigConsumer>;
}
}
export default Affix;

View File

@@ -3,6 +3,7 @@ category: Components
subtitle: 固钉
type: 导航
title: Affix
cover: https://gw.alipayobjects.com/zos/alicdn/SQGCQ7gOO/Affix.svg
---
将页面元素钉在可视范围。

View File

@@ -163,7 +163,7 @@ exports[`renders ./components/alert/demo/basic.md correctly 1`] = `
`;
exports[`renders ./components/alert/demo/closable.md correctly 1`] = `
<div>
Array [
<div
class="ant-alert ant-alert-warning ant-alert-no-icon ant-alert-closable"
data-show="true"
@@ -202,7 +202,7 @@ exports[`renders ./components/alert/demo/closable.md correctly 1`] = `
</svg>
</span>
</button>
</div>
</div>,
<div
class="ant-alert ant-alert-error ant-alert-with-description ant-alert-no-icon ant-alert-closable"
data-show="true"
@@ -243,8 +243,8 @@ exports[`renders ./components/alert/demo/closable.md correctly 1`] = `
</svg>
</span>
</button>
</div>
</div>
</div>,
]
`;
exports[`renders ./components/alert/demo/close-text.md correctly 1`] = `
@@ -275,7 +275,7 @@ exports[`renders ./components/alert/demo/close-text.md correctly 1`] = `
`;
exports[`renders ./components/alert/demo/custom-icon.md correctly 1`] = `
<div>
Array [
<div
class="ant-alert ant-alert-success ant-alert-no-icon"
data-show="true"
@@ -288,7 +288,7 @@ exports[`renders ./components/alert/demo/custom-icon.md correctly 1`] = `
<span
class="ant-alert-description"
/>
</div>
</div>,
<div
class="ant-alert ant-alert-success"
data-show="true"
@@ -321,7 +321,7 @@ exports[`renders ./components/alert/demo/custom-icon.md correctly 1`] = `
<span
class="ant-alert-description"
/>
</div>
</div>,
<div
class="ant-alert ant-alert-info"
data-show="true"
@@ -354,7 +354,7 @@ exports[`renders ./components/alert/demo/custom-icon.md correctly 1`] = `
<span
class="ant-alert-description"
/>
</div>
</div>,
<div
class="ant-alert ant-alert-warning"
data-show="true"
@@ -387,7 +387,7 @@ exports[`renders ./components/alert/demo/custom-icon.md correctly 1`] = `
<span
class="ant-alert-description"
/>
</div>
</div>,
<div
class="ant-alert ant-alert-error"
data-show="true"
@@ -420,7 +420,7 @@ exports[`renders ./components/alert/demo/custom-icon.md correctly 1`] = `
<span
class="ant-alert-description"
/>
</div>
</div>,
<div
class="ant-alert ant-alert-success ant-alert-with-description"
data-show="true"
@@ -455,7 +455,7 @@ exports[`renders ./components/alert/demo/custom-icon.md correctly 1`] = `
>
Detailed description and advices about successful copywriting.
</span>
</div>
</div>,
<div
class="ant-alert ant-alert-info ant-alert-with-description"
data-show="true"
@@ -490,7 +490,7 @@ exports[`renders ./components/alert/demo/custom-icon.md correctly 1`] = `
>
Additional description and informations about copywriting.
</span>
</div>
</div>,
<div
class="ant-alert ant-alert-warning ant-alert-with-description"
data-show="true"
@@ -525,7 +525,7 @@ exports[`renders ./components/alert/demo/custom-icon.md correctly 1`] = `
>
This is a warning notice about copywriting.
</span>
</div>
</div>,
<div
class="ant-alert ant-alert-error ant-alert-with-description"
data-show="true"
@@ -560,12 +560,12 @@ exports[`renders ./components/alert/demo/custom-icon.md correctly 1`] = `
>
This is an error message about copywriting.
</span>
</div>
</div>
</div>,
]
`;
exports[`renders ./components/alert/demo/description.md correctly 1`] = `
<div>
Array [
<div
class="ant-alert ant-alert-success ant-alert-with-description ant-alert-no-icon"
data-show="true"
@@ -580,7 +580,7 @@ exports[`renders ./components/alert/demo/description.md correctly 1`] = `
>
Success Description Success Description Success Description
</span>
</div>
</div>,
<div
class="ant-alert ant-alert-info ant-alert-with-description ant-alert-no-icon"
data-show="true"
@@ -595,7 +595,7 @@ exports[`renders ./components/alert/demo/description.md correctly 1`] = `
>
Info Description Info Description Info Description Info Description
</span>
</div>
</div>,
<div
class="ant-alert ant-alert-warning ant-alert-with-description ant-alert-no-icon"
data-show="true"
@@ -610,7 +610,7 @@ exports[`renders ./components/alert/demo/description.md correctly 1`] = `
>
Warning Description Warning Description Warning Description Warning Description
</span>
</div>
</div>,
<div
class="ant-alert ant-alert-error ant-alert-with-description ant-alert-no-icon"
data-show="true"
@@ -625,8 +625,8 @@ exports[`renders ./components/alert/demo/description.md correctly 1`] = `
>
Error Description Error Description Error Description Error Description
</span>
</div>
</div>
</div>,
]
`;
exports[`renders ./components/alert/demo/error-boundary.md correctly 1`] = `
@@ -641,7 +641,7 @@ exports[`renders ./components/alert/demo/error-boundary.md correctly 1`] = `
`;
exports[`renders ./components/alert/demo/icon.md correctly 1`] = `
<div>
Array [
<div
class="ant-alert ant-alert-success"
data-show="true"
@@ -674,7 +674,7 @@ exports[`renders ./components/alert/demo/icon.md correctly 1`] = `
<span
class="ant-alert-description"
/>
</div>
</div>,
<div
class="ant-alert ant-alert-info"
data-show="true"
@@ -707,9 +707,9 @@ exports[`renders ./components/alert/demo/icon.md correctly 1`] = `
<span
class="ant-alert-description"
/>
</div>
</div>,
<div
class="ant-alert ant-alert-warning"
class="ant-alert ant-alert-warning ant-alert-closable"
data-show="true"
>
<span
@@ -740,7 +740,33 @@ exports[`renders ./components/alert/demo/icon.md correctly 1`] = `
<span
class="ant-alert-description"
/>
</div>
<button
class="ant-alert-close-icon"
tabindex="0"
type="button"
>
<span
aria-label="close"
class="anticon anticon-close"
role="img"
>
<svg
aria-hidden="true"
class=""
data-icon="close"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M563.8 512l262.5-312.9c4.4-5.2.7-13.1-6.1-13.1h-79.8c-4.7 0-9.2 2.1-12.3 5.7L511.6 449.8 295.1 191.7c-3-3.6-7.5-5.7-12.3-5.7H203c-6.8 0-10.5 7.9-6.1 13.1L459.4 512 196.9 824.9A7.95 7.95 0 00203 838h79.8c4.7 0 9.2-2.1 12.3-5.7l216.5-258.1 216.5 258.1c3 3.6 7.5 5.7 12.3 5.7h79.8c6.8 0 10.5-7.9 6.1-13.1L563.8 512z"
/>
</svg>
</span>
</button>
</div>,
<div
class="ant-alert ant-alert-error"
data-show="true"
@@ -773,7 +799,7 @@ exports[`renders ./components/alert/demo/icon.md correctly 1`] = `
<span
class="ant-alert-description"
/>
</div>
</div>,
<div
class="ant-alert ant-alert-success ant-alert-with-description"
data-show="true"
@@ -811,7 +837,7 @@ exports[`renders ./components/alert/demo/icon.md correctly 1`] = `
>
Detailed description and advice about successful copywriting.
</span>
</div>
</div>,
<div
class="ant-alert ant-alert-info ant-alert-with-description"
data-show="true"
@@ -849,9 +875,9 @@ exports[`renders ./components/alert/demo/icon.md correctly 1`] = `
>
Additional description and information about copywriting.
</span>
</div>
</div>,
<div
class="ant-alert ant-alert-warning ant-alert-with-description"
class="ant-alert ant-alert-warning ant-alert-with-description ant-alert-closable"
data-show="true"
>
<span
@@ -887,7 +913,33 @@ exports[`renders ./components/alert/demo/icon.md correctly 1`] = `
>
This is a warning notice about copywriting.
</span>
</div>
<button
class="ant-alert-close-icon"
tabindex="0"
type="button"
>
<span
aria-label="close"
class="anticon anticon-close"
role="img"
>
<svg
aria-hidden="true"
class=""
data-icon="close"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M563.8 512l262.5-312.9c4.4-5.2.7-13.1-6.1-13.1h-79.8c-4.7 0-9.2 2.1-12.3 5.7L511.6 449.8 295.1 191.7c-3-3.6-7.5-5.7-12.3-5.7H203c-6.8 0-10.5 7.9-6.1 13.1L459.4 512 196.9 824.9A7.95 7.95 0 00203 838h79.8c4.7 0 9.2-2.1 12.3-5.7l216.5-258.1 216.5 258.1c3 3.6 7.5 5.7 12.3 5.7h79.8c6.8 0 10.5-7.9 6.1-13.1L563.8 512z"
/>
</svg>
</span>
</button>
</div>,
<div
class="ant-alert ant-alert-error ant-alert-with-description"
data-show="true"
@@ -925,8 +977,8 @@ exports[`renders ./components/alert/demo/icon.md correctly 1`] = `
>
This is an error message about copywriting.
</span>
</div>
</div>
</div>,
]
`;
exports[`renders ./components/alert/demo/loop-banner.md correctly 1`] = `
@@ -1028,7 +1080,7 @@ exports[`renders ./components/alert/demo/smooth-closed.md correctly 1`] = `
`;
exports[`renders ./components/alert/demo/style.md correctly 1`] = `
<div>
Array [
<div
class="ant-alert ant-alert-success ant-alert-no-icon"
data-show="true"
@@ -1041,7 +1093,7 @@ exports[`renders ./components/alert/demo/style.md correctly 1`] = `
<span
class="ant-alert-description"
/>
</div>
</div>,
<div
class="ant-alert ant-alert-info ant-alert-no-icon"
data-show="true"
@@ -1054,7 +1106,7 @@ exports[`renders ./components/alert/demo/style.md correctly 1`] = `
<span
class="ant-alert-description"
/>
</div>
</div>,
<div
class="ant-alert ant-alert-warning ant-alert-no-icon"
data-show="true"
@@ -1067,7 +1119,7 @@ exports[`renders ./components/alert/demo/style.md correctly 1`] = `
<span
class="ant-alert-description"
/>
</div>
</div>,
<div
class="ant-alert ant-alert-error ant-alert-no-icon"
data-show="true"
@@ -1080,6 +1132,6 @@ exports[`renders ./components/alert/demo/style.md correctly 1`] = `
<span
class="ant-alert-description"
/>
</div>
</div>
</div>,
]
`;

View File

@@ -22,6 +22,27 @@ exports[`Alert ErrorBoundary 1`] = `
</div>
`;
exports[`Alert could accept none react element icon 1`] = `
<div
class="ant-alert ant-alert-success"
data-show="true"
>
<span
class="ant-alert-icon"
>
icon
</span>
<span
class="ant-alert-message"
>
Success Tips
</span>
<span
class="ant-alert-description"
/>
</div>
`;
exports[`Alert rtl render component should be rendered correctly in RTL direction 1`] = `
<div
class="ant-alert ant-alert-info ant-alert-no-icon ant-alert-rtl"

View File

@@ -39,20 +39,20 @@ describe('Alert', () => {
describe('data and aria props', () => {
it('sets data attributes on input', () => {
const wrapper = mount(<Alert data-test="test-id" data-id="12345" />);
const wrapper = mount(<Alert data-test="test-id" data-id="12345" message={null} />);
const input = wrapper.find('.ant-alert').getDOMNode();
expect(input.getAttribute('data-test')).toBe('test-id');
expect(input.getAttribute('data-id')).toBe('12345');
});
it('sets aria attributes on input', () => {
const wrapper = mount(<Alert aria-describedby="some-label" />);
const wrapper = mount(<Alert aria-describedby="some-label" message={null} />);
const input = wrapper.find('.ant-alert').getDOMNode();
expect(input.getAttribute('aria-describedby')).toBe('some-label');
});
it('sets role attribute on input', () => {
const wrapper = mount(<Alert role="status" />);
const wrapper = mount(<Alert role="status" message={null} />);
const input = wrapper.find('.ant-alert').getDOMNode();
expect(input.getAttribute('role')).toBe('status');
});
@@ -60,6 +60,7 @@ describe('Alert', () => {
const testIt = process.env.REACT === '15' ? it.skip : it;
testIt('ErrorBoundary', () => {
// @ts-expect-error
// eslint-disable-next-line react/jsx-no-undef
const ThrowError = () => <NotExisted />;
const wrapper = mount(
@@ -72,9 +73,10 @@ describe('Alert', () => {
});
it('could be used with Tooltip', async () => {
const ref = React.createRef<any>();
jest.useRealTimers();
const wrapper = mount(
<Tooltip title="xxx" mouseEnterDelay={0}>
<Tooltip title="xxx" mouseEnterDelay={0} ref={ref}>
<Alert
message="Warning Text Warning Text Warning TextW arning Text Warning Text Warning TextWarning Text"
type="warning"
@@ -83,19 +85,15 @@ describe('Alert', () => {
);
wrapper.find('.ant-alert').simulate('mouseenter');
await sleep(0);
expect(
wrapper
.find(Tooltip)
.instance()
.getPopupDomNode(),
).toBeTruthy();
expect(ref.current.getPopupDomNode()).toBeTruthy();
jest.useFakeTimers();
});
it('could be used with Popconfirm', async () => {
const ref = React.createRef<any>();
jest.useRealTimers();
const wrapper = mount(
<Popconfirm title="xxx">
<Popconfirm ref={ref} title="xxx">
<Alert
message="Warning Text Warning Text Warning TextW arning Text Warning Text Warning TextWarning Text"
type="warning"
@@ -104,12 +102,12 @@ describe('Alert', () => {
);
wrapper.find('.ant-alert').simulate('click');
await sleep(0);
expect(
wrapper
.find(Popconfirm)
.instance()
.getPopupDomNode(),
).toBeTruthy();
expect(ref.current.getPopupDomNode()).toBeTruthy();
jest.useFakeTimers();
});
it('could accept none react element icon', () => {
const wrapper = mount(<Alert message="Success Tips" type="success" showIcon icon="icon" />);
expect(wrapper).toMatchRenderedSnapshot();
});
});

View File

@@ -21,7 +21,7 @@ const onClose = (e: React.MouseEvent<HTMLButtonElement, MouseEvent>) => {
};
ReactDOM.render(
<div>
<>
<Alert
message="Warning Text Warning Text Warning TextW arning Text Warning Text Warning TextWarning Text"
type="warning"
@@ -35,7 +35,7 @@ ReactDOM.render(
closable
onClose={onClose}
/>
</div>,
</>,
mountNode,
);
```

View File

@@ -21,7 +21,7 @@ import { SmileOutlined } from '@ant-design/icons';
const icon = <SmileOutlined />;
ReactDOM.render(
<div>
<>
<Alert icon={icon} message="showIcon = false" type="success" />
<Alert icon={icon} message="Success Tips" type="success" showIcon />
<Alert icon={icon} message="Informational Notes" type="info" showIcon />
@@ -55,7 +55,7 @@ ReactDOM.render(
type="error"
showIcon
/>
</div>,
</>,
mountNode,
);
```

View File

@@ -17,7 +17,7 @@ Additional description for alert message.
import { Alert } from 'antd';
ReactDOM.render(
<div>
<>
<Alert
message="Success Text"
description="Success Description Success Description Success Description"
@@ -38,7 +38,7 @@ ReactDOM.render(
description="Error Description Error Description Error Description Error Description"
type="error"
/>
</div>,
</>,
mountNode,
);
```

View File

@@ -17,10 +17,10 @@ A relevant icon will make information clearer and more friendly.
import { Alert } from 'antd';
ReactDOM.render(
<div>
<>
<Alert message="Success Tips" type="success" showIcon />
<Alert message="Informational Notes" type="info" showIcon />
<Alert message="Warning" type="warning" showIcon />
<Alert message="Warning" type="warning" showIcon closable />
<Alert message="Error" type="error" showIcon />
<Alert
message="Success Tips"
@@ -39,6 +39,7 @@ ReactDOM.render(
description="This is a warning notice about copywriting."
type="warning"
showIcon
closable
/>
<Alert
message="Error"
@@ -46,7 +47,7 @@ ReactDOM.render(
type="error"
showIcon
/>
</div>,
</>,
mountNode,
);
```

View File

@@ -17,12 +17,18 @@ There are 4 types of Alert: `success`, `info`, `warning`, `error`.
import { Alert } from 'antd';
ReactDOM.render(
<div>
<>
<Alert message="Success Text" type="success" />
<Alert message="Info Text" type="info" />
<Alert message="Warning Text" type="warning" />
<Alert message="Error Text" type="error" />
</div>,
</>,
mountNode,
);
```
<style>
[data-theme="compact"] .code-box-demo .ant-alert {
margin-bottom: 8px;
}
</style>

View File

@@ -2,6 +2,7 @@
category: Components
type: Feedback
title: Alert
cover: https://gw.alipayobjects.com/zos/antfincdn/nuhf3vdRno/Alert.svg
---
Alert component for feedback.

View File

@@ -1,5 +1,4 @@
import * as React from 'react';
import * as ReactDOM from 'react-dom';
import CloseOutlined from '@ant-design/icons/CloseOutlined';
import CheckCircleOutlined from '@ant-design/icons/CheckCircleOutlined';
import ExclamationCircleOutlined from '@ant-design/icons/ExclamationCircleOutlined';
@@ -12,11 +11,10 @@ import CloseCircleFilled from '@ant-design/icons/CloseCircleFilled';
import Animate from 'rc-animate';
import classNames from 'classnames';
import { ConfigConsumer, ConfigConsumerProps } from '../config-provider';
import { ConfigContext } from '../config-provider';
import getDataOrAriaProps from '../_util/getDataOrAriaProps';
import ErrorBoundary from './ErrorBoundary';
function noop() {}
import { replaceElement } from '../_util/reactNode';
export interface AlertProps {
/**
@@ -37,6 +35,8 @@ export interface AlertProps {
afterClose?: () => void;
/** Whether to show icon */
showIcon?: boolean;
/** https://www.w3.org/TR/2014/REC-html5-20141028/dom.html#aria-role-attribute */
role?: string;
style?: React.CSSProperties;
prefixCls?: string;
className?: string;
@@ -47,11 +47,6 @@ export interface AlertProps {
onClick?: React.MouseEventHandler<HTMLDivElement>;
}
export interface AlertState {
closing: boolean;
closed: boolean;
}
const iconMapFilled = {
success: CheckCircleFilled,
info: InfoCircleFilled,
@@ -66,86 +61,82 @@ const iconMapOutlined = {
warning: ExclamationCircleOutlined,
};
export default class Alert extends React.Component<AlertProps, AlertState> {
static ErrorBoundary = ErrorBoundary;
interface AlertInterface extends React.FC<AlertProps> {
ErrorBoundary: typeof ErrorBoundary;
}
state = {
closing: false,
closed: false,
};
const Alert: AlertInterface = ({
description,
prefixCls: customizePrefixCls,
message,
banner,
className = '',
style,
onMouseEnter,
onMouseLeave,
onClick,
showIcon,
closable,
closeText,
...props
}) => {
const [closing, setClosing] = React.useState(false);
const [closed, setClosed] = React.useState(false);
handleClose = (e: React.MouseEvent<HTMLButtonElement>) => {
const ref = React.useRef<HTMLElement>();
const { getPrefixCls, direction } = React.useContext(ConfigContext);
const prefixCls = getPrefixCls('alert', customizePrefixCls);
const handleClose = (e: React.MouseEvent<HTMLButtonElement>) => {
e.preventDefault();
const dom = ReactDOM.findDOMNode(this) as HTMLElement;
const dom = ref.current as HTMLElement;
dom.style.height = `${dom.offsetHeight}px`;
// Magic code
// 重复一次后才能正确设置 height
dom.style.height = `${dom.offsetHeight}px`;
this.setState({
closing: true,
});
(this.props.onClose || noop)(e);
setClosing(true);
props.onClose?.(e);
};
animationEnd = () => {
this.setState({
closing: false,
closed: true,
});
(this.props.afterClose || noop)();
const animationEnd = () => {
setClosing(false);
setClosed(true);
props.afterClose?.();
};
renderAlert = ({ getPrefixCls, direction }: ConfigConsumerProps) => {
const {
description,
prefixCls: customizePrefixCls,
message,
closeText,
banner,
className = '',
style,
icon,
onMouseEnter,
onMouseLeave,
onClick,
} = this.props;
let { closable, type, showIcon } = this.props;
const { closing, closed } = this.state;
const getType = () => {
const { type } = props;
if (type !== undefined) {
return type;
}
// banner 模式默认为警告
return banner ? 'warning' : 'info';
};
const prefixCls = getPrefixCls('alert', customizePrefixCls);
// banner模式默认有 Icon
showIcon = banner && showIcon === undefined ? true : showIcon;
// banner模式默认为警告
type = banner && type === undefined ? 'warning' : type || 'info';
// closeable when closeText is assigned
const isClosable = closeText ? true : closable;
const type = getType();
const renderIconNode = () => {
const { icon } = props;
// use outline icon in alert with description
const iconType = (description ? iconMapOutlined : iconMapFilled)[type] || null;
// closeable when closeText is assigned
if (closeText) {
closable = true;
if (icon) {
return replaceElement(icon, <span className={`${prefixCls}-icon`}>{icon}</span>, () => ({
className: classNames(`${prefixCls}-icon`, {
[(icon as any).props.className]: (icon as any).props.className,
}),
}));
}
return React.createElement(iconType, { className: `${prefixCls}-icon` });
};
const alertCls = classNames(
prefixCls,
`${prefixCls}-${type}`,
{
[`${prefixCls}-closing`]: closing,
[`${prefixCls}-with-description`]: !!description,
[`${prefixCls}-no-icon`]: !showIcon,
[`${prefixCls}-banner`]: !!banner,
[`${prefixCls}-closable`]: closable,
[`${prefixCls}-rtl`]: direction === 'rtl',
},
className,
);
const closeIcon = closable ? (
const renderCloseIcon = () => {
return isClosable ? (
<button
type="button"
onClick={this.handleClose}
onClick={handleClose}
className={`${prefixCls}-close-icon`}
tabIndex={0}
>
@@ -156,48 +147,53 @@ export default class Alert extends React.Component<AlertProps, AlertState> {
)}
</button>
) : null;
const dataOrAriaProps = getDataOrAriaProps(this.props);
const iconNode =
(icon &&
(React.isValidElement<{ className?: string }>(icon) ? (
React.cloneElement(icon, {
className: classNames(`${prefixCls}-icon`, {
[icon.props.className as string]: icon.props.className,
}),
})
) : (
<span className={`${prefixCls}-icon`}>{icon}</span>
))) ||
React.createElement(iconType, { className: `${prefixCls}-icon` });
return closed ? null : (
<Animate
component=""
showProp="data-show"
transitionName={`${prefixCls}-slide-up`}
onEnd={this.animationEnd}
>
<div
data-show={!closing}
className={alertCls}
style={style}
onMouseEnter={onMouseEnter}
onMouseLeave={onMouseLeave}
onClick={onClick}
{...dataOrAriaProps}
>
{showIcon ? iconNode : null}
<span className={`${prefixCls}-message`}>{message}</span>
<span className={`${prefixCls}-description`}>{description}</span>
{closeIcon}
</div>
</Animate>
);
};
render() {
return <ConfigConsumer>{this.renderAlert}</ConfigConsumer>;
}
}
// banner 模式默认有 Icon
const isShowIcon = banner && showIcon === undefined ? true : showIcon;
const alertCls = classNames(
prefixCls,
`${prefixCls}-${type}`,
{
[`${prefixCls}-closing`]: closing,
[`${prefixCls}-with-description`]: !!description,
[`${prefixCls}-no-icon`]: !isShowIcon,
[`${prefixCls}-banner`]: !!banner,
[`${prefixCls}-closable`]: isClosable,
[`${prefixCls}-rtl`]: direction === 'rtl',
},
className,
);
const dataOrAriaProps = getDataOrAriaProps(props);
return closed ? null : (
<Animate
component=""
showProp="data-show"
transitionName={`${prefixCls}-slide-up`}
onEnd={animationEnd}
>
<div
ref={ref}
data-show={!closing}
className={alertCls}
style={style}
onMouseEnter={onMouseEnter}
onMouseLeave={onMouseLeave}
onClick={onClick}
{...dataOrAriaProps}
>
{isShowIcon ? renderIconNode() : null}
<span className={`${prefixCls}-message`}>{message}</span>
<span className={`${prefixCls}-description`}>{description}</span>
{renderCloseIcon()}
</div>
</Animate>
);
};
Alert.ErrorBoundary = ErrorBoundary;
export default Alert;

View File

@@ -3,6 +3,7 @@ category: Components
subtitle: 警告提示
type: 反馈
title: Alert
cover: https://gw.alipayobjects.com/zos/antfincdn/nuhf3vdRno/Alert.svg
---
警告提示,展现需要关注的信息。

View File

@@ -13,6 +13,10 @@
&&-no-icon {
padding: @alert-no-icon-padding-vertical 15px;
.@{alert-prefix-cls}-close-icon {
top: @alert-no-icon-padding-vertical + @font-size-base * @line-height-base / 2 -
@font-size-base / 2;
}
}
&&-closable {
@@ -21,14 +25,14 @@
&-icon {
position: absolute;
top: 8px + @font-size-base * @line-height-base / 2 - @font-size-base / 2;
top: @alert-icon-top;
left: 16px;
}
&-description {
display: none;
font-size: @font-size-base;
line-height: 22px;
line-height: @font-size-base + 8px;
}
&-success {
@@ -71,12 +75,12 @@
&-close-icon {
position: absolute;
top: @padding-xs;
right: 16px;
top: 8px + @font-size-base * @line-height-base / 2 - @font-size-base / 2;
right: @padding-md;
padding: 0;
overflow: hidden;
font-size: @font-size-sm;
line-height: 22px;
line-height: @font-size-sm;
background-color: transparent;
border: none;
outline: none;
@@ -101,7 +105,7 @@
&-with-description {
position: relative;
padding: 15px 15px 15px 64px;
padding: @alert-with-description-padding;
color: @alert-text-color;
line-height: @line-height-base;
border-radius: @border-radius-base;
@@ -113,15 +117,15 @@
&-with-description &-icon {
position: absolute;
top: 16px;
left: 24px;
font-size: 24px;
top: @alert-with-description-icon-top;
left: @alert-with-description-icon-size;
font-size: @alert-with-description-icon-size;
}
&-with-description &-close-icon {
position: absolute;
top: 16px;
right: 16px;
top: @padding-md;
right: @padding-md;
font-size: @font-size-base;
cursor: pointer;
}
@@ -188,4 +192,4 @@
}
}
@import './rtl.less';
@import './rtl';

View File

@@ -4,13 +4,26 @@
@alert-prefix-cls: ~'@{ant-prefix}-alert';
.@{alert-prefix-cls} {
&-rtl {
&&-rtl {
padding: 8px 37px 8px 15px;
direction: rtl;
}
&&-closable {
&&-no-icon {
.@{alert-prefix-cls}-rtl& {
padding: @alert-no-icon-padding-vertical 15px;
}
}
&&-closable {
.@{alert-prefix-cls}.@{alert-prefix-cls}-rtl& {
padding-right: 37px;
padding-left: 30px;
}
}
&&-no-icon&-closable {
.@{alert-prefix-cls}.@{alert-prefix-cls}-rtl& {
padding-right: 15px;
padding-left: 30px;
}
@@ -18,7 +31,7 @@
&-icon {
.@{alert-prefix-cls}-rtl & {
right: 16px;
right: @padding-md;
left: auto;
}
}
@@ -26,25 +39,28 @@
&-close-icon {
.@{alert-prefix-cls}-rtl & {
right: auto;
left: 16px;
left: @padding-md;
}
}
&-with-description {
.@{alert-prefix-cls}-rtl& {
padding: 15px 64px 15px 15px;
&-with-description,
&-with-description&-closable {
.@{alert-prefix-cls}.@{alert-prefix-cls}-rtl& {
padding: @alert-with-description-padding-vertical @alert-with-description-icon-size * 2 +
@alert-with-description-padding-vertical @alert-with-description-no-icon-padding-vertical
15px;
}
}
&-with-description&-no-icon {
.@{alert-prefix-cls}-rtl& {
.@{alert-prefix-cls}.@{alert-prefix-cls}-rtl& {
padding: 15px;
}
}
&-with-description &-icon {
.@{alert-prefix-cls}-rtl& {
right: 24px;
right: @alert-with-description-icon-size;
left: auto;
}
}
@@ -52,7 +68,7 @@
&-with-description &-close-icon {
.@{alert-prefix-cls}-rtl& {
right: auto;
left: 16px;
left: @padding-md;
}
}
}

View File

@@ -1,23 +1,19 @@
import * as React from 'react';
import * as ReactDOM from 'react-dom';
import * as PropTypes from 'prop-types';
import classNames from 'classnames';
import addEventListener from 'rc-util/lib/Dom/addEventListener';
import Affix from '../affix';
import AnchorLink from './AnchorLink';
import { ConfigConsumer, ConfigConsumerProps } from '../config-provider';
import { ConfigContext, ConfigConsumerProps } from '../config-provider';
import scrollTo from '../_util/scrollTo';
import getScroll from '../_util/getScroll';
import AnchorContext from './context';
function getDefaultContainer() {
return window;
}
function getOffsetTop(element: HTMLElement, container: AnchorContainer): number {
if (!element) {
return 0;
}
if (!element.getClientRects().length) {
return 0;
}
@@ -35,7 +31,7 @@ function getOffsetTop(element: HTMLElement, container: AnchorContainer): number
return rect.top;
}
const sharpMatcherRegx = /#([^#]+)$/;
const sharpMatcherRegx = /#(\S+)$/;
type Section = {
link: string;
@@ -88,23 +84,22 @@ export interface AntAnchor {
) => void;
}
export default class Anchor extends React.Component<AnchorProps, AnchorState> {
export default class Anchor extends React.Component<AnchorProps, AnchorState, ConfigConsumerProps> {
static Link: typeof AnchorLink;
static defaultProps = {
affix: true,
showInkInFixed: false,
getContainer: getDefaultContainer,
};
static childContextTypes = {
antAnchor: PropTypes.object,
};
static contextType = ConfigContext;
state = {
activeLink: null,
};
content: ConfigConsumerProps;
private inkNode: HTMLSpanElement;
// scroll scope's container
@@ -118,37 +113,38 @@ export default class Anchor extends React.Component<AnchorProps, AnchorState> {
private prefixCls?: string;
getChildContext() {
const antAnchor: AntAnchor = {
registerLink: (link: string) => {
if (!this.links.includes(link)) {
this.links.push(link);
}
},
unregisterLink: (link: string) => {
const index = this.links.indexOf(link);
if (index !== -1) {
this.links.splice(index, 1);
}
},
activeLink: this.state.activeLink,
scrollTo: this.handleScrollTo,
onClick: this.props.onClick,
};
return { antAnchor };
}
// Context
registerLink = (link: string) => {
if (!this.links.includes(link)) {
this.links.push(link);
}
};
unregisterLink = (link: string) => {
const index = this.links.indexOf(link);
if (index !== -1) {
this.links.splice(index, 1);
}
};
getContainer = () => {
const { getTargetContainer } = this.context;
const { getContainer } = this.props;
const getFunc = getContainer || getTargetContainer || getDefaultContainer;
return getFunc();
};
componentDidMount() {
const { getContainer } = this.props as AnchorDefaultProps;
this.scrollContainer = getContainer();
this.scrollContainer = this.getContainer();
this.scrollEvent = addEventListener(this.scrollContainer, 'scroll', this.handleScroll);
this.handleScroll();
}
componentDidUpdate() {
if (this.scrollEvent) {
const { getContainer } = this.props as AnchorDefaultProps;
const currentContainer = getContainer();
const currentContainer = this.getContainer();
if (this.scrollContainer !== currentContainer) {
this.scrollContainer = currentContainer;
this.scrollEvent.remove();
@@ -172,14 +168,8 @@ export default class Anchor extends React.Component<AnchorProps, AnchorState> {
return getCurrentAnchor();
}
const activeLink = '';
if (typeof document === 'undefined') {
return activeLink;
}
const linkSections: Array<Section> = [];
const { getContainer } = this.props as AnchorDefaultProps;
const container = getContainer();
const container = this.getContainer();
this.links.forEach(link => {
const sharpLinkMatch = sharpMatcherRegx.exec(link.toString());
if (!sharpLinkMatch) {
@@ -205,10 +195,10 @@ export default class Anchor extends React.Component<AnchorProps, AnchorState> {
}
handleScrollTo = (link: string) => {
const { offsetTop, getContainer, targetOffset } = this.props as AnchorDefaultProps;
const { offsetTop, targetOffset } = this.props;
this.setCurrentActiveLink(link);
const container = getContainer();
const container = this.getContainer();
const scrollTop = getScroll(container, true);
const sharpLinkMatch = sharpMatcherRegx.exec(link);
if (!sharpLinkMatch) {
@@ -228,7 +218,7 @@ export default class Anchor extends React.Component<AnchorProps, AnchorState> {
callback: () => {
this.animating = false;
},
getContainer,
getContainer: this.getContainer,
});
};
@@ -263,9 +253,6 @@ export default class Anchor extends React.Component<AnchorProps, AnchorState> {
};
updateInk = () => {
if (typeof document === 'undefined') {
return;
}
const { prefixCls } = this;
const anchorNode = ReactDOM.findDOMNode(this) as Element;
const linkNode = anchorNode.getElementsByClassName(`${prefixCls}-link-title-active`)[0];
@@ -274,7 +261,9 @@ export default class Anchor extends React.Component<AnchorProps, AnchorState> {
}
};
renderAnchor = ({ getPrefixCls, direction }: ConfigConsumerProps) => {
render = () => {
const { getPrefixCls, direction } = this.context;
const {
prefixCls: customizePrefixCls,
className = '',
@@ -283,7 +272,6 @@ export default class Anchor extends React.Component<AnchorProps, AnchorState> {
affix,
showInkInFixed,
children,
getContainer,
} = this.props;
const { activeLink } = this.state;
@@ -322,16 +310,24 @@ export default class Anchor extends React.Component<AnchorProps, AnchorState> {
</div>
);
return !affix ? (
anchorContent
) : (
<Affix offsetTop={offsetTop} target={getContainer}>
{anchorContent}
</Affix>
return (
<AnchorContext.Provider
value={{
registerLink: this.registerLink,
unregisterLink: this.unregisterLink,
activeLink: this.state.activeLink,
scrollTo: this.handleScrollTo,
onClick: this.props.onClick,
}}
>
{!affix ? (
anchorContent
) : (
<Affix offsetTop={offsetTop} target={this.getContainer}>
{anchorContent}
</Affix>
)}
</AnchorContext.Provider>
);
};
render() {
return <ConfigConsumer>{this.renderAnchor}</ConfigConsumer>;
}
}

View File

@@ -1,8 +1,8 @@
import * as React from 'react';
import * as PropTypes from 'prop-types';
import classNames from 'classnames';
import { AntAnchor } from './Anchor';
import { ConfigConsumer, ConfigConsumerProps } from '../config-provider';
import AnchorContext from './context';
export interface AnchorLinkProps {
prefixCls?: string;
@@ -13,37 +13,33 @@ export interface AnchorLinkProps {
className?: string;
}
class AnchorLink extends React.Component<AnchorLinkProps, any> {
class AnchorLink extends React.Component<AnchorLinkProps, any, AntAnchor> {
static defaultProps = {
href: '#',
};
static contextTypes = {
antAnchor: PropTypes.object,
};
static contextType = AnchorContext;
context: {
antAnchor: AntAnchor;
};
context: AntAnchor;
componentDidMount() {
this.context.antAnchor.registerLink(this.props.href);
this.context.registerLink(this.props.href);
}
componentDidUpdate({ href: prevHref }: AnchorLinkProps) {
const { href } = this.props;
if (prevHref !== href) {
this.context.antAnchor.unregisterLink(prevHref);
this.context.antAnchor.registerLink(href);
this.context.unregisterLink(prevHref);
this.context.registerLink(href);
}
}
componentWillUnmount() {
this.context.antAnchor.unregisterLink(this.props.href);
this.context.unregisterLink(this.props.href);
}
handleClick = (e: React.MouseEvent<HTMLElement>) => {
const { scrollTo, onClick } = this.context.antAnchor;
const { scrollTo, onClick } = this.context;
const { href, title } = this.props;
if (onClick) {
onClick(e, { title, href });
@@ -54,7 +50,7 @@ class AnchorLink extends React.Component<AnchorLinkProps, any> {
renderAnchorLink = ({ getPrefixCls }: ConfigConsumerProps) => {
const { prefixCls: customizePrefixCls, href, title, children, className, target } = this.props;
const prefixCls = getPrefixCls('anchor', customizePrefixCls);
const active = this.context.antAnchor.activeLink === href;
const active = this.context.activeLink === href;
const wrapperClassName = classNames(className, `${prefixCls}-link`, {
[`${prefixCls}-link-active`]: active,
});

View File

@@ -1,336 +0,0 @@
import React from 'react';
import { mount } from 'enzyme';
import Anchor from '..';
import { spyElementPrototypes } from '../../__tests__/util/domHook';
import { sleep } from '../../../tests/utils';
const { Link } = Anchor;
describe('Anchor Render', () => {
const getBoundingClientRectMock = jest.fn(() => ({
width: 100,
height: 100,
top: 1000,
}));
const getClientRectsMock = jest.fn(() => ({
length: 1,
}));
const headingSpy = spyElementPrototypes(HTMLHeadingElement, {
getBoundingClientRect: getBoundingClientRectMock,
getClientRects: getClientRectsMock,
});
afterAll(() => {
headingSpy.mockRestore();
});
it('Anchor render perfectly', () => {
const wrapper = mount(
<Anchor>
<Link href="#API" title="API" />
</Anchor>,
);
wrapper.find('a[href="#API"]').simulate('click');
wrapper.instance().handleScroll();
expect(wrapper.instance().state).not.toBe(null);
});
it('Anchor render perfectly for complete href - click', () => {
const wrapper = mount(
<Anchor>
<Link href="http://www.example.com/#API" title="API" />
</Anchor>,
);
wrapper.find('a[href="http://www.example.com/#API"]').simulate('click');
expect(wrapper.instance().state.activeLink).toBe('http://www.example.com/#API');
});
it('Anchor render perfectly for complete href - scroll', () => {
let root = document.getElementById('root');
if (!root) {
root = document.createElement('div', { id: 'root' });
root.id = 'root';
document.body.appendChild(root);
}
mount(<div id="API">Hello</div>, { attachTo: root });
const wrapper = mount(
<Anchor>
<Link href="http://www.example.com/#API" title="API" />
</Anchor>,
);
wrapper.instance().handleScroll();
expect(wrapper.instance().state.activeLink).toBe('http://www.example.com/#API');
});
it('Anchor render perfectly for complete href - scrollTo', async () => {
const scrollToSpy = jest.spyOn(window, 'scrollTo');
let root = document.getElementById('root');
if (!root) {
root = document.createElement('div', { id: 'root' });
root.id = 'root';
document.body.appendChild(root);
}
mount(<div id="API">Hello</div>, { attachTo: root });
const wrapper = mount(
<Anchor>
<Link href="##API" title="API" />
</Anchor>,
);
wrapper.instance().handleScrollTo('##API');
expect(wrapper.instance().state.activeLink).toBe('##API');
expect(scrollToSpy).not.toHaveBeenCalled();
await sleep(1000);
expect(scrollToSpy).toHaveBeenCalled();
});
it('should remove listener when unmount', async () => {
const wrapper = mount(
<Anchor>
<Link href="#API" title="API" />
</Anchor>,
);
const removeListenerSpy = jest.spyOn(wrapper.instance().scrollEvent, 'remove');
wrapper.unmount();
expect(removeListenerSpy).toHaveBeenCalled();
});
it('should unregister link when unmount children', async () => {
const wrapper = mount(
<Anchor>
<Link href="#API" title="API" />
</Anchor>,
);
expect(wrapper.instance().links).toEqual(['#API']);
wrapper.setProps({ children: null });
expect(wrapper.instance().links).toEqual([]);
});
it('should update links when link href update', async () => {
let anchorInstance = null;
function AnchorUpdate({ href }) {
return (
<Anchor
ref={c => {
anchorInstance = c;
}}
>
<Link href={href} title="API" />
</Anchor>
);
}
const wrapper = mount(<AnchorUpdate href="#API" />);
expect(anchorInstance.links).toEqual(['#API']);
wrapper.setProps({ href: '#API_1' });
expect(anchorInstance.links).toEqual(['#API_1']);
});
it('Anchor onClick event', () => {
let event;
let link;
const handleClick = (...arg) => {
[event, link] = arg;
};
const href = '#API';
const title = 'API';
const wrapper = mount(
<Anchor onClick={handleClick}>
<Link href={href} title={title} />
</Anchor>,
);
wrapper.find(`a[href="${href}"]`).simulate('click');
wrapper.instance().handleScroll();
expect(event).not.toBe(undefined);
expect(link).toEqual({ href, title });
});
it('Different function returns the same DOM', async () => {
let root = document.getElementById('root');
if (!root) {
root = document.createElement('div', { id: 'root' });
root.id = 'root';
document.body.appendChild(root);
}
mount(<div id="API">Hello</div>, { attachTo: root });
const getContainerA = () => {
return document.getElementById('API');
};
const getContainerB = () => {
return document.getElementById('API');
};
const wrapper = mount(
<Anchor getContainer={getContainerA}>
<Link href="#API" title="API" />
</Anchor>,
);
const removeListenerSpy = jest.spyOn(wrapper.instance().scrollEvent, 'remove');
await sleep(1000);
wrapper.setProps({ getContainer: getContainerB });
expect(removeListenerSpy).not.toHaveBeenCalled();
});
it('Different function returns different DOM', async () => {
let root = document.getElementById('root');
if (!root) {
root = document.createElement('div', { id: 'root' });
root.id = 'root';
document.body.appendChild(root);
}
mount(
<div>
<div id="API1">Hello</div>
<div id="API2">World</div>
</div>,
{ attachTo: root },
);
const getContainerA = () => {
return document.getElementById('API1');
};
const getContainerB = () => {
return document.getElementById('API2');
};
const wrapper = mount(
<Anchor getContainer={getContainerA}>
<Link href="#API1" title="API1" />
<Link href="#API2" title="API2" />
</Anchor>,
);
const removeListenerSpy = jest.spyOn(wrapper.instance().scrollEvent, 'remove');
expect(removeListenerSpy).not.toHaveBeenCalled();
await sleep(1000);
wrapper.setProps({ getContainer: getContainerB });
expect(removeListenerSpy).toHaveBeenCalled();
});
it('Same function returns the same DOM', () => {
let root = document.getElementById('root');
if (!root) {
root = document.createElement('div', { id: 'root' });
root.id = 'root';
document.body.appendChild(root);
}
mount(<div id="API">Hello</div>, { attachTo: root });
const getContainer = () => document.getElementById('API');
const wrapper = mount(
<Anchor getContainer={getContainer}>
<Link href="#API" title="API" />
</Anchor>,
);
wrapper.find('a[href="#API"]').simulate('click');
wrapper.instance().handleScroll();
expect(wrapper.instance().state).not.toBe(null);
});
it('Same function returns different DOM', async () => {
let root = document.getElementById('root');
if (!root) {
root = document.createElement('div', { id: 'root' });
root.id = 'root';
document.body.appendChild(root);
}
mount(
<div>
<div id="API1">Hello</div>
<div id="API2">World</div>
</div>,
{ attachTo: root },
);
const holdContainer = {
container: document.getElementById('API1'),
};
const getContainer = () => {
return holdContainer.container;
};
const wrapper = mount(
<Anchor getContainer={getContainer}>
<Link href="#API1" title="API1" />
<Link href="#API2" title="API2" />
</Anchor>,
);
const removeListenerSpy = jest.spyOn(wrapper.instance().scrollEvent, 'remove');
expect(removeListenerSpy).not.toHaveBeenCalled();
await sleep(1000);
holdContainer.container = document.getElementById('API2');
wrapper.setProps({ 'data-only-trigger-re-render': true });
expect(removeListenerSpy).toHaveBeenCalled();
});
it('Anchor getCurrentAnchor prop', () => {
const getCurrentAnchor = () => '#API2';
const wrapper = mount(
<Anchor getCurrentAnchor={getCurrentAnchor}>
<Link href="#API1" title="API1" />
<Link href="#API2" title="API2" />
</Anchor>,
);
expect(wrapper.instance().state.activeLink).toBe('#API2');
});
it('Anchor targetOffset prop', async () => {
let dateNowMock;
function dataNowMockFn() {
let start = 0;
const handler = () => {
return (start += 1000);
};
return jest.spyOn(Date, 'now').mockImplementation(handler);
}
dateNowMock = dataNowMockFn();
const scrollToSpy = jest.spyOn(window, 'scrollTo');
let root = document.getElementById('root');
if (!root) {
root = document.createElement('div', { id: 'root' });
root.id = 'root';
document.body.appendChild(root);
}
mount(<h1 id="API">Hello</h1>, { attachTo: root });
const wrapper = mount(
<Anchor>
<Link href="#API" title="API" />
</Anchor>,
);
wrapper.instance().handleScrollTo('#API');
await sleep(20);
expect(scrollToSpy).toHaveBeenLastCalledWith(0, 1000);
dateNowMock = dataNowMockFn();
wrapper.setProps({ offsetTop: 100 });
wrapper.instance().handleScrollTo('#API');
await sleep(20);
expect(scrollToSpy).toHaveBeenLastCalledWith(0, 900);
dateNowMock = dataNowMockFn();
wrapper.setProps({ targetOffset: 200 });
wrapper.instance().handleScrollTo('#API');
await sleep(20);
expect(scrollToSpy).toHaveBeenLastCalledWith(0, 800);
dateNowMock.mockRestore();
});
it('Anchor onChange prop', async () => {
const onChange = jest.fn();
const wrapper = mount(
<Anchor onChange={onChange}>
<Link href="#API1" title="API1" />
<Link href="#API2" title="API2" />
</Anchor>,
);
expect(onChange).toHaveBeenCalledTimes(1);
wrapper.instance().handleScrollTo('#API2');
expect(onChange).toHaveBeenCalledTimes(2);
expect(onChange).toHaveBeenCalledWith('#API2');
});
});

View File

@@ -0,0 +1,469 @@
import React from 'react';
import { mount } from 'enzyme';
import Anchor from '..';
import { sleep } from '../../../tests/utils';
const { Link } = Anchor;
function createGetContainer(id: string) {
return () => {
const container = document.getElementById(id);
if (container == null) {
throw new Error();
}
return container;
};
}
function createDiv() {
const root = document.createElement('div');
document.body.appendChild(root);
return root;
}
let idCounter = 0;
const getHashUrl = () => `Anchor-API-${idCounter++}`;
describe('Anchor Render', () => {
const getBoundingClientRectMock = jest.spyOn(
HTMLHeadingElement.prototype,
'getBoundingClientRect',
);
const getClientRectsMock = jest.spyOn(HTMLHeadingElement.prototype, 'getClientRects');
beforeAll(() => {
getBoundingClientRectMock.mockReturnValue({
width: 100,
height: 100,
top: 1000,
} as DOMRect);
getClientRectsMock.mockReturnValue({ length: 1 } as DOMRectList);
});
afterAll(() => {
getBoundingClientRectMock.mockRestore();
getClientRectsMock.mockRestore();
});
it('Anchor render perfectly', () => {
const hash = getHashUrl();
const wrapper = mount<Anchor>(
<Anchor>
<Link href={`#${hash}`} title={hash} />
</Anchor>,
);
wrapper.find(`a[href="#${hash}"]`).simulate('click');
wrapper.instance().handleScroll();
expect(wrapper.instance().state).not.toBe(null);
});
it('Anchor render perfectly for complete href - click', () => {
const hash = getHashUrl();
const wrapper = mount<Anchor>(
<Anchor>
<Link href={`http://www.example.com/#${hash}`} title={hash} />
</Anchor>,
);
wrapper.find(`a[href="http://www.example.com/#${hash}"]`).simulate('click');
expect(wrapper.instance().state.activeLink).toBe(`http://www.example.com/#${hash}`);
});
it('Anchor render perfectly for complete href - hash router', async () => {
const root = createDiv();
const scrollToSpy = jest.spyOn(window, 'scrollTo');
mount(<div id="/faq?locale=en#Q1">Q1</div>, { attachTo: root });
const wrapper = mount<Anchor>(
<Anchor>
<Link href="/#/faq?locale=en#Q1" title="Q1" />
</Anchor>,
);
wrapper.instance().handleScrollTo('/#/faq?locale=en#Q1');
expect(wrapper.instance().state.activeLink).toBe('/#/faq?locale=en#Q1');
expect(scrollToSpy).not.toHaveBeenCalled();
await sleep(1000);
expect(scrollToSpy).toHaveBeenCalled();
});
it('Anchor render perfectly for complete href - scroll', () => {
const hash = getHashUrl();
const root = createDiv();
mount(<div id={hash}>Hello</div>, { attachTo: root });
const wrapper = mount<Anchor>(
<Anchor>
<Link href={`http://www.example.com/#${hash}`} title={hash} />
</Anchor>,
);
wrapper.instance().handleScroll();
expect(wrapper.instance().state.activeLink).toBe(`http://www.example.com/#${hash}`);
});
it('Anchor render perfectly for complete href - scrollTo', async () => {
const hash = getHashUrl();
const scrollToSpy = jest.spyOn(window, 'scrollTo');
const root = createDiv();
mount(<div id={`#${hash}`}>Hello</div>, { attachTo: root });
const wrapper = mount<Anchor>(
<Anchor>
<Link href={`##${hash}`} title={hash} />
</Anchor>,
);
wrapper.instance().handleScrollTo(`##${hash}`);
expect(wrapper.instance().state.activeLink).toBe(`##${hash}`);
const calls = scrollToSpy.mock.calls.length;
await sleep(1000);
expect(scrollToSpy.mock.calls.length).toBeGreaterThan(calls);
});
it('should remove listener when unmount', async () => {
const hash = getHashUrl();
const wrapper = mount<Anchor>(
<Anchor>
<Link href={`#${hash}`} title={hash} />
</Anchor>,
);
const removeListenerSpy = jest.spyOn((wrapper.instance() as any).scrollEvent, 'remove');
wrapper.unmount();
expect(removeListenerSpy).toHaveBeenCalled();
});
it('should unregister link when unmount children', async () => {
const hash = getHashUrl();
const wrapper = mount<Anchor>(
<Anchor>
<Link href={`#${hash}`} title={hash} />
</Anchor>,
);
expect((wrapper.instance() as any).links).toEqual([`#${hash}`]);
wrapper.setProps({ children: null });
expect((wrapper.instance() as any).links).toEqual([]);
});
it('should update links when link href update', async () => {
const hash = getHashUrl();
let anchorInstance: Anchor | null = null;
function AnchorUpdate({ href }: { href: string }) {
return (
<Anchor
ref={c => {
anchorInstance = c;
}}
>
<Link href={href} title={hash} />
</Anchor>
);
}
const wrapper = mount(<AnchorUpdate href={`#${hash}`} />);
if (anchorInstance == null) {
throw new Error('anchorInstance should not be null');
}
expect((anchorInstance as any).links).toEqual([`#${hash}`]);
wrapper.setProps({ href: `#${hash}_1` });
expect((anchorInstance as any).links).toEqual([`#${hash}_1`]);
});
it('Anchor onClick event', () => {
const hash = getHashUrl();
let event;
let link;
const handleClick = (
e: React.MouseEvent<HTMLElement>,
_link: { title: React.ReactNode; href: string },
) => {
event = e;
link = _link;
};
const href = `#${hash}`;
const title = hash;
const wrapper = mount<Anchor>(
<Anchor onClick={handleClick}>
<Link href={href} title={title} />
</Anchor>,
);
wrapper.find(`a[href="${href}"]`).simulate('click');
wrapper.instance().handleScroll();
expect(event).not.toBe(undefined);
expect(link).toEqual({ href, title });
});
it('Different function returns the same DOM', async () => {
const hash = getHashUrl();
const root = createDiv();
mount(<div id={hash}>Hello</div>, { attachTo: root });
const getContainerA = createGetContainer(hash);
const getContainerB = createGetContainer(hash);
const wrapper = mount<Anchor>(
<Anchor getContainer={getContainerA}>
<Link href={`#${hash}`} title={hash} />
</Anchor>,
);
const removeListenerSpy = jest.spyOn((wrapper.instance() as any).scrollEvent, 'remove');
await sleep(1000);
wrapper.setProps({ getContainer: getContainerB });
expect(removeListenerSpy).not.toHaveBeenCalled();
});
it('Different function returns different DOM', async () => {
const hash1 = getHashUrl();
const hash2 = getHashUrl();
const root = createDiv();
mount(
<div>
<div id={hash1}>Hello</div>
<div id={hash2}>World</div>
</div>,
{ attachTo: root },
);
const getContainerA = createGetContainer(hash1);
const getContainerB = createGetContainer(hash2);
const wrapper = mount<Anchor>(
<Anchor getContainer={getContainerA}>
<Link href={`#${hash1}`} title={hash1} />
<Link href={`#${hash2}`} title={hash2} />
</Anchor>,
);
const removeListenerSpy = jest.spyOn((wrapper.instance() as any).scrollEvent, 'remove');
expect(removeListenerSpy).not.toHaveBeenCalled();
await sleep(1000);
wrapper.setProps({ getContainer: getContainerB });
expect(removeListenerSpy).toHaveBeenCalled();
});
it('Same function returns the same DOM', () => {
const hash = getHashUrl();
const root = createDiv();
mount(<div id={hash}>Hello</div>, { attachTo: root });
const getContainer = createGetContainer(hash);
const wrapper = mount(
<Anchor getContainer={getContainer}>
<Link href={`#${hash}`} title={hash} />
</Anchor>,
);
wrapper.find(`a[href="#${hash}"]`).simulate('click');
(wrapper.instance() as any).handleScroll();
expect(wrapper.instance().state).not.toBe(null);
});
it('Same function returns different DOM', async () => {
const hash1 = getHashUrl();
const hash2 = getHashUrl();
const root = createDiv();
mount(
<div>
<div id={hash1}>Hello</div>
<div id={hash2}>World</div>
</div>,
{ attachTo: root },
);
const holdContainer = {
container: document.getElementById(hash1),
};
const getContainer = () => {
if (holdContainer.container == null) {
throw new Error('container should not be null');
}
return holdContainer.container;
};
const wrapper = mount(
<Anchor getContainer={getContainer}>
<Link href={`#${hash1}`} title={hash1} />
<Link href={`#${hash2}`} title={hash2} />
</Anchor>,
);
const removeListenerSpy = jest.spyOn((wrapper.instance() as any).scrollEvent, 'remove');
expect(removeListenerSpy).not.toHaveBeenCalled();
await sleep(1000);
holdContainer.container = document.getElementById(hash2);
wrapper.setProps({ 'data-only-trigger-re-render': true });
expect(removeListenerSpy).toHaveBeenCalled();
});
it('Anchor getCurrentAnchor prop', () => {
const hash1 = getHashUrl();
const hash2 = getHashUrl();
const getCurrentAnchor = () => `#${hash2}`;
const wrapper = mount<Anchor>(
<Anchor getCurrentAnchor={getCurrentAnchor}>
<Link href={`#${hash1}`} title={hash1} />
<Link href={`#${hash2}`} title={hash2} />
</Anchor>,
);
expect(wrapper.instance().state.activeLink).toBe(`#${hash2}`);
});
it('Anchor targetOffset prop', async () => {
const hash = getHashUrl();
let dateNowMock;
function dataNowMockFn() {
let start = 0;
const handler = () => {
return (start += 1000);
};
return jest.spyOn(Date, 'now').mockImplementation(handler);
}
dateNowMock = dataNowMockFn();
const scrollToSpy = jest.spyOn(window, 'scrollTo');
const root = createDiv();
mount(<h1 id={hash}>Hello</h1>, { attachTo: root });
const wrapper = mount<Anchor>(
<Anchor>
<Link href={`#${hash}`} title={hash} />
</Anchor>,
);
wrapper.instance().handleScrollTo(`#${hash}`);
await sleep(30);
expect(scrollToSpy).toHaveBeenLastCalledWith(0, 1000);
dateNowMock = dataNowMockFn();
wrapper.setProps({ offsetTop: 100 });
wrapper.instance().handleScrollTo(`#${hash}`);
await sleep(30);
expect(scrollToSpy).toHaveBeenLastCalledWith(0, 900);
dateNowMock = dataNowMockFn();
wrapper.setProps({ targetOffset: 200 });
wrapper.instance().handleScrollTo(`#${hash}`);
await sleep(30);
expect(scrollToSpy).toHaveBeenLastCalledWith(0, 800);
dateNowMock.mockRestore();
});
it('Anchor onChange prop', async () => {
const hash1 = getHashUrl();
const hash2 = getHashUrl();
const onChange = jest.fn();
const wrapper = mount<Anchor>(
<Anchor onChange={onChange}>
<Link href={`#${hash1}`} title={hash1} />
<Link href={`#${hash2}`} title={hash2} />
</Anchor>,
);
expect(onChange).toHaveBeenCalledTimes(1);
wrapper.instance().handleScrollTo(hash2);
expect(onChange).toHaveBeenCalledTimes(2);
expect(onChange).toHaveBeenCalledWith(hash2);
});
it('invalid hash', async () => {
const wrapper = mount<Anchor>(
<Anchor>
<Link href="notexsited" title="title" />
</Anchor>,
);
wrapper.find(`a[href="notexsited"]`).simulate('click');
wrapper.instance().handleScrollTo('notexsited');
expect(wrapper.instance().state).not.toBe(null);
});
it('test edge case when getBoundingClientRect return zero size', async () => {
getBoundingClientRectMock.mockReturnValue({
width: 0,
height: 0,
top: 1000,
} as DOMRect);
const hash = getHashUrl();
let dateNowMock;
function dataNowMockFn() {
let start = 0;
const handler = () => {
return (start += 1000);
};
return jest.spyOn(Date, 'now').mockImplementation(handler);
}
dateNowMock = dataNowMockFn();
const scrollToSpy = jest.spyOn(window, 'scrollTo');
const root = createDiv();
mount(<h1 id={hash}>Hello</h1>, { attachTo: root });
const wrapper = mount<Anchor>(
<Anchor>
<Link href={`#${hash}`} title={hash} />
</Anchor>,
);
wrapper.instance().handleScrollTo(`#${hash}`);
await sleep(30);
expect(scrollToSpy).toHaveBeenLastCalledWith(0, 1000);
dateNowMock = dataNowMockFn();
wrapper.setProps({ offsetTop: 100 });
wrapper.instance().handleScrollTo(`#${hash}`);
await sleep(30);
expect(scrollToSpy).toHaveBeenLastCalledWith(0, 900);
dateNowMock = dataNowMockFn();
wrapper.setProps({ targetOffset: 200 });
wrapper.instance().handleScrollTo(`#${hash}`);
await sleep(30);
expect(scrollToSpy).toHaveBeenLastCalledWith(0, 800);
dateNowMock.mockRestore();
getBoundingClientRectMock.mockReturnValue({
width: 100,
height: 100,
top: 1000,
} as DOMRect);
});
it('test edge case when container is not windows', async () => {
const hash = getHashUrl();
let dateNowMock;
function dataNowMockFn() {
let start = 0;
const handler = () => {
return (start += 1000);
};
return jest.spyOn(Date, 'now').mockImplementation(handler);
}
dateNowMock = dataNowMockFn();
const scrollToSpy = jest.spyOn(window, 'scrollTo');
const root = createDiv();
mount(<h1 id={hash}>Hello</h1>, { attachTo: root });
const wrapper = mount<Anchor>(
<Anchor getContainer={() => document.body}>
<Link href={`#${hash}`} title={hash} />
</Anchor>,
);
wrapper.instance().handleScrollTo(`#${hash}`);
await sleep(30);
expect(scrollToSpy).toHaveBeenLastCalledWith(0, 800);
dateNowMock = dataNowMockFn();
wrapper.setProps({ offsetTop: 100 });
wrapper.instance().handleScrollTo(`#${hash}`);
await sleep(30);
expect(scrollToSpy).toHaveBeenLastCalledWith(0, 800);
dateNowMock = dataNowMockFn();
wrapper.setProps({ targetOffset: 200 });
wrapper.instance().handleScrollTo(`#${hash}`);
await sleep(30);
expect(scrollToSpy).toHaveBeenLastCalledWith(0, 800);
dateNowMock.mockRestore();
});
});

View File

@@ -0,0 +1,6 @@
import * as React from 'react';
import { AntAnchor } from './Anchor';
const AnchorContext = React.createContext<AntAnchor>(null as any);
export default AnchorContext;

View File

@@ -3,6 +3,7 @@ category: Components
type: Other
cols: 2
title: Anchor
cover: https://gw.alipayobjects.com/zos/alicdn/ep_L42LFy/Anchor.svg
---
Hyperlinks to scroll on one page.

View File

@@ -4,6 +4,7 @@ subtitle: 锚点
cols: 2
type: 其他
title: Anchor
cover: https://gw.alipayobjects.com/zos/alicdn/ep_L42LFy/Anchor.svg
---
用于跳转到页面指定位置。

View File

@@ -52,7 +52,7 @@
}
&-link {
padding: 7px 0 7px 16px;
padding: @anchor-link-padding;
line-height: 1.143;
&-title {

View File

@@ -1,7 +1,7 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`renders ./components/auto-complete/demo/basic.md correctly 1`] = `
<div>
Array [
<div
class="ant-select ant-select-auto-complete ant-select-single ant-select-show-search"
style="width:200px"
@@ -30,9 +30,9 @@ exports[`renders ./components/auto-complete/demo/basic.md correctly 1`] = `
input here
</span>
</div>
</div>
<br />
<br />
</div>,
<br />,
<br />,
<div
class="ant-select ant-select-auto-complete ant-select-single ant-select-show-search"
style="width:200px"
@@ -61,8 +61,8 @@ exports[`renders ./components/auto-complete/demo/basic.md correctly 1`] = `
control mode
</span>
</div>
</div>
</div>
</div>,
]
`;
exports[`renders ./components/auto-complete/demo/certain-category.md correctly 1`] = `
@@ -256,6 +256,7 @@ exports[`renders ./components/auto-complete/demo/form-debug.md correctly 1`] = `
readonly=""
role="combobox"
style="opacity:0"
unselectable="on"
value=""
/>
</span>
@@ -341,6 +342,7 @@ exports[`renders ./components/auto-complete/demo/form-debug.md correctly 1`] = `
readonly=""
role="combobox"
style="opacity:0"
unselectable="on"
value=""
/>
</span>
@@ -534,6 +536,7 @@ exports[`renders ./components/auto-complete/demo/form-debug.md correctly 1`] = `
readonly=""
role="combobox"
style="opacity:0"
unselectable="on"
value=""
/>
</span>
@@ -675,6 +678,7 @@ exports[`renders ./components/auto-complete/demo/form-debug.md correctly 1`] = `
readonly=""
role="combobox"
style="opacity:0"
unselectable="on"
value=""
/>
</span>
@@ -817,6 +821,7 @@ exports[`renders ./components/auto-complete/demo/form-debug.md correctly 1`] = `
readonly=""
role="combobox"
style="opacity:0"
unselectable="on"
value=""
/>
</span>

View File

@@ -1,6 +1,87 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`AutoComplete with Custom Input Element Render rtl render component should be rendered correctly in RTL direction 1`] = `
exports[`AutoComplete legacy dataSource should accept react element option 1`] = `
<div
class="ant-select ant-select-auto-complete ant-select-single ant-select-open ant-select-show-search"
>
<div
class="ant-select-selector"
>
<span
class="ant-select-selection-search"
>
<input
aria-activedescendant="undefined_list_0"
aria-autocomplete="list"
aria-controls="undefined_list"
aria-expanded="true"
aria-haspopup="listbox"
aria-owns="undefined_list"
autocomplete="off"
class="ant-select-selection-search-input"
role="combobox"
value=""
/>
</span>
<span
class="ant-select-selection-placeholder"
/>
</div>
<div>
<div
class="ant-select-dropdown"
style="opacity:0"
>
<div>
<div
id="undefined_list"
role="listbox"
style="height:0;width:0;overflow:hidden"
>
<div
aria-label="ReactNode"
aria-selected="false"
id="undefined_list_0"
role="option"
>
key
</div>
</div>
<div
class=""
style="height:256px"
>
<div>
<div
class=""
style="display:flex;flex-direction:column"
>
<div
aria-selected="false"
class="ant-select-item ant-select-item-option ant-select-item-option-active"
>
<div
class="ant-select-item-option-content"
>
ReactNode
</div>
<span
aria-hidden="true"
class="ant-select-item-option-state"
style="user-select:none;-webkit-user-select:none"
unselectable="on"
/>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
`;
exports[`AutoComplete rtl render component should be rendered correctly in RTL direction 1`] = `
<div
class="ant-select ant-select-auto-complete ant-select-rtl ant-select-single ant-select-show-search"
>

View File

@@ -4,7 +4,7 @@ import AutoComplete from '..';
import mountTest from '../../../tests/shared/mountTest';
import rtlTest from '../../../tests/shared/rtlTest';
describe('AutoComplete with Custom Input Element Render', () => {
describe('AutoComplete', () => {
mountTest(AutoComplete);
rtlTest(AutoComplete);
@@ -52,4 +52,21 @@ describe('AutoComplete with Custom Input Element Render', () => {
// eslint-disable-next-line no-console
console.error.mockRestore();
});
it('legacy dataSource should accept react element option', () => {
const wrapper = mount(<AutoComplete open dataSource={[<span key="key">ReactNode</span>]} />);
expect(wrapper).toMatchRenderedSnapshot();
});
it('legacy AutoComplete.Option should be compatiable', () => {
const wrapper = mount(
<AutoComplete>
<AutoComplete.Option value="111">111</AutoComplete.Option>
<AutoComplete.Option value="222">222</AutoComplete.Option>
</AutoComplete>,
);
expect(wrapper.find('input').length).toBe(1);
wrapper.find('input').simulate('change', { target: { value: '1' } });
expect(wrapper.find('.ant-select-item-option').length).toBe(2);
});
});

View File

@@ -37,7 +37,7 @@ const Complete: React.FC = () => {
setValue(data);
};
return (
<div>
<>
<AutoComplete
options={options}
style={{ width: 200 }}
@@ -56,7 +56,7 @@ const Complete: React.FC = () => {
onChange={onChange}
placeholder="control mode"
/>
</div>
</>
);
};

View File

@@ -67,18 +67,16 @@ const options = [
},
];
const Complete: React.FC = () => {
return (
<AutoComplete
dropdownClassName="certain-category-search-dropdown"
dropdownMatchSelectWidth={500}
style={{ width: 250 }}
options={options}
>
<Input.Search size="large" placeholder="input here" />
</AutoComplete>
);
};
const Complete: React.FC = () => (
<AutoComplete
dropdownClassName="certain-category-search-dropdown"
dropdownMatchSelectWidth={500}
style={{ width: 250 }}
options={options}
>
<Input.Search size="large" placeholder="input here" />
</AutoComplete>
);
ReactDOM.render(<Complete />, mountNode);
```

View File

@@ -22,25 +22,25 @@ const formItemLayout = {
};
ReactDOM.render(
<Form style={{ margin: '0 auto' }}>
<Form.Item label="单独 AutoComplete" {...formItemLayout}>
<Form style={{ margin: '0 auto' }} {...formItemLayout}>
<Form.Item label="单独 AutoComplete">
<AutoComplete />
</Form.Item>
<Form.Item label="单独 TreeSelect" {...formItemLayout}>
<Form.Item label="单独 TreeSelect">
<TreeSelect />
</Form.Item>
<Form.Item label="添加 Input.Group 正常" {...formItemLayout}>
<Form.Item label="添加 Input.Group 正常">
<Input.Group compact>
<TreeSelect style={{ width: '30%' }} />
<AutoComplete />
</Input.Group>
</Form.Item>
<Form.Item label="包含 search 图标正常" {...formItemLayout}>
<Form.Item label="包含 search 图标正常">
<AutoComplete>
<Input suffix={<SearchOutlined />} />
</AutoComplete>
</Form.Item>
<Form.Item label="同时有 Input.Group 和图标发生移位" {...formItemLayout}>
<Form.Item label="同时有 Input.Group 和图标发生移位">
<Input.Group compact>
<TreeSelect style={{ width: '30%' }} />
<AutoComplete>
@@ -48,7 +48,7 @@ ReactDOM.render(
</AutoComplete>
</Input.Group>
</Form.Item>
<Form.Item label="同时有 Input.Group 和 Search 组件发生移位" {...formItemLayout}>
<Form.Item label="同时有 Input.Group 和 Search 组件发生移位">
<Input.Group compact>
<TreeSelect style={{ width: '30%' }} />
<AutoComplete>
@@ -56,7 +56,7 @@ ReactDOM.render(
</AutoComplete>
</Input.Group>
</Form.Item>
<Form.Item label="Input Group 和 Button 结合" {...formItemLayout}>
<Form.Item label="Input Group 和 Button 结合">
<Input.Group compact>
<TreeSelect style={{ width: '20%' }} />
<AutoComplete>

View File

@@ -22,18 +22,16 @@ const options = [
{ value: 'Wall Street' },
];
const Complete: React.FC = () => {
return (
<AutoComplete
style={{ width: 200 }}
options={options}
placeholder="try to type `b`"
filterOption={(inputValue, option) =>
option.value.toUpperCase().indexOf(inputValue.toUpperCase()) !== -1
}
/>
);
}
const Complete: React.FC = () => (
<AutoComplete
style={{ width: 200 }}
options={options}
placeholder="try to type `b`"
filterOption={(inputValue, option) =>
option.value.toUpperCase().indexOf(inputValue.toUpperCase()) !== -1
}
/>
);
ReactDOM.render(<Complete />, mountNode);
```

View File

@@ -30,14 +30,13 @@ const Complete: React.FC = () => {
}
setResult(res);
};
const children = result.map((email: string) => (
<Option key={email} value={email}>
{email}
</Option>
));
return (
<AutoComplete style={{ width: 200 }} onSearch={handleSearch} placeholder="input here">
{children}
{result.map((email: string) => (
<Option key={email} value={email}>
{email}
</Option>
))}
</AutoComplete>
);
};

View File

@@ -3,6 +3,7 @@ category: Components
type: Data Entry
cols: 2
title: AutoComplete
cover: https://gw.alipayobjects.com/zos/alicdn/gtGCgVDKv/AutoComplete.svg
---
Autocomplete function of input field.
@@ -34,6 +35,7 @@ When there is a need for autocomplete functionality.
| defaultOpen | Initial open state of dropdown | boolean | - | |
| open | Controlled open state of dropdown | boolean | - | |
| onDropdownVisibleChange | Call when dropdown open | function(open) | - | |
| notFoundContent | Specify content to show when no result matches.. | string | 'Not Found' | |
## Methods

View File

@@ -12,7 +12,8 @@ import classNames from 'classnames';
import omit from 'omit.js';
import Select, { InternalSelectProps, OptionType } from '../select';
import { ConfigConsumer, ConfigConsumerProps } from '../config-provider';
import warning from '../_util/warning';
import devWarning from '../_util/devWarning';
import { isValidElement } from '../_util/reactNode';
const { Option } = Select;
@@ -25,7 +26,10 @@ export interface DataSourceItemObject {
export type DataSourceItemType = string | DataSourceItemObject;
export interface AutoCompleteProps
extends Omit<InternalSelectProps<string>, 'inputIcon' | 'loading' | 'mode' | 'optionLabelProp' | 'labelInValue'> {
extends Omit<
InternalSelectProps<string>,
'inputIcon' | 'loading' | 'mode' | 'optionLabelProp' | 'labelInValue'
> {
dataSource?: DataSourceItemType[];
}
@@ -46,7 +50,7 @@ const AutoComplete: React.RefForwardingComponent<Select, AutoCompleteProps> = (p
if (
childNodes.length === 1 &&
React.isValidElement(childNodes[0]) &&
isValidElement(childNodes[0]) &&
!isSelectOptionOrSelectOptGroup(childNodes[0])
) {
customizeInput = childNodes[0];
@@ -63,7 +67,7 @@ const AutoComplete: React.RefForwardingComponent<Select, AutoCompleteProps> = (p
} else {
optionChildren = dataSource
? dataSource.map(item => {
if (React.isValidElement(item)) {
if (isValidElement(item)) {
return item;
}
switch (typeof item) {
@@ -90,13 +94,13 @@ const AutoComplete: React.RefForwardingComponent<Select, AutoCompleteProps> = (p
// ============================ Warning ============================
React.useEffect(() => {
warning(
devWarning(
!('dataSource' in props),
'AutoComplete',
'`dataSource` is deprecated, please use `options` instead.',
);
warning(
devWarning(
!customizeInput || !('size' in props),
'AutoComplete',
'You need to control style self instead of setting `size` when using customize input.',

View File

@@ -4,6 +4,7 @@ subtitle: 自动完成
type: 数据录入
cols: 2
title: AutoComplete
cover: https://gw.alipayobjects.com/zos/alicdn/gtGCgVDKv/AutoComplete.svg
---
输入框自动完成功能。
@@ -36,6 +37,7 @@ title: AutoComplete
| defaultOpen | 是否默认展开下拉菜单 | boolean | - | |
| open | 是否展开下拉菜单 | boolean | - | |
| onDropdownVisibleChange | 展开下拉菜单的回调 | function(open) | - | |
| notFoundContent | 当下拉列表为空时显示的内容 | ReactNode | - | |
## 方法

View File

@@ -40,19 +40,10 @@ describe('Avatar Render', () => {
global.document.body.appendChild(div);
const wrapper = mount(<Avatar src="http://error.url">Fallback</Avatar>, { attachTo: div });
wrapper.instance().setScale = jest.fn(() => {
if (wrapper.state().scale === 0.5) {
return;
}
wrapper.instance().setState({ scale: 0.5 });
});
wrapper.find('img').simulate('error');
const children = wrapper.find('.ant-avatar-string');
expect(children.length).toBe(1);
expect(children.text()).toBe('Fallback');
expect(wrapper.instance().setScale).toHaveBeenCalled();
expect(div.querySelector('.ant-avatar-string').style.transform).toContain('scale(0.5)');
wrapper.detach();
global.document.body.removeChild(div);
@@ -136,6 +127,11 @@ describe('Avatar Render', () => {
expect(wrapper.state().scale).toBe(0.32);
});
it('should calculate scale of avatar children correctly with gap', () => {
const wrapper = mount(<Avatar gap={2}>Avatar</Avatar>);
expect(wrapper.state().scale).toBe(0.36);
});
it('should warning when pass a string as icon props', () => {
const warnSpy = jest.spyOn(console, 'error').mockImplementation(() => {});
mount(<Avatar size={64} icon="aa" />);
@@ -146,4 +142,16 @@ describe('Avatar Render', () => {
);
warnSpy.mockRestore();
});
it('support size is number', () => {
const wrapper = mount(<Avatar size={100}>TestString</Avatar>);
expect(wrapper).toMatchRenderedSnapshot();
});
it('support onMouseEnter', () => {
const onMouseEnter = jest.fn();
const wrapper = mount(<Avatar onMouseEnter={onMouseEnter}>TestString</Avatar>);
wrapper.simulate('mouseenter');
expect(onMouseEnter).toHaveBeenCalled();
});
});

View File

@@ -10,3 +10,17 @@ exports[`Avatar Render rtl render component should be rendered correctly in RTL
/>
</span>
`;
exports[`Avatar Render support size is number 1`] = `
<span
class="ant-avatar ant-avatar-circle"
style="width:100px;height:100px;line-height:100px;font-size:18px"
>
<span
class="ant-avatar-string"
style="opacity:0"
>
TestString
</span>
</span>
`;

View File

@@ -1,7 +1,7 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`renders ./components/avatar/demo/badge.md correctly 1`] = `
<div>
Array [
<span
class="avatar-item"
>
@@ -194,7 +194,7 @@ exports[`renders ./components/avatar/demo/badge.md correctly 1`] = `
</span>
</sup>
</span>
</span>
</span>,
<span>
<span
class="ant-badge"
@@ -228,12 +228,12 @@ exports[`renders ./components/avatar/demo/badge.md correctly 1`] = `
data-show="true"
/>
</span>
</span>
</div>
</span>,
]
`;
exports[`renders ./components/avatar/demo/basic.md correctly 1`] = `
<div>
Array [
<div>
<span
class="ant-avatar ant-avatar-circle ant-avatar-icon"
@@ -332,7 +332,7 @@ exports[`renders ./components/avatar/demo/basic.md correctly 1`] = `
</svg>
</span>
</span>
</div>
</div>,
<div>
<span
class="ant-avatar ant-avatar-square ant-avatar-icon"
@@ -431,12 +431,12 @@ exports[`renders ./components/avatar/demo/basic.md correctly 1`] = `
</svg>
</span>
</span>
</div>
</div>
</div>,
]
`;
exports[`renders ./components/avatar/demo/dynamic.md correctly 1`] = `
<div>
Array [
<span
class="ant-avatar ant-avatar-lg ant-avatar-circle"
style="background-color:#f56a00;vertical-align:middle"
@@ -447,21 +447,30 @@ exports[`renders ./components/avatar/demo/dynamic.md correctly 1`] = `
>
U
</span>
</span>
</span>,
<button
class="ant-btn ant-btn-sm"
style="margin:0 16px;vertical-align:middle"
type="button"
>
<span>
Change
ChangeUser
</span>
</button>
</div>
</button>,
<button
class="ant-btn ant-btn-sm"
style="vertical-align:middle"
type="button"
>
<span>
changeGap
</span>
</button>,
]
`;
exports[`renders ./components/avatar/demo/toggle-debug.md correctly 1`] = `
<div>
Array [
<button
class="ant-btn"
type="button"
@@ -469,7 +478,7 @@ exports[`renders ./components/avatar/demo/toggle-debug.md correctly 1`] = `
<span>
Toggle Avatar visibility
</span>
</button>
</button>,
<button
class="ant-btn"
type="button"
@@ -477,7 +486,7 @@ exports[`renders ./components/avatar/demo/toggle-debug.md correctly 1`] = `
<span>
Toggle Avatar size
</span>
</button>
</button>,
<button
class="ant-btn"
type="button"
@@ -485,9 +494,9 @@ exports[`renders ./components/avatar/demo/toggle-debug.md correctly 1`] = `
<span>
Change Avatar scale
</span>
</button>
<br />
<br />
</button>,
<br />,
<br />,
<div
style="text-align:center;transform:scale(1);margin-top:24px"
>
@@ -533,12 +542,12 @@ exports[`renders ./components/avatar/demo/toggle-debug.md correctly 1`] = `
/>
</span>
</div>
</div>
</div>
</div>,
]
`;
exports[`renders ./components/avatar/demo/type.md correctly 1`] = `
<div>
Array [
<span
class="ant-avatar ant-avatar-circle ant-avatar-icon"
>
@@ -562,7 +571,7 @@ exports[`renders ./components/avatar/demo/type.md correctly 1`] = `
/>
</svg>
</span>
</span>
</span>,
<span
class="ant-avatar ant-avatar-circle"
>
@@ -572,9 +581,10 @@ exports[`renders ./components/avatar/demo/type.md correctly 1`] = `
>
U
</span>
</span>
</span>,
<span
class="ant-avatar ant-avatar-circle"
style="width:40px;height:40px;line-height:40px;font-size:18px"
>
<span
class="ant-avatar-string"
@@ -582,14 +592,14 @@ exports[`renders ./components/avatar/demo/type.md correctly 1`] = `
>
USER
</span>
</span>
</span>,
<span
class="ant-avatar ant-avatar-circle ant-avatar-image"
>
<img
src="https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png"
/>
</span>
</span>,
<span
class="ant-avatar ant-avatar-circle"
style="color:#f56a00;background-color:#fde3cf"
@@ -600,7 +610,7 @@ exports[`renders ./components/avatar/demo/type.md correctly 1`] = `
>
U
</span>
</span>
</span>,
<span
class="ant-avatar ant-avatar-circle ant-avatar-icon"
style="background-color:#87d068"
@@ -625,6 +635,6 @@ exports[`renders ./components/avatar/demo/type.md correctly 1`] = `
/>
</svg>
</span>
</span>
</div>
</span>,
]
`;

View File

@@ -18,7 +18,7 @@ import { Avatar, Badge } from 'antd';
import { UserOutlined } from '@ant-design/icons';
ReactDOM.render(
<div>
<>
<span className="avatar-item">
<Badge count={1}>
<Avatar shape="square" icon={<UserOutlined />} />
@@ -29,7 +29,7 @@ ReactDOM.render(
<Avatar shape="square" icon={<UserOutlined />} />
</Badge>
</span>
</div>,
</>,
mountNode,
);
```

View File

@@ -18,7 +18,7 @@ import { Avatar } from 'antd';
import { UserOutlined } from '@ant-design/icons';
ReactDOM.render(
<div>
<>
<div>
<Avatar size={64} icon={<UserOutlined />} />
<Avatar size="large" icon={<UserOutlined />} />
@@ -31,7 +31,7 @@ ReactDOM.render(
<Avatar shape="square" icon={<UserOutlined />} />
<Avatar shape="square" size="small" icon={<UserOutlined />} />
</div>
</div>,
</>,
mountNode,
);
```
@@ -41,4 +41,8 @@ ReactDOM.render(
margin-top: 16px;
margin-right: 16px;
}
.ant-row-rtl #components-avatar-demo-basic .ant-avatar {
margin-right: 0;
margin-left: 16px;
}
</style>

View File

@@ -7,11 +7,11 @@ title:
## zh-CN
对于字符型的头像,当字符串较长时,字体大小可以根据头像宽度自动调整。
对于字符型的头像,当字符串较长时,字体大小可以根据头像宽度自动调整。也可使用 `gap` 来设置字符距离左右两侧边界单位像素。
## en-US
For letter type Avatar, when the letters are too long to display, the font size can be automatically adjusted according to the width of the Avatar.
For letter type Avatar, when the letters are too long to display, the font size can be automatically adjusted according to the width of the Avatar. You can also use `gap` to set the unit distance between left and right sides.
```tsx
import React, { useState } from 'react';
@@ -19,18 +19,24 @@ import { Avatar, Button } from 'antd';
const UserList = ['U', 'Lucy', 'Tom', 'Edward'];
const ColorList = ['#f56a00', '#7265e6', '#ffbf00', '#00a2ae'];
const GapList = [4, 3, 2, 1];
const Autoset: React.FC = () => {
const [user, setUser] = useState(UserList[0]);
const [color, setColor] = useState(ColorList[0]);
const [gap, setGap] = useState(GapList[0]);
const changeUser = () => {
const index = UserList.indexOf(user);
setUser(index < UserList.length - 1 ? UserList[index + 1] : UserList[0]);
setColor(index < ColorList.length - 1 ? ColorList[index + 1] : ColorList[0]);
};
const changeGap = () => {
const index = GapList.indexOf(gap);
setGap(index < GapList.length - 1 ? GapList[index + 1] : GapList[0]);
};
return (
<div>
<Avatar style={{ backgroundColor: color, verticalAlign: 'middle' }} size="large">
<>
<Avatar style={{ backgroundColor: color, verticalAlign: 'middle' }} size="large" gap={gap}>
{user}
</Avatar>
<Button
@@ -38,9 +44,12 @@ const Autoset: React.FC = () => {
style={{ margin: '0 16px', verticalAlign: 'middle' }}
onClick={changeUser}
>
Change
ChangeUser
</Button>
</div>
<Button size="small" style={{ verticalAlign: 'middle' }} onClick={changeGap}>
changeGap
</Button>
</>
);
};

View File

@@ -41,7 +41,7 @@ const App: React.FC = () => {
};
return (
<div>
<>
<Button onClick={toggle}>Toggle Avatar visibility</Button>
<Button onClick={toggleSize}>Toggle Avatar size</Button>
<Button onClick={changeScale}>Change Avatar scale</Button>
@@ -67,7 +67,7 @@ const App: React.FC = () => {
</Avatar>
</div>
</div>
</div>
</>
);
};

View File

@@ -18,14 +18,14 @@ import { Avatar } from 'antd';
import { UserOutlined } from '@ant-design/icons';
ReactDOM.render(
<div>
<>
<Avatar icon={<UserOutlined />} />
<Avatar>U</Avatar>
<Avatar>USER</Avatar>
<Avatar size={40}>USER</Avatar>
<Avatar src="https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png" />
<Avatar style={{ color: '#f56a00', backgroundColor: '#fde3cf' }}>U</Avatar>
<Avatar style={{ backgroundColor: '#87d068' }} icon={<UserOutlined />} />
</div>,
</>,
mountNode,
);
```
@@ -35,4 +35,8 @@ ReactDOM.render(
margin-top: 16px;
margin-right: 16px;
}
.ant-row-rtl #components-avatar-demo-type .ant-avatar {
margin-right: 0;
margin-left: 16px;
}
</style>

Some files were not shown because too many files have changed in this diff Show More