Compare commits

..

526 Commits
4.6.2 ... 4.8.4

Author SHA1 Message Date
偏右
5653f5f46f docs(): release 4.8.4 (#27802) 2020-11-16 22:00:00 +08:00
偏右
f4c7058bd9 fix: Modal.confirm locale missing (#27797)
* fix: Modal.confirm locale missing

* fix snapshot

* refactor
2020-11-16 20:21:39 +08:00
Tom Xu
ef77539920 refactor(search): use context (#27657)
* refactor(search): use context

* Update Search.tsx
2020-11-16 19:18:48 +08:00
偏右
e0c26b4ac1 style(💄): fix Button and Form loading spin animation (#27794) 2020-11-16 18:05:00 +08:00
Hossein Mohammadi
4b1000fb7f fix: React 17 findDOMNode is deprecated (#27755)
* fix: use ref instead of findDOMNode

* chore: use fillRef in setAndForwardRef

* chore: use rc-util fillRef instead

* chore: use support ref

* test: removed empty class

* chore: use composeRef instead of setAndForwardRef
2020-11-16 16:46:46 +08:00
youmoo
56b3c7539f docs: fix typo in demo (#27781) 2020-11-16 09:27:02 +08:00
陈帅
8a4f52e200 docs: add 4.8.3 changelog (#27772)
* add 4.8.3 changelog

* Update CHANGELOG.en-US.md

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

* Update CHANGELOG.en-US.md

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

* update changelog

* update snapshot

* fix changelog error

* Update CHANGELOG.en-US.md

* Update CHANGELOG.zh-CN.md

Co-authored-by: 偏右 <afc163@gmail.com>
Co-authored-by: xrkffgg <xrkffgg@gmail.com>
2020-11-16 09:18:05 +08:00
骗你是小猫咪
191c6aa25e test: disable image request (#27778) 2020-11-15 22:38:52 +08:00
shaodahong
c465e04c81 test: disable image request 2020-11-15 22:15:03 +08:00
骗你是小猫咪
3f126f116f test: skip tree virtual-scroll render (#27771)
* test: skip tree virtual-scroll render

* test: remove branches-ignore, and use head ref to fix when merged
2020-11-14 21:24:37 +08:00
Shengnan
9bcd511ae6 fix(select): tags mode white space wrapping issue (#27726)
Co-authored-by: baxtergu <gu.shengnan@iwhalecloud.com>
2020-11-14 16:30:13 +08:00
骗你是小猫咪
d514768eac test: and pull_request_target branches-ignore (#27728)
* test: and pull_request_target branches-ignore

* remove symbolsymbol

* use jest-puppeteer fix more launch

* increase timeout
2020-11-14 13:27:03 +08:00
shaodahong
4ce36d2680 increase timeout 2020-11-14 12:49:46 +08:00
shaodahong
427817fb1b use jest-puppeteer fix more launch 2020-11-14 12:49:45 +08:00
shaodahong
9cdb037409 remove symbolsymbol 2020-11-14 12:49:45 +08:00
shaodahong
70b90c076f test: and pull_request_target branches-ignore 2020-11-14 12:49:45 +08:00
偏右
e7bed7cff7 perf(📦): upgrade @ant-design/colors and remove rc-trigger from deps (#27761)
* perf(📦): upgrade @ant-design/colors

* move rc-trigger to devDeps

* fix lint

* update snapshot

* update snapshot

Co-authored-by: 二货机器人 <smith3816@gmail.com>
2020-11-14 00:43:12 +08:00
wf-erikslokharts
478f611a16 chore: refactor LoadingIcon.tsx (#27765) 2020-11-14 00:13:48 +08:00
Eugene Matvejev
d1d215e222 chore: improve code style and perf (#27760) 2020-11-13 19:37:23 +08:00
Eugene Matvejev
9913062d42 small cleanup in button.tsx (#27759) 2020-11-13 19:26:48 +08:00
Dominique Ng
5b46a49ce5 Fix typo for 'palette' (#27758) 2020-11-13 19:07:05 +08:00
偏右
a7e3812d02 perf: unify rc-trigger version (#27752) 2020-11-13 18:38:31 +08:00
LeoYang
520407925a docs(date-picker): modify datepicker select-in-range demo (#27751)
* feat: modify datepicker select-in-range demo

* fix: lint
2020-11-13 17:05:16 +08:00
afc163
7f8957eb9a docs(📖): improve useModal FAQ 2020-11-13 16:51:55 +08:00
二货机器人
7b9a79401f chore: bump field form version (#27741) 2020-11-13 14:19:52 +08:00
叶枫
1155d44321 fix: checked 非必须 (#27717)
* fix: checked 非必须

* docs: desc

* fix: 😶

* Update CheckableTag.tsx

Co-authored-by: 二货机器人 <smith3816@gmail.com>
2020-11-13 12:05:20 +08:00
Tom Xu
90872cf3bd docs(select): change demo to hook (#27736) 2020-11-13 09:33:57 +08:00
xrkffgg
c80524f475 fix: Typography.Link disabled hover style (#27734) 2020-11-13 09:06:35 +08:00
Shivam Modi
3d04e5d3fb docs: fixed nested ternary operator in Form (#27724) 2020-11-12 23:20:13 +08:00
einq7
652374ff4c fix: DateRangePicker hover effect overflow (#27731)
* fix: DateRangePicker hover effect overflow

* fix: update rtl style
2020-11-12 23:11:21 +08:00
Tom Xu
57246c518f docs(grid): fix api table (#27723) 2020-11-12 19:55:50 +08:00
Tom Xu
7b6bb4244d docs(radio): change demo to hook (#27722) 2020-11-12 19:54:57 +08:00
Tom Xu
3ad1887fff chore: update authors 2020-11-12 18:42:50 +08:00
zombiej
8d1ed2822b docs: Remove useless code 2020-11-12 11:32:10 +08:00
Shivam Modi
5818fdb1a2 fix Specific Note for option other for Gender in Form (#27704) 2020-11-12 11:30:56 +08:00
xrkffgg
9c009f9bdb style: add @radio-border-width (#27703) 2020-11-11 23:44:49 +08:00
Tom Xu
c3f6a38c65 docs(carousel): change demo to hook (#27698) 2020-11-11 20:13:36 +08:00
二货机器人
a987f7f3ed chore: UPDATE menu version (#27663)
* chore: UPDATE menu version

* test: Fix part test

* test: Fix menu test case

* Update package.json

* fix: popup position style

* test: Fix test case

* style: fix ltr transition-origin

* fix: multiple dropdown

* fix: RTL menu arrow pos

* Update package.json

* force re-build

* force re-build
2020-11-11 19:05:01 +08:00
Tom Xu
16093118a4 refactor(carousel): rewirte with hook (#27694)
* refactor(Carousel): rewirte with hook

* add coverage
2020-11-11 17:23:05 +08:00
偏右
af8a051c13 chore(): Add codacy-analysis.yml (#27695) 2020-11-11 17:14:30 +08:00
afc163
d4da406b13 docs(📖): improve cascader showSearch docs 2020-11-11 17:05:04 +08:00
Tom Xu
b3e75d5b57 style: fix Avatar src Image style (#27691) 2020-11-11 15:20:01 +08:00
偏右
6a1e9b0200 style: fix Select mutiple cursor position (#27689) 2020-11-11 11:53:02 +08:00
Tom Xu
4b8674d9e9 refactor(editable): rewrite with hook (#27655)
* refactor(editable): rewrite with hook

* Update Editable.tsx

* chore: imrpove

* Update Editable.tsx

* Update Editable.tsx

* Update Editable.tsx
2020-11-11 11:28:06 +08:00
jiang.he
9881be97fd fix: update the slice rule when the TextArea component limits maxLength (#27679) 2020-11-11 00:56:57 +08:00
fish yu
e5319bd1df fix: RangePicker align active-bar with small size (#27673)
* fix: RangePicker align active-bar with small size

* fix: RangePicker align active-bar with small size on RTL
2020-11-10 14:58:23 +08:00
偏右
d0a7f3f79a chore: 🆙 upgrade devDeps (#27672) 2020-11-10 13:03:03 +08:00
xrkffgg
a3b05577a9 perf: reduce css (#27670) 2020-11-10 11:16:27 +08:00
二货机器人
05e9edc7e4 chore: bump rc-field-form (#27664) 2020-11-09 22:58:06 +08:00
afc163
3031a7e6b2 site: fix Table Drag sorting demo
close #27623
2020-11-09 20:10:27 +08:00
骗你是小猫咪
1b7a642b57 test: fix pull request target action ref (#27649)
* test: pull request target action

* fix checkout pr ref
2020-11-09 18:13:13 +08:00
偏右
e39407e1e5 docs: release 4.8.2 (#27652)
* docs:  release 4.8.2

* update changelog
2020-11-09 16:48:01 +08:00
偏右
f4d5017599 fix: Steps navigation broken style (#27654)
* fix: Steps navigation broken style

close #27653

* fix steps custom icon
2020-11-09 16:33:53 +08:00
偏右
4f9b97c619 fix: Pagination jumper margin lost (#27650)
close #27648
2020-11-09 15:17:43 +08:00
偏右
3fcecdde0a docs: release 4.8.1 (#27635) 2020-11-09 11:51:03 +08:00
xrkffgg
395cc5674e style: optimize pagination link (#27646) 2020-11-09 11:50:42 +08:00
Tom Xu
e9591e858f docs(menu): sider demo change to hook (#27643) 2020-11-09 10:20:26 +08:00
二货机器人
6b01e2b2fb fix: Menu bg style flickering (#27640)
* fix: Menu bg style

* fix lint
2020-11-09 10:13:06 +08:00
Tom Xu
a2acc56235 docs(menu): switch mode demo change to hook (#27638)
* Update switch-mode.md

* Update switch-mode.md
2020-11-09 08:57:24 +08:00
不吃猫的鱼
20bdbb34ae fix: introduce generic type for transfer item (#27630) 2020-11-08 15:28:03 +08:00
Tom Xu
cd15ba4c1a refactor(tree-select): rewrite with hook (#27593) 2020-11-08 15:27:30 +08:00
Tom Xu
535400f7cd docs(switch): change demo to hook (#27618) 2020-11-08 15:27:13 +08:00
偏右
ef2c494c12 fix: Select error outline style in Form (#27607)
* fix: Select error outline in Form

close #27378
close #27526

* fix: css priority
2020-11-08 15:26:28 +08:00
afc163
88210e92fc chore: improve npm run changelog 2020-11-08 15:09:46 +08:00
einq7
3357fccf0e docs: format inline code (#27634) 2020-11-08 15:04:02 +08:00
tangjinzhou
d2206eb132 perf: Optimize menu animation (#27632)
体感好一些
2020-11-08 13:28:13 +08:00
Muhammad Sameer
87dfa411bc docs: Update nest-messages.md (#27620)
Fixed grammatical errors.
2020-11-07 02:49:30 +08:00
偏右
684248c52a style: fix Pagination extra margin right (#27610)
* style: fix Pagination extra margin right

* fix rtl style
2020-11-06 19:50:46 +08:00
Tom Xu
f5ed19248f docs(checkbox): change check all demo to hook (#27608)
* docs(checkbox): change check all demo to hook

* Update check-all.md

* Update demo.test.js.snap
2020-11-06 17:09:21 +08:00
hatanon
9f529d251b docs: update responsive-more.md (#27605)
Add missing dimension `xxl` to en-US
2020-11-06 15:50:45 +08:00
hatanon
6af4d9b4ba docs: Update responsive.md (#27604)
Add missing dimension `xxl` to en-US.
2020-11-06 15:20:19 +08:00
afc163
2430ae2732 chore: fix color picker position
close #27598
2020-11-06 12:11:47 +08:00
二货机器人
f5d5e9b5ee docs: tree conduction logic (#27600) 2020-11-06 11:55:01 +08:00
Davide Bianchi
72dbcfcfde fix: prevent Search component to throw passing null as enterButton (#27591) 2020-11-06 10:41:51 +08:00
Tom Xu
7f4acb0237 refactor(layout): rewrite with hook (#27595) 2020-11-06 10:26:45 +08:00
Tom Xu
da681fe4dd chore: improve select ref type (#27594) 2020-11-06 09:52:42 +08:00
Tom Xu
18054b8cc9 docs(select): size demo change hook (#27592) 2020-11-06 09:09:06 +08:00
骗你是小猫咪
3e62e85a5d Revert "test: enable argos batch mode (#27560)" (#27580)
This reverts commit 811102b105.
2020-11-05 19:55:57 +08:00
偏右
6c9b5437a9 docs: instruction about AutoComplete and Select 2020-11-05 18:07:14 +08:00
afc163
9c400e3266 chore: fix lint 2020-11-05 17:21:57 +08:00
afc163
c09dc30c1d docs: 💄 improve home page loading style 2020-11-05 17:09:57 +08:00
Tom Xu
9772a63b4c fix: Avatar group size (#27531)
* fix: Avatar group size

* fix
2020-11-05 16:22:21 +08:00
偏右
bd1a6c44d4 fix: vertical Tabs active bold style (#27569)
close #27557
2020-11-05 15:37:33 +08:00
Kermit Xuan
d862b688d0 feat: fetch siteData from remote (#27543) 2020-11-05 15:22:59 +08:00
Tom Xu
edb39437f3 docs(steps): step next change to hooks (#27564) 2020-11-05 13:26:20 +08:00
Tom Xu
9d056c1508 docs(Modal): async change to hook (#27559) 2020-11-05 11:35:37 +08:00
骗你是小猫咪
811102b105 test: enable argos batch mode (#27560)
* test: enable argos batch mode

* back 3
2020-11-05 11:10:38 +08:00
afc163
a624169266 chore: force exit from npm run site:test 2020-11-04 18:47:50 +08:00
偏右
234cc1ea24 docs: 🚹 improve riddle/codesandbox/codepen (#27546)
* docs: 📝 update riddle template

* docs: improve icon
2020-11-04 18:04:38 +08:00
Yuan
d01aa2539e fix: filters in column.children should render (#27435)
* fix: filters in column.children should render 

when a column has filter and it's children also have filters, all these filters in children can not render. this problem can not be found when use sorter.

* test: add test for this fix

* Update components/table/__tests__/Table.filter.test.js

Co-authored-by: 偏右 <afc163@gmail.com>
2020-11-04 15:44:13 +08:00
xrkffgg
cba9634a3d perf: reduce css size (#27527)
* perf: reduce css size

* add

* add

* fix line-height

* add .reset-component
2020-11-04 15:06:41 +08:00
xrkffgg
36cdf0a129 refactor: direction type define (#27540) 2020-11-04 14:12:45 +08:00
偏右
36f8ce8e6f perf(📦): reduce Steps responsive css size (#27536)
* perf(📦): reduce Steps responsive css size

* deps-lint-skip: grid
2020-11-04 13:47:13 +08:00
不吃猫的鱼
73c4566c61 fix: update Avatar src type (#27524)
* fix: update Avatar src type

* refactor: remove string as ReactNode includes string type
2020-11-04 10:38:27 +08:00
xrkffgg
4c50355570 chore: update compressed-size-action ci (#27529) 2020-11-04 10:36:48 +08:00
Tom Xu
35e9475e4e docs(popconfirm): add async demo (#27513)
* docs(popconfirm): add async demo

* hooks

* Update async.md
2020-11-04 09:05:46 +08:00
xrkffgg
3c157e637d fix: Progress.Line strokeColor direction in rtl (#27515) 2020-11-03 16:22:18 +08:00
偏右
114dde6373 fix: Steps inside Steps style (#27514)
* style: fix style of Steps inside Steps

* fix snapshot and rtl

* fix rtl style
2020-11-03 16:20:44 +08:00
xrkffgg
db8569c069 docs: improve pr translation 2020-11-03 16:02:37 +08:00
Tom Xu
8faccc2563 fix: select ref typescript typo (#27482)
* fix: select ref typescript typo

* improve
2020-11-03 11:09:24 +08:00
xrkffgg
62fa37dfe0 style: fix Steps rtl (#27511) 2020-11-03 11:01:56 +08:00
信鑫-King
84726aeceb Merge pull request #27490 from ycjcl868/release-4.8.0
release: 4.8.0 changelog
2020-11-02 01:49:59 -08:00
信鑫-King
ff978ea79d Merge pull request #27499 from ant-design/fix-steps-responsive-ui
fix: Steps responsive ui
2020-11-02 01:46:23 -08:00
ycjcl868
b4de03bf2d docs: changelog 2020-11-02 17:15:37 +08:00
afc163
7ff5542586 update snapshot 2020-11-02 17:13:18 +08:00
afc163
81fd0d6328 style(💄): fix Steps style in small screen 2020-11-02 17:04:30 +08:00
信鑫-King
d7bf231e78 Update CHANGELOG.en-US.md
Co-authored-by: 偏右 <afc163@gmail.com>
2020-11-02 00:34:45 -08:00
afc163
20e90ef650 chore: tweak code style 2020-11-02 16:33:06 +08:00
ycjcl868
6bb3827764 docs: changelog 2020-11-02 16:23:14 +08:00
ycjcl868
3c8eb12222 docs: changelog 2020-11-02 16:19:47 +08:00
信鑫-King
529508aed8 Merge pull request #27497 from ant-design/xrkffgg-patch-1
chore: update rc-rate
2020-11-02 00:16:44 -08:00
ycjcl868
cc2ad9d4cd docs: changelog 2020-11-02 15:39:43 +08:00
xrkffgg
3025a5fcf9 chore: update rc-rate 2020-11-02 14:19:43 +08:00
信鑫-King
8bba054edf Update CHANGELOG.en-US.md
Co-authored-by: 偏右 <afc163@gmail.com>
2020-11-01 22:09:55 -08:00
ycjcl868
2f683a3052 chore: changelog 2020-11-02 14:05:25 +08:00
ycjcl868
a37bb928fd docs: changelog 2020-11-02 14:04:59 +08:00
信鑫-King
47c61cb776 Merge pull request #27485 from ant-design/pageHeader
fix(pageHeader): if title is null,no render title view
2020-11-01 22:03:23 -08:00
ycjcl868
45b7803115 docs: changelog 2020-11-02 14:02:25 +08:00
ycjcl868
a2574cdf22 docs: Collapse 2020-11-02 13:58:23 +08:00
chenshuai2144
d6c11fa901 less code 2020-11-02 13:43:03 +08:00
ycjcl868
26942200c6 docs: changelog 2020-11-02 13:26:29 +08:00
骗你是小猫咪
fb77387d26 test: use action cache v2 (#27491) 2020-11-02 13:15:56 +08:00
chenshuai2144
04658fa0a4 fix ci warning 2020-11-02 12:12:46 +08:00
信鑫-King
fa4de9e49a Merge pull request #27489 from ant-design/upgrade-slider
chore: bump ⬆️  rc-slider  to 9.6.1
2020-11-01 19:55:51 -08:00
ycjcl868
0f0ae1f9f3 docs: changelog 2020-11-02 11:53:49 +08:00
ycjcl868
8875c7ed2f docs: changelog 2020-11-02 11:48:06 +08:00
ycjcl868
9b6ffe1020 docs: changelog 2020-11-02 11:43:23 +08:00
ycjcl868
8d46aa89c4 docs: changelog 2020-11-02 11:38:30 +08:00
ycjcl868
be402aaf4d docs: changelog 2020-11-02 11:35:16 +08:00
ycjcl868
c83047a9a4 docs: changelog 2020-11-02 11:34:16 +08:00
ycjcl868
244cb42fed docs: changelog 2020-11-02 11:33:27 +08:00
xrkffgg
311a4fbb42 docs: update Avatar src define 2020-11-02 11:31:42 +08:00
ycjcl868
8ddce24632 docs: changelog 2020-11-02 11:30:45 +08:00
ycjcl868
f92c0956b5 docs: changelog 2020-11-02 11:29:59 +08:00
ycjcl868
2f76a4b1f8 docs: changelog 2020-11-02 11:29:23 +08:00
ycjcl868
94f6b41b64 docs: changelog 2020-11-02 11:27:01 +08:00
ycjcl868
329fc4a710 docs: changelog 2020-11-02 11:25:45 +08:00
ycjcl868
f2b75a255c docs: changelog 2020-11-02 11:21:32 +08:00
ycjcl868
35e936dd47 docs: changelog 2020-11-02 11:06:16 +08:00
ycjcl868
55f743a1ef chore: changelog 2020-11-02 11:03:51 +08:00
ycjcl868
43c26e2b4c release: 4.8.0 changelog 2020-11-02 10:58:03 +08:00
Kermit
8af49dc26e upgrade(slider): ⬆️ bump to 9.6.1 2020-11-02 10:36:27 +08:00
Liu Ya
e954079dd0 fix: Typography.Link color not disabled (#27487)
修复 Typography.Link disabled时悬浮、点击颜色问题
2020-11-02 10:35:45 +08:00
信鑫-King
2a4027bbd9 Merge pull request #27488 from ant-design/chore-conflict-feature
chore: merge feature into master
2020-11-01 18:19:19 -08:00
信鑫-King
39c192ab32 Merge branch 'master' into chore-conflict-feature 2020-11-01 18:04:04 -08:00
chenshuai2144
ef5e6603c2 fix(pageHeader): if title is null,no render title view 2020-11-01 22:47:10 +08:00
不吃猫的鱼
0afb8de631 feat: support Image element prop for Avatar component (#27448)
* feat: support Image element prop for Avatar component

* feat: reuse src prop instead of new image prop

* fix: update snapshot

* fix: re-update snapshots with latest dependencies
2020-10-31 16:15:55 +08:00
偏右
ea02c93c44 Update RecommendPage.tsx 2020-10-30 22:50:25 +08:00
二货机器人
d052543844 feat: Row support wrap (#27469)
* feat: Support noWrap

* test: update snapshot

* fix: Miss check

* test: fix snapshot

* refactor: rename to wrap

* update snapshot
2020-10-30 22:13:23 +08:00
二货机器人
f6f3166108 Merge pull request #27477 from ant-design/feature-merge-master
chore: Feature merge master
2020-10-30 21:17:03 +08:00
偏右
66d3d0aacc fix: Tree switcher icon double click selecting (#27476) 2020-10-30 21:10:21 +08:00
afc163
2a08383a22 test(): update table snapshot 2020-10-30 21:09:08 +08:00
zombiej
0bf5a43e15 chore: feature merge master 2020-10-30 20:55:27 +08:00
大猫
5c0799d5ac docs: add techui promotion (#27465)
* feat: add techui promotion

* feat: change button to menu

* feat: change TechUI menu position
2020-10-30 20:02:43 +08:00
xyb
9052af449b fix: Modal missing modalRender prop (#27272)
close #27174
2020-10-30 19:52:12 +08:00
Amumu
972d280aa1 chore: fix lock version (#27472) 2020-10-30 19:33:09 +08:00
yuanyao1225
86f07dfd1a docs: Update home page articles (#27452)
* feat: article

* Update RecommendPage.tsx

* Update RecommendPage.tsx

* Update RecommendPage.tsx

* Update RecommendPage.tsx

* Update RecommendPage.tsx
2020-10-30 18:35:47 +08:00
appleshell
f2a16bc904 docs: update description of optionFilterProp in Select (#27467)
* docs: update description of optionFilterProp in Select

* update description

* update description

Co-authored-by: lvpansen <pansen.lv@atzuche.com>
2020-10-30 17:50:39 +08:00
骗你是小猫咪
d8a225fdb9 test: fix ui push trigger branch (#27466) 2020-10-30 17:13:25 +08:00
骗你是小猫咪
dbca2381df test: remove azure ui test and try test pr github action (#27458)
* test: remove azure ui test and try test pr github action

* fix pr if
2020-10-30 15:29:23 +08:00
偏右
39e37bf1b4 fix: Input[allowClear] className (#27462)
* fix: Input[allowClear] className missing

close #27444

* fix snapshot
2020-10-30 15:27:37 +08:00
骗你是小猫咪
5669d9c65a test: fix lose test script (#27455)
* fix lose test script

* fix action cache not enable pr target

* add ui yml
2020-10-30 13:18:20 +08:00
骗你是小猫咪
d4a4468789 test: github secret token (#27453)
* test: github secret token

* use test ui action
2020-10-30 11:49:40 +08:00
Lyndon001
aa95f58fbf Update resources.zh-CN.md 2020-10-30 09:48:47 +08:00
骗你是小猫咪
9e1b78e9c8 test: enable pr test action (#27440) 2020-10-29 21:31:00 +08:00
xrkffgg
db89bf3955 fix: RangePicker border style when has same data (#27438) 2020-10-29 15:29:20 +08:00
Kermit Xuan
84e8d18f89 fix: lock ignore-emit-webpack-plugin version (#27434) 2020-10-29 12:23:02 +08:00
骗你是小猫咪
204d2e342a test: ui test use secret and include branch (#27433)
* test: ui test use secret and include branch

* fix argos token
2020-10-29 11:50:49 +08:00
zombiej
a674541260 docs: Open site res docs in new page 2020-10-29 10:14:41 +08:00
骗你是小猫咪
4ec9e23b3c Merge pull request #27421 from shaodahong/merge-to-feature
chore: merge master to feature
2020-10-28 17:09:39 +08:00
骗你是小猫咪
e9163b3eae test: improve argos-ci test (#27420) 2020-10-28 16:16:31 +08:00
偏右
cc8ec58ab1 fix: Table onShowSizeChange trigger twice (#27417)
close #26100
close #27392
2020-10-28 12:56:05 +08:00
南北
7c0e88839c feat: components used in confirm title and content support prefixCls (#27376) 2020-10-28 12:07:46 +08:00
jesse
a7ce8039b9 docs: update Tabs api (#27416) 2020-10-28 11:51:43 +08:00
骗你是小猫咪
fc79b1b041 test: argos-ci test (#27394) 2020-10-28 11:47:38 +08:00
Amumu
729ad9dfa1 fix: Fix the width of the step content in the horizontal direction (#27406)
* chore: code style

* Revert "feat: remove content max-width on dot-step (#24907)"

This reverts commit 0879bd5df3.

* chore: revert code style
2020-10-27 23:58:38 +08:00
二货机器人
39333253d9 fix: Not merge additional data (#27412) 2020-10-27 23:02:52 +08:00
jesse
abb724565d docs: update Tabs api (#27410)
* docs: update api

* Update index.zh-CN.md

* fix

* fix

* suggestion
2020-10-27 23:00:54 +08:00
骗你是小猫咪
2636aac9ca test: fix ui test base trigger (#27380)
* test: ui test with github action

* remove site dependOn

* use job

* reset yaml
2020-10-27 14:14:34 +08:00
偏右
6880bf7073 Merge pull request #27388 from ant-design/master
chore: merge master into featrue
2020-10-27 12:21:04 +08:00
二货机器人
a91c2f9cd8 fix: Tree showLine mutiple line title breaks (#27386)
* fix: Lines of tree style

* chore: Update style

* fix: style lint

* update snapshot
2020-10-26 23:13:52 +08:00
Troy Li
07d4022e18 fix: Invalid regular expression for particular ellipsis content (#27383)
* fix:  Invalid regular expression for particular ellipsis content

* fix: ellipsisContent is possibly nullable

* test: add test cases for ellipsis string with parentheses
2020-10-26 22:11:13 +08:00
偏右
74bbe8e4e3 Delete .codecov.yml 2020-10-26 20:17:35 +08:00
Skylar艺璇
4a0df56114 docs: ️ add D2 forum promote link
add d2 block
2020-10-26 18:54:03 +08:00
二货机器人
59a133274b fix: Desc label with flex node (#27375)
* fix: Desc label with flex node

* test: Update snapshot

* rm useless css

* more style

* rm useless code
2020-10-26 18:40:26 +08:00
xrk
88414b3b33 fix: select focus border in form when has error (#27378) 2020-10-26 18:36:39 +08:00
xrk
c84cd88f51 docs: optimize layout demo css (#27369) 2020-10-26 12:17:07 +08:00
Amumu
a7ae888a90 docs: docs upgrade (#27367) 2020-10-26 11:57:37 +08:00
二货机器人
23f8cce043 feat: Table summary support align (#27365) 2020-10-26 11:32:04 +08:00
二货机器人
c373710ce2 chore: Adjust collapse arrow position align with first line (#27363)
* fix: border style of Input.Search when allowClear (#27325)

* fix: border style of Input.Search when allowClear

* fix css

* update

* change name

* docs: 4.7.3 changelog (#27350)

* docs: 4.7.3 changelog

* docs: Patch 27325

* chore: improve useCombinedRefs (#27352)

* docs: 📝 update introduce

* chore: fix API table border

* chore: Adjust collapse arrow position align with first line

Co-authored-by: xrk <xrkffgg@gmail.com>
Co-authored-by: Tom Xu <ycxzhkx@gmail.com>
Co-authored-by: afc163 <afc163@gmail.com>
2020-10-26 10:56:09 +08:00
afc163
a2890517a6 chore: fix API table border 2020-10-25 22:00:04 +08:00
afc163
ed435c8d4d docs: 📝 update introduce 2020-10-25 16:51:09 +08:00
Tom Xu
5e85ce47a0 chore: improve useCombinedRefs (#27352) 2020-10-24 23:52:59 +08:00
二货机器人
96bb0cf2db docs: 4.7.3 changelog (#27350)
* docs: 4.7.3 changelog

* docs: Patch 27325
2020-10-24 23:34:22 +08:00
xrk
92f7f6dbb2 fix: border style of Input.Search when allowClear (#27325)
* fix: border style of Input.Search when allowClear

* fix css

* update

* change name
2020-10-24 23:28:24 +08:00
Tom Xu
6b1d73bdd9 feat: Avatar.Group add size props (#27348)
* feat: Avatar.Group add size props

* change type
2020-10-24 22:00:43 +08:00
Tom Xu
bae550942a Merge pull request #27349 from ant-design/merge
chore: merge master into feature
2020-10-24 21:54:45 +08:00
Tom Xu
af6d8f7e0c fix: snap 2020-10-24 21:07:46 +08:00
Tom Xu
7be4339806 Merge branch 'feature' into merge 2020-10-24 20:53:34 +08:00
Tom Xu
b0245e742b refactor(select): rewrite with hook (#27318)
* refactor(select): rewrite with hook

* Update index.tsx

* Update index.tsx

* Update index.tsx

* fix test

* Update index.tsx

* Update index.tsx
2020-10-24 20:33:18 +08:00
xrkffgg
5c072cdec9 docs: update pr cn template 2020-10-24 15:46:08 +08:00
二货机器人
d6bd89e370 fix: Form warning (#27343)
* fix: Not warning in drawer

* add test case
2020-10-24 14:47:44 +08:00
Mongkii
ab4aeca60a feat: modal.update() supports functional updating (#27162) (#27163)
* feat: modal.update() supports functional updating (#27162)

* docs: add version tip for modal.update() api
2020-10-24 14:35:00 +08:00
Tom Xu
f116b29f15 dcos(select): improve size default value (#27315) 2020-10-24 14:32:43 +08:00
Tom Xu
7e782daec0 feat: ConfigProvider add form requiredMark (#27322)
* feat: ConfigProvider add form requiredMark

* Update Form.tsx
2020-10-24 14:27:49 +08:00
yuanyao1225
8ba4da5939 feat: 1024 (#27336)
yuanyao
2020-10-24 12:18:01 +08:00
realEago
1ceaa3a87f docs: table doc childrenColumnName property type (#27329)
Co-authored-by: zhaiyuanhang <zhaiyuanhang@xylink.com>
2020-10-23 19:32:29 +08:00
偏右
9a368a59f1 fix: Typography ellipsis title (#27328)
* fix: Typography ellipsis title

close #27324

* fix ci
2020-10-23 19:31:41 +08:00
骗你是小猫咪
6fba4d1136 test: demo -> ui test (#24475)
* test: demo -> ui test

* improve comment image width

* use argos-ci

* use by cicleci

* fix circle run

* rebase master

* try pipeline var

* use another branch var

* fix commit id

* ignore image test file

* remove useless report

* fix test coverage
2020-10-23 18:50:46 +08:00
二货机器人
06b25b4d07 refactor: Update rc-field-form version (#27319)
* refactor: Update rc-field-form version

* update snapshot
2020-10-23 15:20:48 +08:00
JuniorTour
75d4fdb3f1 feat: change object-fit of UploadList to contain (#27312) 2020-10-23 11:18:57 +08:00
Tom Xu
6e0981d1df refactor(responsive-observe): improve typescript type (#27305) 2020-10-23 10:57:13 +08:00
appleshell
b4c67402e6 feat: add loading prop for Statistic (#26811)
* feat: add loading prop for Statistic

* feat: update statistic demo

* feat: add style dependency

* feat: replace loading component

* feat: update doc of statistic

* fix loading type

* feat: add loading prop for Statistic

* feat: update statistic demo

* update api version

Co-authored-by: lvpansen <pansen.lv@atzuche.com>
2020-10-23 10:09:31 +08:00
qianbin
a442722cd2 add description of v3 to v4 (#27309)
* add description of v3 to v4

* add description of v3 to v4

* add description of v3 to v4

* add description of v3 to v4
2020-10-22 22:57:20 +08:00
afc163
fdcdf140d1 chore: fix build warning
close #27303
2020-10-22 16:38:37 +08:00
小鹅鹅鹅
ed1b31ba36 style: notification 长单词不换行 显示不全 (#27285)
fix: pass lint
2020-10-22 15:19:04 +08:00
Tom Xu
4bf9105c4f docs(modal): improve style type (#27304) 2020-10-22 13:14:19 +08:00
Tom Xu
888e28fe14 docs(Modal): add version (#27300) 2020-10-22 11:47:17 +08:00
Tom Xu
5e1665d028 docs: image fear add version (#27291) 2020-10-22 11:25:25 +08:00
Tom Xu
b969bb4df5 feat: Modal method add bodyStyle (#27292) 2020-10-22 11:24:49 +08:00
Tom Xu
a91b451881 docs(button): improve size default value 2020-10-22 08:33:20 +08:00
Robin Pokorny
aa00cee500 docs: Document default for button size (#27283) 2020-10-21 23:17:08 +08:00
偏右
bcc05fcc18 Merge pull request #27275 from ant-design/merge-into-feature
chore: merge master into feature
2020-10-21 21:04:42 +08:00
Tom Xu
4cd2cfa14f update snap 2020-10-21 14:48:24 +08:00
Tom Xu
605bb2ffdf fix conflict 2020-10-21 14:42:10 +08:00
Tom Xu
0658d32785 chore: upgrade @ant-design/tools (#27271)
* chore: upgrade @ant-design/tools

* Update package.json

* Update package.json

* Update package.json

* Update package.json

* Update package.json

* Update package.json

* Update package.json

Co-authored-by: 偏右 <afc163@gmail.com>
2020-10-21 14:34:04 +08:00
Tom Xu
1f1956ccd9 Merge branch 'feature' into merge-into-feature 2020-10-21 14:31:16 +08:00
xrkffgg
cb23875ab7 docs: fix Space size type 2020-10-21 12:24:03 +08:00
afc163
b383c14114 docs: improve button dropdown demo 2020-10-21 11:50:18 +08:00
zombiej
07506792fc docs: Add DatePicker panelRender FAQ
close #27263
2020-10-21 11:38:18 +08:00
Tom Xu
0822ac618f chore: add prettier ignore and format demo (#27270) 2020-10-21 11:06:07 +08:00
Tom Xu
b5dc079228 chore: improve code style (#27266) 2020-10-21 10:35:06 +08:00
Tom Xu
d44f404eae docs: sort api (#27251)
* chore: improve sort api table scripts

* sort api

* add ignore

* Revert "sort api"

This reverts commit 343505d5f0.

* sort api

* Update package.json

* sort api

* Delete sort-api.js

* sort api

* sort api

* sort api

* fix

* Update index.zh-CN.md

* fix input-number

* fix input-number

* sort func

* fix

* Method moved to the end

* carousel method
2020-10-21 10:33:43 +08:00
Tom Xu
0ca5509d3a docs: change log (#27265) 2020-10-21 08:48:28 +08:00
JuniorTour
87dba05e2a docs: fix invalid disabledDate of RangePicker demo (#27112)
* docs: fix invalid disabledDate of RangePicker demo

Close https://github.com/ant-design/ant-design/issues/26885

* Update select-in-range.md

Co-authored-by: 偏右 <afc163@gmail.com>
2020-10-20 22:03:02 +08:00
偏右
27e9926438 fix: duplicated className on Search[allowClear] (#27261)
* fix: duplicated className on Search[allowClear]

close #27258

* fix snapshot
2020-10-20 21:44:37 +08:00
Michał Jasikowski
96c665a0bb fix: changed sorting and validation labels to proper English (#27259)
* fix: sorting and validation labels in English

* fix: changed labels for ga_IE to proper English

* fix: changed labels for ga_IE to proper English

* Update en_GB.tsx
2020-10-20 18:20:06 +08:00
afc163
f80828bfd6 docs: 🎬 refactor Form demo code 2020-10-20 13:29:04 +08:00
偏右
35fb8ee91d fix: horizontal Menu in flex layout (#27253)
close #27240
2020-10-20 11:42:44 +08:00
Tom Xu
0db9842419 fix: Editable Typography in Card title style problems (#27221)
* fix: Editable Typography in Card title style problems

* Update index.less
2020-10-20 11:18:33 +08:00
Tom Xu
3493b4f7da docs(input): add showCount version (#27246) 2020-10-20 09:47:21 +08:00
handy
fd0a513718 fix: Tag component close icon display bug (#27226)
* fix: tag component close icon display bug

* update tag component demo.test.snap
2020-10-19 18:27:20 +08:00
Tom Xu
d3d394700b docs: improve faq (#27236) 2020-10-19 18:27:08 +08:00
afc163
ef8ea979b4 docs: 📝 fix doc 2020-10-19 16:45:17 +08:00
afc163
26f9d63d85 docs: 📝 update 4.7.2 changelog 2020-10-19 16:43:54 +08:00
Tom Xu
322098487f fix: Checkbox Group TS typo (#27231)
* fix: Checkbox Group TS typo

* Revert "fix: Checkbox Group TS typo"

This reverts commit 0898f84ff7.

* Update Group.tsx

* Create type.test.tsx
2020-10-19 16:42:07 +08:00
陈帅
ff1b5c279d 🏗 scrtipt: changelog support windows (#27232) 2020-10-19 16:32:08 +08:00
偏右
ab6a4ec1c0 docs: release 4.7.2 (#27229) 2020-10-19 15:24:37 +08:00
lingjieee
8d9d86c433 style: fix Sider light theme (#27227)
* fixd:Sider组件light模式下样式丢失

* Update light.less

Co-authored-by: jie.ling <jie.ling@tongdun.net>
Co-authored-by: 偏右 <afc163@gmail.com>
2020-10-19 15:11:36 +08:00
二货机器人
8ea1e52d4d fix: TextArea wrapper with div when !showCount (#27216)
* fix: TextArea layout

* test: Update snapshot

* fix: value logic

* fix: className & style logic

* chore: rm uesless code

* chore: Clean up
2020-10-19 14:03:19 +08:00
偏右
16075f85b4 🆙 eslint-plugin-unicorn 2020-10-19 11:32:11 +08:00
Tom Xu
09f8df94b4 docs(dropdown): improve api path and function type (#27213) 2020-10-19 11:14:04 +08:00
陈帅
60103e12a3 docs: add 4.7.1 changelog (#27211)
* docs: add 4.7.1 changelog

* 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: 偏右 <afc163@gmail.com>

* Update CHANGELOG.zh-CN.md

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

* Update CHANGELOG.zh-CN.md

* Update CHANGELOG.en-US.md

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

* Update CHANGELOG.en-US.md

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

* Update CHANGELOG.zh-CN.md

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

* Update CHANGELOG.en-US.md

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

* fix typo

* fix typo

Co-authored-by: 偏右 <afc163@gmail.com>
Co-authored-by: xrk <xrkffgg@gmail.com>
2020-10-19 09:55:18 +08:00
Tom Xu
c28d0f85ad docs(dropdown): improve type (#27212) 2020-10-19 01:06:01 +08:00
Tom Xu
261018053f refactor(checkbox-group): rewrite with hook (#27147) 2020-10-18 23:31:20 +08:00
Tom Xu
e234a71ecd refactor(typography): remove deprecated (#27158) 2020-10-17 17:23:22 +08:00
Michał Jasikowski
ea251a50fa docs: ✍️ Corrected "onFilter" definition for Table Column in docs 2020-10-16 22:29:00 +08:00
KingxBeta
d4fd8f2698 style(descriptions): fix content overflow (#27195)
* fix: .ant-descriptions-item-content add word-break:break-word; style

* Update index.less

修改顺序

Co-authored-by: wangyk <wangyikan@mchz.com.cn>
2020-10-16 22:28:02 +08:00
Yulia Maximova
1113867378 fix: form customizing mixin (#26422)
* fix: add styling form input background-color

* fix: conflict resolution

Co-authored-by: Maksimova, Yuliya <Yuliya.Maksimova@nexign.com>
2020-10-16 22:25:36 +08:00
偏右
c72ee71d6f fix: clear Password value attribute in controlled mode (#27191)
close #27171
2020-10-16 18:05:13 +08:00
偏右
fb9d2e6738 fix: notification width in small screen (#27189)
close #27188
2020-10-16 16:07:56 +08:00
Tom Xu
274871b50c docs(button): improve docs and shape remove undeclared doc type (#27159)
* docs(button): improve docs

* Update index.less
2020-10-16 15:50:19 +08:00
Yu Mao
b4e748c28a fix: Cascader duplicated className (#27187)
close #27168
2020-10-16 15:48:23 +08:00
linye
77e7eceb91 docs: Update MorePage.tsx (#27184) 2020-10-16 11:48:26 +08:00
Tom Xu
179ee276c9 refactor: improve useCombinedRefs code (#27181)
* improve: useCombinedRefs code

* change location
2020-10-16 10:21:21 +08:00
Richard Freling
7d59890c5c feat: 🖼 Image support preview.getContainer (#26713) 2020-10-15 22:56:32 +08:00
Yu Mao
acc2e03ddf fix: add optional rules property (#27164)
* fix: add optional rules property

* fix: replace interface
2020-10-15 22:31:51 +08:00
陈帅
3770b3f423 fix: if form warp drawer, close button will trigger submit (#27175)
* fix:  if form warp drawer, close button will trigger submit

* update snapshot
2020-10-15 18:54:24 +08:00
zombiej
0b592203b2 docs: Update Modal faq
close #27169
2020-10-15 18:32:48 +08:00
偏右
1c38e68a0f fix: Dropdown icon margin style (#27165)
close #22274
2020-10-15 14:13:17 +08:00
afc163
771352c5ca docs: fix remark lint 2020-10-15 13:33:14 +08:00
偏右
bd25b9f667 chore: 🆙 remark-cli 2020-10-15 13:24:38 +08:00
linye
8f1cfd2062 docs: Update RecommendPage.tsx (#27161) 2020-10-15 12:10:05 +08:00
偏右
0a3af0b2e2 fix: 💄 Layout.Sider collapsedWidth cannot work without @menu-collapsed-width (#27154)
* fix: collapsedWidth do not work on Sider

* fix test case

* fix test case

* fix extra trigger div

* fix lint
2020-10-15 10:42:15 +08:00
Kermit Xuan
e883e4ba40 fix(date-picker): showTime should work correctly when format is function (#27156) 2020-10-14 23:00:18 +08:00
二货机器人
43e2651b9c fix:Typography miss block & pre style (#27150)
* feat: Add block & pre style

* fix lint
2020-10-14 19:56:31 +08:00
zombiej
d3bf6eef94 docs: Fix changelog modal desc 2020-10-14 17:02:47 +08:00
偏右
2788140d1a Merge pull request #27137 from ant-design/master
chore: merge master into feature
2020-10-14 16:35:29 +08:00
偏右
50d8c38f2c fix: 🐛 Tabs animated={true} should works (#27145)
close #27135
2020-10-14 16:34:15 +08:00
afc163
6bdd7c1b66 docs: 📝 update 4.7.0 changelog 2020-10-14 15:35:03 +08:00
Tom Xu
2beb594b71 refactor(result): useContext and improve code (#27128)
* refactor(result): useContext and improve code

* Update index.tsx

* Update index.tsx
2020-10-14 15:24:26 +08:00
Tom Xu
f6769e3e94 refactor(grid): useContext and improve code (#27127) 2020-10-14 15:19:07 +08:00
偏右
c7e51aba13 test: fix modal test cases (#27143)
* test:  fix modal test cases

* 🆙 upgrade remark-lint
2020-10-14 14:52:26 +08:00
偏右
ea48827e06 docs: fix API description 2020-10-14 14:42:57 +08:00
偏右
3ef6ea3ead refactor: 📦 some styles to reduce css bundle size (#27129)
* refactor: some styles to reduce css bundle size

* test: update snapshot

* fix snapshot

* fix test case

* fix addonAfter

* fix firefox style

* reduce riddon css size

* fix Input.Group border radius

* remove unused css selectors

* fix test cov

* fix search button hover border

* fix rtl textarea clear icon style

* update demos

* fix search rtl style

* fix input search style
2020-10-13 21:16:20 +08:00
afc163
a04d13c0b9 chore: 💄 fix hotjar widget color 2020-10-13 20:44:55 +08:00
偏右
4bcac2d986 fix: Divider color with text (#27134)
* chore: use @border-width-base

* fix: Divider color with text

close #27132
2020-10-13 20:22:17 +08:00
xrk
6288f0a86e fix: radio checked cursor style when disabled (#27125) 2020-10-13 18:32:18 +08:00
Tom Xu
b896556823 style: fix Typography Link color (#27119)
* style: fix Typography Link color

* Update index.less
2020-10-13 18:31:48 +08:00
dependabot[bot]
0051e5d883 chore(deps-dev): bump remark-preset-lint-recommended from 4.0.1 to 5.0.0 (#27126)
Bumps [remark-preset-lint-recommended](https://github.com/remarkjs/remark-lint) from 4.0.1 to 5.0.0.
- [Release notes](https://github.com/remarkjs/remark-lint/releases)
- [Changelog](https://github.com/remarkjs/remark-lint/blob/main/changelog.md)
- [Commits](https://github.com/remarkjs/remark-lint/compare/4.0.1...remark-preset-lint-recommended@5.0.0)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-10-13 14:24:21 +08:00
偏右
1123666ebe Merge pull request #27122 from ant-design/master-to-merge-feature
chore: merge 4.7.0 release to feature
2020-10-13 13:35:47 +08:00
afc163
288f0caf48 merge feature 2020-10-13 11:47:11 +08:00
zoomdong
e6cc0009c3 feat: Input.Textarea support size props (#27110)
* feat: Input.Textarea add size props

* update snapshot

* update snapshot

* add case

* fix code
2020-10-12 20:39:51 +08:00
Cong Yoo
e1509b0402 docs: 🔗 fix invalid url (#27107) 2020-10-12 16:30:53 +08:00
偏右
e465f3e890 docs: fix url (#27106)
* 更新了一个 【标准符号用法】的在线地址。原地址失效了。

* 这个地址为国家标准全文公开系统的地址

这个地址打开页面查看内容的话需要Flash支持。单内容毕竟更官方,比百科全。
2020-10-12 16:24:47 +08:00
偏右
88fde9f9f7 style: fix Typography Link color (#27104)
close #27088
2020-10-12 16:24:26 +08:00
Cong Yoo
5e4a79a0f0 这个地址为国家标准全文公开系统的地址
这个地址打开页面查看内容的话需要Flash支持。单内容毕竟更官方,比百科全。
2020-10-12 16:20:30 +08:00
Cong Yoo
7004afe3ba 更新了一个 【标准符号用法】的在线地址。原地址失效了。 2020-10-12 16:12:22 +08:00
偏右
18c4b085ba style: 💄 fix Pickers wrong animation direction (#27101)
* style: fix Pickers wrong animation direction

* style: reduce css bundle size
2020-10-12 15:50:02 +08:00
Tom Xu
f487d8dba8 refactor(checkable-tag): improve code (#27097) 2020-10-12 15:07:47 +08:00
xrk
f0f39895b5 style: optimize Input.TextArea count style in rtl (#27098) 2020-10-12 12:43:04 +08:00
xrk
852b28c235 docs: update menu api (#27096)
* docs: update menu api

* perf
2020-10-12 12:00:00 +08:00
Tom Xu
b64d02fda9 refactor(input-number): useContext (#27086) 2020-10-12 10:59:40 +08:00
Tom Xu
1f0d074caa refactor(image): improve code (#27087) 2020-10-12 10:59:09 +08:00
Liu Ya
41d520ab82 docs: update Typography.Text (#27093) 2020-10-12 10:49:17 +08:00
lich-yoo
1a4f5f7909 docs: update modal version column (#27094) 2020-10-12 10:47:09 +08:00
Gerson Garrido
02fc6b1646 Updating es_ES locale docs (#27079) 2020-10-11 02:56:12 +08:00
afc163
de447ea758 Merge branch 'master' of github.com:ant-design/ant-design 2020-10-10 23:13:36 +08:00
afc163
679f0529fa docs: 📝 fix Form API table, close #27078 2020-10-10 23:12:34 +08:00
Arnaud Benhamdine
3a7273b5da docs: fix behaviour of modal draggable zone (#27077)
The behaviour of the draggable zone in the modal was incorrect : the header was supposed to be the only draggable zone, but because of an inverted logic of state change, all the modal was draggable
2020-10-10 23:02:38 +08:00
偏右
340a0a913a docs: release 4.7.0 (#27074)
* docs:  release 4.7.0

* update changelog emoji

* docs: add changelog about InputNumber onStep

* update changelog

* add changelog for #27074
2020-10-10 19:48:36 +08:00
偏右
94cab40b04 feat: InputNumber support onStep (#27075)
* feat: InputNumber support onStep

* fix test case

* fix dep
2020-10-10 17:49:50 +08:00
偏右
5db8813c64 docs: Update Image index.zh-CN.md (#27073) 2020-10-10 15:28:24 +08:00
偏右
2d676fb528 docs: update Image API (#27071)
* Update index.en-US.md

* Update index.zh-CN.md
2020-10-10 15:26:05 +08:00
偏右
0fec3aa602 Merge pull request #27064 from ant-design/feature
chore: merge feature into master
2020-10-10 14:13:11 +08:00
zombiej
5909a4dae5 docs: Update form rule enum desc 2020-10-10 14:01:39 +08:00
偏右
4bf062c2a8 test: fix test cov (#27065)
* test:  upload and form

* refactor: tooltip always evaluates to true
2020-10-10 13:32:27 +08:00
偏右
2ed5a1e9d1 Merge pull request #27063 from ant-design/master-to-merge-feature
chore: merge master into feature
2020-10-10 11:57:06 +08:00
afc163
68a1b18232 merge feature into master-to-merge-feature 2020-10-10 11:36:02 +08:00
zhangchen
138b953afd feat: TextArea showCount (#26952)
* feat: TextArea showCount

* update: TextArea showCount test

* update: TextArea showCount test

* update: test

* update: test

* update: test

* update: interface

* revert: interface change
2020-10-10 11:30:58 +08:00
Tom Xu
60e35181fc chore: add genetate authors and update authors (#27060)
* chore: update authors

* Update AUTHORS.txt

* add generate-authors.js

Co-authored-by: xrk <xrkffgg@gmail.com>
2020-10-10 10:34:41 +08:00
Tom Xu
dfbe4b701c fix: locale by_BY lint (#27061)
* fix: locale lint

* Update index.test.js.snap
2020-10-10 09:13:31 +08:00
zombiej
f28f56d096 docs: Update antd-pro sketch resource 2020-10-09 21:47:23 +08:00
StIvan8
4107c83234 feat: add Belarusian translation (#27028)
* add Belarusian language translation

* add Belarusian locale, fix bugs

* fix: slider and select version
2020-10-09 21:37:07 +08:00
iorikingdom
a711a4172d fix: add Japanese localization for Table (#27043)
* Update ja_JP.tsx

增加了几处日语翻译,希望下个版本能用上

* Update ja_JP.tsx

补全Table的日语翻译

* Update ja_JP.tsx

稍微修改了一下

* Update ja_JP.tsx
2020-10-09 21:32:41 +08:00
偏右
7662160880 fix: Radio cannot use Tooltip (#27050)
resolve #26921
resolve #25222

close #26929
2020-10-09 18:01:04 +08:00
二货机器人
dcd97ca46e Merge pull request #27055 from ant-design/master
chore: Feature merge master
2020-10-09 17:28:17 +08:00
Tom Xu
f812855122 refactor: Remove layout deprecated (#27039)
* Update Sider.tsx

* Update Sider.tsx

* Update Sider.tsx

* Update Sider.tsx
2020-10-09 11:04:38 +08:00
Tom Xu
5f2588ffd1 docs: improve api type docs (#27038) 2020-10-09 10:08:52 +08:00
xrk
b173b5b8f5 fix: sliderProps typeScript define (#27033)
* fix: sliderProps typeScript define

* update rc-slider

* update

* update
2020-10-09 09:37:26 +08:00
Devon
df8c53d145 docs: fix typo in buttons.en-US.md (#27037) 2020-10-09 08:58:17 +08:00
zombiej
b651178685 chore: Update snapshot 2020-10-08 21:28:51 +08:00
Tom Xu
2eec689d74 feat: Space add split (#26948)
* feat: Space add split

* Update index.en-US.md

* changed

* improve

* improve

* Update demo.test.js.snap

* Update vertical-split.md

* Update demo.test.js.snap

* remove vertical-split

* Update demo.test.js.snap
2020-10-08 18:41:40 +08:00
Amumu
a2a4fa302d docs: update form migrate docs title (#27029) 2020-10-08 13:15:13 +08:00
Jesus The Hun
f3f5b66957 docs: documentation for Jest support (#27003) 2020-10-07 02:10:21 +08:00
Rain120
820aa04a96 fix: words spell error at the file of wave.tsx (#27013) 2020-10-07 02:09:08 +08:00
Alper TUNCA
f1c75c5ef6 fix: Update tr_TR.tsx (#27017)
Adding Turkish mean for the optional tag from 4.6.0 antd
2020-10-07 02:03:53 +08:00
xrk
20efc58a8a style: optimize loading icon in rtl (#27010) 2020-10-05 16:20:14 +08:00
Lim Shang Yi
fa3c00ce1a fix: undefined in filterDropdown in Table should not render dropdown filter icon. (#27002)
close #26988
2020-10-04 21:56:29 +08:00
Tom Xu
514cc062be chore: fix timeline TimelineItemProps typo (#27001)
* chore: fix timeline TimelineItemProps typo

* Update Timeline.tsx

* Update TimelineItem.tsx

* Update TimelineItem.tsx

* Update TimelineItem.tsx

* Update TimelineItem.tsx

Co-authored-by: Olivier Louvignes <olivier@mgcrea.io>
Co-authored-by: 偏右 <afc163@gmail.com>
2020-10-03 22:03:09 +08:00
xrk
1a594a467e chore: merge master into feature (#26998) 2020-10-03 12:18:19 +08:00
Cong Yoo
f07613a9c2 docs: fix data-format.md (#26969)
* Update data-format.zh-CN.md

文档说明中的一些*符号没有完整显示

* Update data-format.zh-CN.md

调整了银行卡号码中如何使用描述的风格

* Update data-format.en-US.md

data-format en和cn都进行了*文字的缺失补全

* Update data-format.en-US.md

统一了 Partial Redaction 表格中 * 号样式

* Update data-format.zh-CN.md

cn 文档中 部分脱敏中表格内容 对文字:高级、中级、低级做了加粗样式,与en文档保持统一。

* Update data-format.zh-CN.md

cn 文档中将原有的 「*」改成与 en 文档统一的 `*`。

* Update data-format.en-US.md

将 Bank card number 中的 Example 内容样式修改为与 ID number 一样。

* Update data-format.zh-CN.md

cn 文档中 「·」和 「¥」 样式调整为 `.` 和 `¥`。

* Update data-format.en-US.md

en 文档 将 "." 与 "¥" 调整为 `.` 和 `¥`

* Update data-format.en-US.md

en 文档中例子去掉了 `` 样式,与 cn 统一

* Update data-format.en-US.md

en 中 "\*\*\*" 更改为 `***`

* Update data-format.zh-CN.md

cn 文档中将 「\*\*\*」更改为 `***` 。使 cn 、en 文档的表达方式统一。

* Update data-format.zh-CN.md

对 cn 文档中如何使用的说明做了统一样式处理。

* Update data-format.en-US.md

en 文档现在与 cn 文档全篇中的说明文字样式保持了统一。
2020-10-03 11:47:56 +08:00
Lim Shang Yi
08ca032550 fix: missing autoFocus prop in Slider. Fixes #26982 (#26995) 2020-10-02 22:16:18 +08:00
Lim Shang Yi
ef3aabdf7d fix: Slider step prop not accepting null value (#26984)
* Fixes #26976 since rc-slider allows step to be null

* Fixes #26976 since rc-slider allows step to be null

* test: Slider step prop should not crash with undefined value
2020-10-02 22:15:12 +08:00
Anawin W
88fc56fde8 fix: Update th-TH locale for new date-pickers (#26993) 2020-10-02 20:05:58 +08:00
Amour1688
9cd432e52e chore: useContext in Empty (#26991)
* chore: `useContext` in Empty

* chore: update empty/index.tsx
2020-10-02 14:00:02 +08:00
Niyaz Akhmetov
1aee1670cf docs: ✏️ replace is with are (#26983) 2020-10-02 13:15:41 +08:00
骗你是小猫咪
bd62870258 chore: upgrade rc-table (#26973)
* chore: upgrade rc-table

* improve doc
2020-09-30 20:41:34 +08:00
xrk
4f177ddc96 docs: update tag status demo (#26971) 2020-09-30 20:00:21 +08:00
xrk
76a85ca14e fix: List action rtl style (#26964) 2020-09-30 17:30:25 +08:00
xrk
0ddd367b51 docs: update tabs extra demo (#26968) 2020-09-30 17:08:39 +08:00
xrk
39cf26f4fb docs: update image demo (#26962) 2020-09-30 16:46:44 +08:00
xrk
26c5c6e533 style: optimize transfer pagination rtl style (#26960) 2020-09-30 15:23:02 +08:00
xrk
cf717225d1 fix: upload rtl style (#26961) 2020-09-30 15:22:30 +08:00
xrk
93a8605236 style: optimize tag style in rtl & dark (#26955) 2020-09-30 11:14:03 +08:00
xrk
0e4360038e docs: optimize site a disabled color (#26956) 2020-09-30 10:50:00 +08:00
二货机器人
442c146e3c refator: update rc-dialog to remove rc-animate (#26940)
* chore: bump rc-dialog

* fix 1 test case

* test case

* more test

* fix confirm test case

* clean up

* fix snapshot

* update local-provider snapshot

* update Modal snapshot

* fix test of dialog hook

* fix lint
2020-09-29 19:33:37 +08:00
forl
f6c2ffcc8f docs: update the Chinese doc of the Search component (#26937) 2020-09-29 13:37:04 +08:00
xrk
e5eb7de417 style: optimize tag typescript define (#26932) 2020-09-29 11:06:12 +08:00
偏右
01d757b660 Merge pull request #26923 from ant-design/master
chore: merge master into feature
2020-09-28 15:35:33 +08:00
daczczcz1
493d1b148d feat: add several translations for pl_PL locale (#26913)
* feat: add several translations for pl_PL locale

* add dangling comma
2020-09-28 14:47:42 +08:00
骗你是小猫咪
20f04e428f docs: add Image Preview doc (#26915) 2020-09-28 14:15:23 +08:00
二货机器人
3d5f9b0ac5 chore: bump rc-notification (#26919)
* chore: bump rc-notification

* test: fix on test

* test: Fix config.test

* fix test

* fix message test case
2020-09-28 00:41:16 +08:00
信鑫-King
78b7c01048 chore: version (#26918) 2020-09-26 22:54:50 -07:00
信鑫-King
ab33429bf6 release: 4.6.6 (#26916)
* docs: 4.6.6 changelog

* chore: markdown lint

* docs: changelog
2020-09-26 22:51:41 -07:00
Anawin W
46bbad77c4 feat: add missing translations in th_TH locale (#26906) 2020-09-26 23:07:25 +08:00
偏右
c7d376001a fix(🐛): Steps item shifts in vertical mode (#26894)
close #26874
2020-09-25 15:43:01 +08:00
chequerNoel
14ef846eb7 change function name correctly in index.js (#26850)
* change function name correctly in index.js

* Update index.js

Co-authored-by: 偏右 <afc163@gmail.com>
2020-09-25 11:22:02 +08:00
lihqi
cc37f7d189 fix: fix message.destroy parameter (#26864)
* fix: fix message.destroy parameter

* chore: use React.Key
2020-09-25 11:01:41 +08:00
Kermit Xuan
006abe5e92 chore(slider): optimize type definition (#26884) 2020-09-24 18:14:22 +08:00
二货机器人
0a3369c0eb Merge pull request #26883 from ant-design/feature-merge-master
chore: feature merge master
2020-09-24 15:32:09 +08:00
zombiej
40c8fb8363 chore: merge master 2020-09-24 15:26:37 +08:00
zombiej
aac1d4e434 chore: Add auto close workflow 2020-09-24 11:22:26 +08:00
二货机器人
80d36fb0ae docs: Add Form.List deps faq (#26873) 2020-09-23 22:24:09 +08:00
二货机器人
2775049345 docs: Update TreeNode isLeaf desc (#26872) 2020-09-23 22:14:28 +08:00
二货机器人
1e176ed841 fix: Divider border style not work on text mode (#26863) 2020-09-23 13:33:35 +08:00
afc163
5e0352200b test: fix snapshot 2020-09-22 17:58:21 +08:00
Dmytro Gorelik
efc304c55a style: fix RadioGroup validation error highlight (#26849) 2020-09-22 17:04:48 +08:00
zombiej
8e14a9ce9c docs: Update Form labelCol & wrapCol desc
close #26770
2020-09-22 16:58:41 +08:00
Vineet Srivastav
f2766df2e1 style: fix @link-decoration in Typography.Link (#26854) 2020-09-22 16:57:37 +08:00
Kermit Xuan
a733885b50 feat(date-picker): support custom format (#26845)
* feat(upload):  support custom format

* test: update demo snapshot
2020-09-22 15:43:11 +08:00
二货机器人
7b1327fa1e Merge pull request #26851 from ant-design/feature-merge-master
chore: Feature merge master
2020-09-22 11:50:12 +08:00
zombiej
b696579cd4 fix test case 2020-09-22 11:36:15 +08:00
zombiej
358c7fa4c4 chore: feature merge master 2020-09-22 10:56:04 +08:00
偏右
fc5e0a9155 test: 100% coverage (#26839)
* test: isStyleSupport

* test: 100% test coverage
2020-09-21 18:32:24 +08:00
zombiej
7f2bdb7569 test: fix test case 2020-09-21 16:39:12 +08:00
二货机器人
8315262804 docs: Add AutoComplete migrate demo (#26838) 2020-09-21 16:24:48 +08:00
Olivier Louvignes
93f2988585 chore: add FormListProps export in form/index.tsx (#26831) 2020-09-21 08:40:38 +08:00
偏右
fe6a6b0481 chore: 🆙 eslint-plugin-unicorn 2020-09-20 21:23:39 +08:00
偏右
c979850a5b test: Motion for Collpase and Menu (#26828)
* test:  test menu and collapse motion

* chore: move openAnimation into collapse

* add test case

* rm extra openAnimation.tsx

* remove unused code
2020-09-20 21:13:43 +08:00
二货机器人
2aef2dbe26 docs: 4.6.5 changelog (#26825)
* docs: 4.6.5 changelog

* fix lint

* Update CHANGELOG.zh-CN.md

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

* Update CHANGELOG.en-US.md

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

Co-authored-by: xrk <xrkffgg@gmail.com>
2020-09-20 12:53:22 +08:00
zombiej
b131c23fb6 update changelog 2020-09-20 11:54:24 +08:00
Tom Xu
dcdb8f5587 docs: improve from list (#26813) 2020-09-19 23:21:25 +08:00
Tom Xu
3ab71222ef style: fix description item long text (#26820)
* style: fix description item long text

* Update index.less
2020-09-19 23:17:42 +08:00
偏右
b04d97cde2 fix: 🐛 SubMenu unexpected scrollbar (#26817)
close #26812
2020-09-18 19:44:56 +08:00
偏右
40cee55141 test: add test case for switch click effect (#26815) 2020-09-18 17:53:37 +08:00
二货机器人
ea3629deed docs: Update Tree height desc
close #26769
2020-09-18 08:58:03 +00:00
偏右
83ddfb807e test: Enable transition and animation in jest (#26571)
* test:  add test cases to increase coverage

* test: fix snapshot

* fix: test node envioronment

* fix: test node envioronment

* fix test case

* test: refactor menu test cases

* test: update test code style

* test: add more menu test cases

* add comment

* test: update snapshot

* fix: alert test case

* fix: form onLeaveEnd test cov

* test: fix button click wave test cases

* chore: clean up snapshots
2020-09-18 16:53:18 +08:00
偏右
2e4cbba8d7 fix: @layout-sider-background cannot set to linear-gradient (#26810)
close #26755
2020-09-18 14:29:42 +08:00
二货机器人
659a2d7701 Merge pull request #26809 from ant-design/feature-merge-master
chore: Feature merge master
2020-09-18 13:08:16 +08:00
二货机器人
e5e3be6dda chore: Update rc-trigger related version (#26803)
* bump rc-select version

* bump rc-dropdown version

* bump rc-mentions version

* bump rc-picker version

* bump rc-cascader & rc-menu version

* bump rc-slider version

* update rc-motion

* update rc-select version

* rm sleep in test case

* 📦 reduce bundlesize limit to 280kb

Co-authored-by: 偏右 <afc163@gmail.com>
2020-09-18 13:06:58 +08:00
afc163
a48e2a474f test: recover test case expect 2020-09-18 13:06:20 +08:00
afc163
a8f9572944 test: ignore code which never run into 2020-09-18 13:06:20 +08:00
偏右
ae466b9eea fix: 🐛 Select search bug when input chinese (#26796)
* fix: Select search bug when input chinese

close #26790

* fix: test snapshot
2020-09-18 13:06:20 +08:00
afc163
87059cd795 docs: 📝 remove deparecated button type 2020-09-18 13:06:20 +08:00
John Bear
f0cefa57cd fix: table sticky zindex calculation (#26800) 2020-09-18 13:06:20 +08:00
二货机器人
4d098e7803 docs: Update virtual list demo (#26786) 2020-09-18 13:06:20 +08:00
偏右
f2a8712139 style: tweak button icon only align (#26785)
close #26679
2020-09-18 13:06:19 +08:00
偏右
954bd94b63 style: 💄 fix TimePicker column align (#26784)
add `@picker-time-panel-column-width` and `@picker-time-panel-column-height`

close #26781
2020-09-18 13:06:19 +08:00
Régis Foucault
e849c94b48 docs: 📝 fix typo in complex-form-control.md (#26771) 2020-09-18 13:06:19 +08:00
prettyboyweiwei
6882fa9498 chore: fix Array(x).key() cannot works in codesandbox/codepen
Co-authored-by: weiwei <weiwei0814@theduapp.com>
2020-09-18 13:06:19 +08:00
afc163
d5954af85e test: fix lint 2020-09-18 13:06:19 +08:00
afc163
05e05c59f6 test: ignore code which never run into 2020-09-18 13:06:19 +08:00
二货机器人
3d9c4cf971 fix: FieldForm onValuesChange (#26808) 2020-09-18 13:05:50 +08:00
二货机器人
c592714c88 chore: Update rc-trigger related version (#26803)
* bump rc-select version

* bump rc-dropdown version

* bump rc-mentions version

* bump rc-picker version

* bump rc-cascader & rc-menu version

* bump rc-slider version

* update rc-motion

* update rc-select version

* rm sleep in test case

* 📦 reduce bundlesize limit to 280kb

Co-authored-by: 偏右 <afc163@gmail.com>
2020-09-18 13:01:36 +08:00
afc163
935773a0d0 test: recover test case expect 2020-09-18 11:51:21 +08:00
afc163
2f736441af test: ignore code which never run into 2020-09-18 11:49:50 +08:00
偏右
dfb3279949 fix: 🐛 Select search bug when input chinese (#26796)
* fix: Select search bug when input chinese

close #26790

* fix: test snapshot
2020-09-17 23:26:51 +08:00
afc163
90cfb0d25f docs: 📝 remove deparecated button type 2020-09-17 23:06:59 +08:00
John Bear
5b5518acfb fix: table sticky zindex calculation (#26800) 2020-09-17 23:01:34 +08:00
二货机器人
b08b759ff4 feat: Form.Item support tooltip (#26780)
* feat: Support tooltip

* update test case

* update snapshot

* update doc

* fix lint

* support icon

* tmp use @text-color-secondary
2020-09-17 17:11:45 +08:00
二货机器人
1da6016cc2 feat: FormItem support generate for renderProps (#26791) 2020-09-17 16:51:19 +08:00
Kermit Xuan
7f7fe176e1 feat(upload): support itemRender (#26333) 2020-09-17 16:14:42 +08:00
二货机器人
fec45cb6fe docs: Update virtual list demo (#26786) 2020-09-17 16:05:08 +08:00
偏右
8bff5917dc style: tweak button icon only align (#26785)
close #26679
2020-09-17 15:31:26 +08:00
偏右
a9953640f9 style: 💄 fix TimePicker column align (#26784)
add `@picker-time-panel-column-width` and `@picker-time-panel-column-height`

close #26781
2020-09-17 12:54:05 +08:00
Régis Foucault
bb11f82ed2 docs: 📝 fix typo in complex-form-control.md (#26771) 2020-09-17 11:57:52 +08:00
prettyboyweiwei
56fb794862 chore: fix Array(x).key() cannot works in codesandbox/codepen
Co-authored-by: weiwei <weiwei0814@theduapp.com>
2020-09-16 23:25:43 +08:00
afc163
2980444bd6 test: fix lint 2020-09-16 17:36:44 +08:00
afc163
cc6d2f2157 test: ignore code which never run into 2020-09-16 16:00:12 +08:00
偏右
4a86b75c74 Merge pull request #26768 from ant-design/master
chore: merge master into feature
2020-09-16 14:49:19 +08:00
偏右
068d2bc902 🛡 add Security Policy 2020-09-16 14:11:05 +08:00
zombiej
780ada065b chore: Update snapshot 2020-09-16 12:10:18 +08:00
偏右
cefb877ab9 fix: AutoComplete warning when using placeholder and allowClear (#26765)
close #26760
2020-09-16 11:51:55 +08:00
偏右
481fd209e2 chore: 🆙 upgrade typescript-eslint (#26600)
* chore: 🆙 upgrade typescript-eslint

* fix some lint

* fix: some eslint errors

* Update package.json

* chore: 🆙 upgrade typescript-eslint

* fix some lint

* fix: some eslint errors

* Update package.json

* fix no use before define

* Update package.json

* fix lint

Co-authored-by: yoyo837 <yoyo837@hotmail.com>
Co-authored-by: Tom Xu <ycxzhkx@gmail.com>
2020-09-16 11:43:55 +08:00
afc163
0de1358924 test: fix eslint jest rules 2020-09-15 11:54:47 +08:00
Knut Olav Bøhmer
e09040f3af fix: Button as component for react-router Link (#26740)
React router passes `navigate` as prop to component in <Link to={to}
component={Component}>. This is already fixed for Typography.Link.
(#26623) This fixes `<Link to={to} component={Button}` />
2020-09-14 21:31:46 +08:00
afc163
704899415e docs: 📝 fix anchor demo 2020-09-14 19:13:47 +08:00
afc163
ca18e8cd87 docs: clearify Anchor showInkInFixed API
close #26702
2020-09-14 19:04:36 +08:00
偏右
0067b923b9 Merge pull request #26738 from ant-design/master
chore: merge master into feature
2020-09-14 19:02:34 +08:00
Krishna Singh
bf910cb3a9 Update time-picker documentation (#26673)
Added `onSelect` prop details on Time-Picker documentation
2020-09-14 18:26:22 +08:00
vldh
1e9aded2dd CascaderProps add name and id (#26660)
Co-authored-by: lidahao <lidahao@sisyphe.com.cn>
2020-09-14 18:20:30 +08:00
afc163
58a57224a8 test: fix test snapshot change 2020-09-14 18:19:36 +08:00
偏右
8e84c739bf chore: revert bundlesize 2020-09-14 17:09:41 +08:00
SkyAo
6a06104708 docs: fix heading level in replace-moment (#26725) 2020-09-14 11:01:12 +08:00
Knut Olav Bøhmer
ab3d0ea8de fix: don't show empty items in Space component (#26721) 2020-09-14 10:53:47 +08:00
xrk
737bd60f23 docs: add direction & theme to url (#26567)
* docs: add direction to localStorage

* wip

* wip

* wip

* wip

* browserHistory push

* add slider menu click query

* expand getLocalizedPathname

* add logo footer query

* fix lint

* wip pathname

* wip: fix pathname

* add hash & theme

* remove only component theme

* fix theme component change

* change var

* remove static

* change color

* chore: optimize code style

* fix: exchange theme when router is change

* fix: pathname

* fix: location pathname

* change dark

* fix theme

* fix router listen theme

* remove console

Co-authored-by: Kermit <kermitlx@outlook.com>
2020-09-14 10:48:08 +08:00
诸岳
58a69bc02c Merge pull request #26720 from ant-design/release-4.6.4
docs: Add changelog of 4.6.4
2020-09-13 12:33:51 +08:00
诸岳
aab9c135fb fix(pkg): Enlarge bundlesize threshold 2020-09-13 12:12:55 +08:00
诸岳
ad22d88550 docs: Add changelog of 4.6.4 2020-09-13 11:58:08 +08:00
Michael Waddell
add02767f0 Feat: Support callbacks for removeIcon and downloadIcon in Upload (#26684)
* updated to support callback function

* fixing compilation errors

* feat: add support for per-file callbacks in Upload removeIcon and downloadIcon

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

Added version

Co-authored-by: Tom Xu <ycxzhkx@gmail.com>

* docs: Changed `React.ReactNode` to `ReactNode`

* docs: Added version in CN documentation

Co-authored-by: Tom Xu <ycxzhkx@gmail.com>
2020-09-13 08:31:18 +08:00
二货机器人
1faabb219d feat: Form.List support rules (#26676)
* Add ErrorList component

* move class to ErrorList

* support cache of status

* update doc

* update snapshot

* patch test case

* clean up

* docs: add faq
2020-09-11 21:27:51 +08:00
paranoidjk
ea19589619 feat: feat: expose ConfigContext (#26705) 2020-09-11 21:24:26 +08:00
Dave
5507641331 fix(table-pagination): make pagination.position work (#26678) 2020-09-11 16:49:15 +08:00
Sam Kah Chiin
4270fc7e12 [Chore] Fix typo in index.en-US.md (#26703) 2020-09-11 16:47:47 +08:00
偏右
0472da5a40 fix: sorter compare and multiple should be optional (#26686)
close #26085
2020-09-11 12:25:22 +08:00
xrk
75f50f9d17 docs: optimize api style (#26691) 2020-09-11 12:23:32 +08:00
Tom Xu
faa534c1c0 feat: form support messageVariables (#26597)
* feat: form support labelInMessage

* add doc

* change to messageVariables

* Update demo.test.js.snap

* feat: form support labelInMessage

* add doc

* change to messageVariables

* Update FormItem.tsx

* docs: add messageVariables use
2020-09-10 21:00:21 +08:00
Tom Xu
bef89ce686 docs: remove Anchor not use api (#26672) 2020-09-10 13:49:16 +08:00
偏右
ce4dd06469 style: Card card image has extra 1px border (#26659)
close #26658
2020-09-09 17:57:17 +08:00
偏右
39b40b573d fix: Menu not support React.Fragment (#26656)
* fix: Menu support React.Fragment

* chore: tweak menu demo

* fix: React key warning
2020-09-09 16:52:04 +08:00
afc163
d98981b279 docs: 📝 update faq 2020-09-09 16:38:04 +08:00
偏右
4fff7ec171 Update faq.en-US.md 2020-09-09 16:35:03 +08:00
二货机器人
ca46793593 Merge pull request #26655 from ant-design/master
chore: Feature merge master
2020-09-09 15:34:35 +08:00
Dave
0b4563579b feat(select): sync placeholder color (input) (#26651) 2020-09-09 14:55:59 +08:00
偏右
6fc11830d6 fix: Textarea value works differently as Input (#26652) 2020-09-09 14:41:00 +08:00
Bojack
ad180b8dcf docs: update AutoComplete api document (#26633)
* docs:update AutoComplete api documnet

* docs: update AutoComplete api document
2020-09-08 17:03:12 +08:00
二货机器人
8ab74cbe0e test: Fix Upload test case (#26638)
* test: Fix test case

* clean up
2020-09-08 14:47:31 +08:00
Tom Xu
498d48c6b1 docs: fix pro table link (#26637) 2020-09-08 13:14:35 +08:00
zombiej
37f6a2086a docs: Adjust illustration intro image 2020-09-08 11:50:55 +08:00
二货机器人
c58135fd46 fix: Align motion match (#26628)
* fix: Align motion match

* bump rc-motion

* lock rc-trigger version

* update snapshot
2020-09-08 11:34:29 +08:00
二货机器人
b713f457f0 Merge pull request #26630 from ant-design/master
chore: merge master into feature
2020-09-07 23:10:36 +08:00
偏右
8ab8862907 perf: 📦 remove duplicated rc-dialog in deps (#26627)
see 51569b0dd5
2020-09-07 22:10:30 +08:00
偏右
c1d216be3d fix: 🐛 package.json error 2020-09-07 17:39:07 +08:00
偏右
e745e24677 fix: Invalid value for prop navigate on Link (#26623)
close #26622
2020-09-07 17:37:49 +08:00
偏右
d5497dd47b chore: revert jest no cache 2020-09-07 17:34:10 +08:00
偏右
eb46b026fe chore: remove no-cache for jest 2020-09-07 17:25:45 +08:00
偏右
ce6d89e93a fix: Table pagination missing when position is top (#26618)
close #26617
2020-09-07 16:52:10 +08:00
二货机器人
a26517f9ab fix: Controlled multiple files upload list sync (#26612)
* init hooks

* Use raf to sync list

* clean up
2020-09-07 16:41:28 +08:00
偏右
7041af92fb chore: fix rc-image version 2020-09-07 16:33:59 +08:00
afc163
e9d3ee6928 test: fix image test snapshot 2020-09-07 15:56:54 +08:00
afc163
44f733ae23 chore: clear active toc className when change route
close #26541
2020-09-07 15:44:02 +08:00
陈帅
e678582012 docs: add 4.6.3 changelog (#26607)
* add 4.6.3 changelog

* changelog

* Update CHANGELOG.en-US.md

* update changelog
2020-09-06 23:44:08 +08:00
willc001
79b681d27c fix: restrict nested table styles to only apply to direct children of td (#26568)
Co-authored-by: William Cai <williamcai@easyops.cn>
2020-09-06 13:21:40 +08:00
Alex
bf45c4c1b0 style: 💄 className prop ordering #26594 (#26602)
close #26594
2020-09-06 13:07:39 +08:00
xrkffgg
a46c5ce19b docs: update typography demo (#26604) 2020-09-06 11:28:49 +08:00
偏右
c630a6de69 fix: Table clear both style (#26599)
* fix: Table clear both style

close #26595

* Update index.less
2020-09-05 17:24:18 +08:00
Pengsha Ying
b4c0978068 fix(upload): adjust type declaration for the onError of customRequest (#26601) 2020-09-05 17:13:20 +08:00
偏右
b2cd6c164a docs: 🛡 update badges 2020-09-05 15:03:01 +08:00
偏右
10f05d8358 docs: 🛡 update badges 2020-09-05 12:56:50 +08:00
Long Nguyen
7b55f112ce docs: fix typos (#26598) 2020-09-05 12:40:38 +08:00
linye
5baa4530cc Update RecommendPage.tsx (#26596) 2020-09-05 12:25:25 +08:00
偏右
a8dea916b2 fix: Search autocomplele list in Chrome (#26590)
* fix: 🆙 upgrade rc-select to 11.2.x

* style: fix input search clear button

* test: update snapshot
2020-09-05 00:38:39 +08:00
偏右
a12a7ef2d8 Update basic.md 2020-09-04 16:56:53 +08:00
Sumit Vekariya
16251d1de9 docs: fix typos (#26583) 2020-09-04 12:53:56 +08:00
lich-yoo
f0f22bb726 fix: cascader value overwritten when filtering (#26554) (#26569)
* fix: cascader value overwritten when filtering  (#26554)

* test: add onChange test cases (#26554)

* test: add onChange test cases

Co-authored-by: lich(李春翯) <lich@21kunpeng.com>
2020-09-04 10:59:10 +08:00
Jonathan Gabaut
7e209f0a51 fix: add flex type to ColSize interface (#26578)
According to the API in the docs and based on my own usage, it's a valid value so let's make it official!
2020-09-04 10:50:36 +08:00
zombiej
9663b24216 docs: Update requiredMark doc desc 2020-09-03 17:44:50 +08:00
afc163
34887ca249 docs: improve design doc 2020-09-03 17:12:13 +08:00
Tanmoy Bhowmik
6d2854264a fix: Modal width out of screen (#25765)
* style(modal): add max-width

* chore(modal): add custom width demo

* test(modal): add custom width snapshot

* Update modal.less

* Update modal.less

* Update width.md

* Update demo.test.js.snap

Co-authored-by: 偏右 <afc163@gmail.com>
2020-09-03 16:29:40 +08:00
willc001
b0c70ab348 fix: Radio.Group forward child element ref (#26555)
Co-authored-by: William Cai <williamcai@easyops.cn>
2020-09-03 15:31:08 +08:00
afc163
25f2bd66c8 docs: 📝 should be react-app-rewired
ref https://github.com/ant-design/ant-design/issues/26565
2020-09-03 15:21:12 +08:00
偏右
a409f3126f test: add test cases to increase coverage (#26559)
* test:  add test cases to increase coverage

* chore: remove console
2020-09-03 13:36:23 +08:00
zhangj
0c521962e7 feat: Update rc-dialog to 8.3.0, support Modal drag and drop. (#26507)
* feat: 更新到rc-dialog@8.3.0 添加Modal组件对拖拽的支持。

* fix: test case

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

Co-authored-by: xrkffgg <xrkffgg@vip.qq.com>

* fix: 修复文档版本修改为4.7.0, 文档的order改为13最后一个,指针改为move

* fix: 修改API的顺序,按照字母顺序进行排列

* fix: 修复一些讨论的问题

* fix: test case

* fix: 修改Demo的Modal的Button的显示方式,进行竖着排列

* docs: 去掉多余的demo

Co-authored-by: xrkffgg <xrkffgg@vip.qq.com>
2020-09-03 12:36:06 +08:00
xrkffgg
09e19b765d chore: merge master into feature #26557 2020-09-03 11:30:46 +08:00
afc163
e5fe9b90df fix: scroll position jump after dialog closing 2020-09-02 22:37:06 +08:00
afc163
ff22827cb3 docs: update 4.6.0 changelog 2020-09-02 22:37:06 +08:00
afc163
7a0320d978 chore: add debug color to toc 2020-09-02 22:37:06 +08:00
afc163
a204040a07 chore: improve API table style in small screen
close #26510
2020-09-02 22:37:06 +08:00
afc163
05fc90c605 chore: remove docs site horizontal scrollbar
close #26528
2020-09-02 22:37:06 +08:00
偏右
34d5112132 fix: Pagination align issue (#26549)
close #26533
2020-09-02 21:46:03 +08:00
二货机器人
0097d34d01 fix: Update rc-motion deps & fix ssr (#26542)
* chore: Update rc-motion deps

* frame wheel not prevent scroll

* update ts
2020-09-02 18:30:27 +08:00
myeunhyuk
b5d9580565 docs: Update font.en-US.md (#26526) 2020-09-02 17:32:30 +08:00
偏右
bc950d9a24 fix: Tooltip/Popover children type (#26534)
close #26517
2020-09-02 15:35:49 +08:00
ZHANGYU
e2dda85c90 fix: Avatar doesn't scale when display is none (#26522) 2020-09-02 15:28:23 +08:00
偏右
c88fd34e9a chore: 🆙 upgrade react-resizable (#26524)
* chore: 🆙 upgrade react-resizable

* test: fix snapshot

* code style improve
2020-09-02 10:51:04 +08:00
myeunhyuk
4976fef1b1 docs: Update font.zh-CN.md (#26525) 2020-09-02 10:45:15 +08:00
偏右
fdc36b6a69 Merge pull request #26523 from ant-design/master
chore: merge master into feature
2020-09-01 23:02:52 +08:00
偏右
97f7a972bf perf: 🆙 upgrade rc-dialog and rc-upload and rc-progress (#26494)
* 🆙 upgrade rc-dialog and rc-upload

* 🆙 upgrade @babel/runtime

* 🆙 upgrade rc-progress
2020-09-01 22:12:14 +08:00
xrkffgg
4a4b97c197 chore: merge master into feature (#26513) 2020-09-01 10:46:58 +08:00
PeakFish
71f726afb1 docs: fix api display (#26504) 2020-08-31 20:19:35 +08:00
二货机器人
f68c743448 test: Remove timeout in configProvider test (#26499)
* test: Remove timeout in configProvider test

* chore: Clean up

* move form test out
2020-08-31 17:41:56 +08:00
偏右
2d46fb72ec Merge pull request #26478 from ant-design/master
chore: merge master into feature
2020-08-29 14:06:39 +08:00
Will Soares
9101f3666a feat: add support to responsive sizes in Avatar component (#26244)
fix lint and test failures

update avatar demo card title

update ts type check for undefined
2020-08-29 13:43:52 +08:00
xrkffgg
a8b4e3c2e5 chore: merge master into feature (#26421) 2020-08-26 21:07:43 +08:00
偏右
0874992243 Merge pull request #26354 from ant-design/master
chore: merge master into feature
2020-08-24 11:09:41 +08:00
764 changed files with 22538 additions and 13549 deletions

View File

@@ -1,9 +0,0 @@
codecov:
branch: master
coverage:
status:
project:
default:
# Fail the status if coverage drops by >= 0.1%
threshold: 0.1

View File

@@ -113,11 +113,22 @@ module.exports = {
'jest/no-test-callback': 0,
'jest/expect-expect': 0,
'jest/no-done-callback': 0,
'jest/valid-title': 0,
'jest/no-conditional-expect': 0,
'unicorn/better-regex': 2,
'unicorn/prefer-trim-start-end': 2,
'unicorn/expiring-todo-comments': 2,
'unicorn/no-abusive-eslint-disable': 2,
// https://github.com/typescript-eslint/typescript-eslint/issues/2540#issuecomment-692866111
'no-use-before-define': 0,
'@typescript-eslint/no-use-before-define': 2,
'no-shadow': 0,
'@typescript-eslint/no-shadow': [2, { ignoreTypeValueShadow: true }],
// https://github.com/typescript-eslint/typescript-eslint/issues/2528#issuecomment-689369395
'no-undef': 0,
},
globals: {
gtag: true,

View File

@@ -1,9 +1,9 @@
<!--
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!
New feature please send a pull request to feature branch, and rest to master branch.
Pull requests will be merged after one of the collaborators approve.
Please makes sure that these forms 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)]
@@ -37,13 +37,13 @@ Please makes sure that these form are filled before submitting your pull request
<!--
1. Describe the problem and the scenario.
2. GIF or snapshot should be provided if includes UI/interactive modification.
3. How to fix the problem, and list final API implementation and usage sample if that is an new feature.
3. How to fix the problem, and list final API implementation and usage sample if that is a new feature.
-->
### 📝 Changelog
<!--
Describe changes from userside, and list all potential break changes or other risks.
Describe changes from the user side, and list all potential break changes or other risks.
--->
| Language | Changelog |

View File

@@ -2,12 +2,12 @@
首先,感谢你的贡献!😄
新特性请提交至 feature 分支,其余可提交至 master 分支。
一个维护者审核通过后合并。
在维护者审核通过后合并。
请确保填写以下 pull request 的信息,谢谢!~
[[English Template / 英文模板](?expand=1)]
-->
[[English Template / 英文模板](https://github.com/ant-design/ant-design/blob/master/.github/PULL_REQUEST_TEMPLATE.md)]
### 🤔 这个变动的性质是?
- [ ] 新特性提交
@@ -18,9 +18,9 @@
- [ ] TypeScript 定义更新
- [ ] 包体积优化
- [ ] 性能优化
- [ ] 重构
- [ ] 功能增强
- [ ] 国际化改进
- [ ] 重构
- [ ] 代码风格优化
- [ ] 测试用例
- [ ] 分支合并
@@ -40,10 +40,10 @@
3. 涉及UI/交互变动需要有截图或 GIF。
-->
### 📝 更新日志怎么写?
### 📝 更新日志
<!--
> 从用户角度描述具体变化,以及可能的 breaking change 和其他风险
从用户角度描述具体变化,以及可能的 breaking change 和其他风险
-->
| 语言 | 更新描述 |

16
.github/workflows/auto-close.yml vendored Normal file
View File

@@ -0,0 +1,16 @@
name: 🧐 Auto Closer
on:
issues:
types: [labeled]
jobs:
close-by-label:
runs-on: ubuntu-latest
if: github.event.label.name == '3.x'
steps:
- name: Comment on issue
uses: peter-evans/close-issue@v1
with:
comment: "Hi @${{ github.event.issue.user.login }},<br />Current branch is off the maintenance period. We may not accept pull request or fix bug with it anymore. This topic will be auto closed.<br /><br />你好 @${{ github.event.issue.user.login }},<br />当前分支已经过了维护期。我们不会再接受对其的相关 PR 与 issue。当前 topic 会被自动关闭。"

46
.github/workflows/codacy-analysis.yml vendored Normal file
View File

@@ -0,0 +1,46 @@
# This workflow checks out code, performs a Codacy security scan
# and integrates the results with the
# GitHub Advanced Security code scanning feature. For more information on
# the Codacy security scan action usage and parameters, see
# https://github.com/codacy/codacy-analysis-cli-action.
# For more information on Codacy Analysis CLI in general, see
# https://github.com/codacy/codacy-analysis-cli.
name: Codacy Security Scan
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
codacy-security-scan:
name: Codacy Security Scan
runs-on: ubuntu-latest
steps:
# Checkout the repository to the GitHub Actions runner
- name: Checkout code
uses: actions/checkout@v2
# Execute Codacy Analysis CLI and generate a SARIF output with the security issues identified during the analysis
- name: Run Codacy Analysis CLI
uses: codacy/codacy-analysis-cli-action@1.1.0
with:
# Check https://github.com/codacy/codacy-analysis-cli#project-token to get your project token from your Codacy repository
# You can also omit the token and run the tools that support default configurations
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
verbose: true
output: results.sarif
format: sarif
# Adjust severity of non-security issues
gh-code-scanning-compat: true
# Force 0 exit code to allow SARIF file generation
# This will handover control about PR rejection to the GitHub side
max-allowed-issues: 2147483647
# Upload the SARIF file generated in the previous step
- name: Upload SARIF results file
uses: github/codeql-action/upload-sarif@v1
with:
sarif_file: results.sarif

View File

@@ -15,3 +15,4 @@ jobs:
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
pattern: "./dist/**/*.min.{js,css}"
build-script: "dist"

View File

@@ -1,6 +1,6 @@
name: test
on: [push]
on: [push, pull_request]
jobs:
setup:
@@ -10,7 +10,7 @@ jobs:
uses: actions/checkout@master
- name: cache package-lock.json
uses: actions/cache@v1
uses: actions/cache@v2
with:
path: package-temp-dir
key: lock-${{ github.sha }}
@@ -27,7 +27,7 @@ jobs:
- name: cache node_modules
id: node_modules_cache_id
uses: actions/cache@v1
uses: actions/cache@v2
with:
path: node_modules
key: node_modules-${{ hashFiles('**/package-temp-dir/package-lock.json') }}
@@ -43,25 +43,25 @@ jobs:
uses: actions/checkout@master
- name: restore cache from package-lock.json
uses: actions/cache@v1
uses: actions/cache@v2
with:
path: package-temp-dir
key: lock-${{ github.sha }}
- name: restore cache from node_modules
uses: actions/cache@v1
uses: actions/cache@v2
with:
path: node_modules
key: node_modules-${{ hashFiles('**/package-temp-dir/package-lock.json') }}
- name: cache lib
uses: actions/cache@v1
uses: actions/cache@v2
with:
path: lib
key: lib-${{ github.sha }}
- name: cache es
uses: actions/cache@v1
uses: actions/cache@v2
with:
path: es
key: es-${{ github.sha }}
@@ -80,13 +80,13 @@ jobs:
uses: actions/checkout@master
- name: restore cache from package-lock.json
uses: actions/cache@v1
uses: actions/cache@v2
with:
path: package-temp-dir
key: lock-${{ github.sha }}
- name: restore cache from node_modules
uses: actions/cache@v1
uses: actions/cache@v2
with:
path: node_modules
key: node_modules-${{ hashFiles('**/package-temp-dir/package-lock.json') }}
@@ -112,13 +112,13 @@ jobs:
uses: actions/checkout@master
- name: restore cache from package-lock.json
uses: actions/cache@v1
uses: actions/cache@v2
with:
path: package-temp-dir
key: lock-${{ github.sha }}
- name: restore cache from node_modules
uses: actions/cache@v1
uses: actions/cache@v2
with:
path: node_modules
key: node_modules-${{ hashFiles('**/package-temp-dir/package-lock.json') }}
@@ -134,13 +134,13 @@ jobs:
uses: actions/checkout@master
- name: restore cache from package-lock.json
uses: actions/cache@v1
uses: actions/cache@v2
with:
path: package-temp-dir
key: lock-${{ github.sha }}
- name: restore cache from node_modules
uses: actions/cache@v1
uses: actions/cache@v2
with:
path: node_modules
key: node_modules-${{ hashFiles('**/package-temp-dir/package-lock.json') }}
@@ -156,19 +156,19 @@ jobs:
uses: actions/checkout@master
- name: restore cache from package-lock.json
uses: actions/cache@v1
uses: actions/cache@v2
with:
path: package-temp-dir
key: lock-${{ github.sha }}
- name: restore cache from node_modules
uses: actions/cache@v1
uses: actions/cache@v2
with:
path: node_modules
key: node_modules-${{ hashFiles('**/package-temp-dir/package-lock.json') }}
- name: restore cache from lib
uses: actions/cache@v1
uses: actions/cache@v2
with:
path: lib
key: lib-${{ github.sha }}
@@ -186,19 +186,19 @@ jobs:
uses: actions/checkout@master
- name: restore cache from package-lock.json
uses: actions/cache@v1
uses: actions/cache@v2
with:
path: package-temp-dir
key: lock-${{ github.sha }}
- name: restore cache from node_modules
uses: actions/cache@v1
uses: actions/cache@v2
with:
path: node_modules
key: node_modules-${{ hashFiles('**/package-temp-dir/package-lock.json') }}
- name: restore cache from es
uses: actions/cache@v1
uses: actions/cache@v2
with:
path: es
key: es-${{ github.sha }}

35
.github/workflows/ui.yml vendored Normal file
View File

@@ -0,0 +1,35 @@
name: UI
on:
pull_request_target:
push:
branches:
- master
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: checkout
if: github.event_name == 'pull_request_target'
uses: actions/checkout@master
with:
ref: refs/pull/${{ github.event.pull_request.number }}/head
- name: checkout
if: github.event_name == 'push'
uses: actions/checkout@master
- name: install
run: npm install
- name: test
run: npm run test-image
- name: argos-ci
if: github.event_name == 'pull_request_target'
run: npm run argos -- --token ${{ secrets.ARGOS_TOKEN }} --branch pull/${{ github.event.pull_request.number }}/merge --commit ${{ github.event.pull_request.head.sha }}
- name: argos-ci
if: github.event_name == 'push'
run: npm run argos -- --token ${{ secrets.ARGOS_TOKEN }} --branch ${GITHUB_REF##*/} --commit ${{ github.sha }}

3
.gitignore vendored
View File

@@ -61,4 +61,7 @@ components/version/version.tsx
# Image snapshot diff
__diff_output__/
__image_snapshots__/
/jest-stare
/imageSnapshots
/imageDiffSnapshots

View File

@@ -11,8 +11,7 @@ module.exports = {
'\\.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',
testRegex: 'image\\.test\\.(j|t)s$',
transformIgnorePatterns,
snapshotSerializers: ['enzyme-to-json/serializer'],
globals: {
@@ -20,5 +19,6 @@ module.exports = {
tsConfigFile: './tsconfig.test.json',
},
},
reporters: ['default', 'jest-stare'],
preset: 'jest-puppeteer',
testTimeout: 10000,
};

View File

@@ -27,7 +27,7 @@ module.exports = {
'^react-dnd-test-utils$': 'react-dnd-test-utils/dist/cjs',
'\\.(css|less)$': 'identity-obj-proxy',
},
testPathIgnorePatterns: ['/node_modules/', 'dekko', 'node', 'image.test.js'],
testPathIgnorePatterns: ['/node_modules/', 'dekko', 'node', 'image.test.js', 'image.test.ts'],
transform: {
'\\.tsx?$': './node_modules/@ant-design/tools/lib/jest/codePreprocessor',
'\\.js$': './node_modules/@ant-design/tools/lib/jest/codePreprocessor',
@@ -42,6 +42,7 @@ module.exports = {
'!components/*/locale/index.tsx',
'!components/*/__tests__/type.test.tsx',
'!components/**/*/interface.{ts,tsx}',
'!components/*/__tests__/image.test.{ts,tsx}',
],
transformIgnorePatterns,
snapshotSerializers: ['enzyme-to-json/serializer'],

View File

@@ -1,4 +1,8 @@
**/*.png
**/*.svg
CODEOWNERS
.dockerignore
Dockerfile.ui-test
package.json
.umi
.umi-production
@@ -17,6 +21,8 @@ yarn-error.log
*.snap
components/*/*.js
components/*/*.jsx
components/*/*.md
docs/**/*.md
.gitignore
.npmignore
.prettierignore

File diff suppressed because it is too large Load Diff

View File

@@ -15,6 +15,270 @@ timeline: true
---
## 4.8.4
`2020-11-16`
- 💄 Fix Button and Form loading style. [#27794](https://github.com/ant-design/ant-design/pull/27794)
- 🐞 Fix Modal.confirm locale missing after close it. [#27797](https://github.com/ant-design/ant-design/pull/27797)
- 🐞 Fix Button/Anchor throws `findDOMNode is deprecated` in React 17. [#27755](https://github.com/ant-design/ant-design/pull/27755) [@hosseinmd](https://github.com/hosseinmd)
## 4.8.3
`2020-11-14`
- 🛠 Refactor Carousel with React hooks. [#27694](https://github.com/ant-design/ant-design/pull/27694)
- 🛠 Refactor `<Typography editable />` with React hooks. [#27655](https://github.com/ant-design/ant-design/pull/27655)
- 🐞 Fixed the problem that form behaves abnormally when namepath is an array.. [#27664](https://github.com/ant-design/ant-design/pull/27664)
- 💄 Fix DateRangePicker hover effect position when hover over start or end cell of in range row. [#27731](https://github.com/ant-design/ant-design/pull/27731) [@AlanCutFlim](https://github.com/AlanCutFlim)
- 🐞 Fix Select `mode=tags` cannot input whitespace normally. [#27726](https://github.com/ant-design/ant-design/pull/27726) [@baxtergu](https://github.com/baxtergu)
- 💄 Fix the mouse style when Typography.Link is `disabled`. [#27734](https://github.com/ant-design/ant-design/pull/27734)
- 🐞 Fix Menu dropdown animation start twice when appear. [#27663](https://github.com/ant-design/ant-design/pull/27663)
- 💄 Fix Avatar style when `src` is Image component. [#27691](https://github.com/ant-design/ant-design/pull/27691)
- 💄 Fix Select multiple cursor position. [#27689](https://github.com/ant-design/ant-design/pull/27689)
- 🐞 Fix TextArea emoji been cut when enable `maxLength`. [#27679](https://github.com/ant-design/ant-design/pull/27679) [@372623460jh](https://github.com/372623460jh)
- 🐞 Fix small size RangePicker active bar align issue. [#27673](https://github.com/ant-design/ant-design/pull/27673) [@Ifeinstein](https://github.com/Ifeinstein)
- 💄 Add `@radio-border-width`. [#27703](https://github.com/ant-design/ant-design/pull/27703)
## 4.8.2
`2020-11-09`
- 🐞 Fix Pagination lost jumper margin style. [#27650](https://github.com/ant-design/ant-design/pull/27650)
- 🐞 Fix Steps `type="navigation"` last item broken style. [#27654](https://github.com/ant-design/ant-design/pull/27654)
## 4.8.1
`2020-11-08`
- 🛠 Refactor TreeSelect with React hooks. [#27593](https://github.com/ant-design/ant-design/pull/27593)
- 🛠 Refactor Layout with React hooks. [#27595](https://github.com/ant-design/ant-design/pull/27595)
- 🐞 Fix Select abnormal outline style in Form validation. [#27607](https://github.com/ant-design/ant-design/pull/27607)
- 🐞 Fix Pagination extra `margin-right` when enable size changer. [#27610](https://github.com/ant-design/ant-design/pull/27610)
- 🐞 Fix Input.Search `enterButton={null}` throw error. [#27591](https://github.com/ant-design/ant-design/pull/27591) [@davidebianchi](https://github.com/davidebianchi)
- 🐞 fix Avatar.Group `size` not working. [#27531](https://github.com/ant-design/ant-design/pull/27531)
- 🐞 Fix vertical Tabs long title cause tab width changes. [#27569](https://github.com/ant-design/ant-design/pull/27569)
- 🐞 Fix Table filters didn't display in `column.children`. [#27435](https://github.com/ant-design/ant-design/pull/27435) [@JhonXY](https://github.com/JhonXY)
- 💄 Fix Steps style that inside another Steps. [#27514](https://github.com/ant-design/ant-design/pull/27514)
- TypeScript
- 🤖 Fix Select `ref` TS error. [#27482](https://github.com/ant-design/ant-design/pull/27482)
- 🤖 Fix Avatar `src` type. [#27524](https://github.com/ant-design/ant-design/pull/27524) [@n0ruSh](https://github.com/n0ruSh)
- RTL
- 💄 Fix Progress.Line `strokeColor` direction error in RTL mode. [#27515](https://github.com/ant-design/ant-design/pull/27515)
## 4.8.0
`2020-11-02`
- Image
- 🔥 Image support `preview.getContainer` property. [#26713](https://github.com/ant-design/ant-design/pull/26713) [@rfreling](https://github.com/rfreling)
- 🐞 Fix Image `style` prop not acting on img element. [#27446](https://github.com/ant-design/ant-design/pull/27446)
- 🆕 ConfigProvider support `form.requiredMark`. [#27322](https://github.com/ant-design/ant-design/pull/27322)
- 🆕 Statistic support `loading` prop. [#26811](https://github.com/ant-design/ant-design/pull/26811) [@appleshell](https://github.com/appleshell)
- Avatar
- 🔥 Support Image element as prop for Avatar component. [#27448](https://github.com/ant-design/ant-design/pull/27448) [@n0ruSh](https://github.com/n0ruSh)
- 🆕 Avatar.Group support `size` props. [#27348](https://github.com/ant-design/ant-design/pull/27348)
- 🆕 Row support `noWrap` to make Col in line. [#27469](https://github.com/ant-design/ant-design/pull/27469)
- Tree
- 🐞 Fix Tree text selecting when double click switcher icon. [#27476](https://github.com/ant-design/ant-design/pull/27476)
- 🐞 Fix Tree with `showLine` not connect line when `title` break line. [#27386](https://github.com/ant-design/ant-design/pull/27386)
- Modal
- 🆕 `modal.update()` supports functional updating. [#27163](https://github.com/ant-design/ant-design/pull/27163) [@Mongkii](https://github.com/Mongkii)
- 🆕 Modal method support `bodyStyle` props. [#27292](https://github.com/ant-design/ant-design/pull/27292)
- 🐞 Fix Modal missing `modalRender` prop. [#27272](https://github.com/ant-design/ant-design/pull/27272) [@jieny](https://github.com/jieny)
- 🐞 `rootPrefixCls` set in `Modal.config` can be effective for the antd components used in `title` and `content`. [#27376](https://github.com/ant-design/ant-design/pull/27376) [@Chersquwn](https://github.com/Chersquwn)
- Input
- 🆕 Input.Textarea support `size` props. [#27110](https://github.com/ant-design/ant-design/pull/27110)
- 🐞 Fix Input missing `className` when `allowClear` is true. [#27462](https://github.com/ant-design/ant-design/pull/27462)
- Table
- 🆕 Table.Summary.Cell support `align` prop. [#27365](https://github.com/ant-design/ant-design/pull/27365)
- 🐞 Fix Table `onShowSizeChange` trigger twice. [#27417](https://github.com/ant-design/ant-design/pull/27417)
- 🐞 Fix Table `pagination` cache previous config issue. [#27412](https://github.com/ant-design/ant-design/pull/27412)
- Typography
- 🐞 Fix Typography Invalid regular expression issue with particular content. [#27383](https://github.com/ant-design/ant-design/pull/27383) [@ttys026](https://github.com/ttys026)
- 💄 Fix disabled Typography.Link hover or active color. [@27487](https://github.com/ant-design/ant-design/pull/27487) [@Liu-Ya](https://github.com/Liu-Ya)
- Steps
- 🐞 Fix title is not centered when enabling `progressDot`. [#27406](https://github.com/ant-design/ant-design/pull/27406)
- 🐞 Fix style in small screen. [#27499](https://github.com/ant-design/ant-design/pull/27499)
- 🐞 Fix PageHeader that empty dom will be displayed when `title` is empty. [#27485](https://github.com/ant-design/ant-design/pull/27485)
- 🐞 Fix Slider keep tooltip align with handle when dragging. [#27489](https://github.com/ant-design/ant-design/pull/27489)
- 🐞 Fix RangePicker selected range border style. [#27438](https://github.com/ant-design/ant-design/pull/27438)
- 💄 Adjust Collapse arrow position align with first line. [#27363](https://github.com/ant-design/ant-design/pull/27363)
- 💄 Fix Descriptions style when `label` use block element. [#27375](https://github.com/ant-design/ant-design/pull/27375)
- 💄 Fix Select abnormal border style in Form validation. [#27378](https://github.com/ant-design/ant-design/pull/27378)
## 4.7.3
`2020-10-24`
- Form
- 🐞 Fix Form warning for non-boolean attribute `virtual` when use ConfigProvider. [#27343](https://github.com/ant-design/ant-design/pull/27343)
- 🛠 Adjust Form.Item `initialValue` sync status align with Form level `initialValues`. [#27319](https://github.com/ant-design/ant-design/pull/27319)
- Typography
- 🛠 Improve Typography `ellipsis` title display. [#27328](https://github.com/ant-design/ant-design/pull/27328)
- 💄 Fix Editable Typography in Card title style problems. [#27221](https://github.com/ant-design/ant-design/pull/27221)
- Input
- 🐞 Fix Input.Search duplicated `className` when `allowClear` is `true`. [#27261](https://github.com/ant-design/ant-design/pull/27261)
- 🐞 Fix Input.Search border style when enable `allowClear`. [#27261](https://github.com/ant-design/ant-design/pull/27325)
- 🐞 Fix Upload.List preview image fit size issue. [#27312](https://github.com/ant-design/ant-design/pull/27312) [@JuniorTour](https://github.com/JuniorTour)
- 🐞 Fix Notification no wrap with long text. [#27285](https://github.com/ant-design/ant-design/pull/27285) [@littleee](https://github.com/littleee)
- 🐞 Fix Menu inside flexable container will not shrink properly. [#27253](https://github.com/ant-design/ant-design/pull/27253)
- 🌐 Fix en_US, en_GB and ga_IE gramma. [#27259](https://github.com/ant-design/ant-design/pull/27259) [@yasikovsky](https://github.com/yasikovsky)
- 🐞 Fix Tag with customize `closeIcon` breaks line issue. [#27226](https://github.com/ant-design/ant-design/pull/27226) [@handycode](https://github.com/handycode)
## 4.7.2
`2020-10-19`
- 💄 Fix Layout.Sider `light` theme lost styles. [#27227](https://github.com/ant-design/ant-design/pull/27227) [@lingjieee](https://github.com/lingjieee)
- 💄 Fix TextArea wrapped with additional div when `showCount` is `false`, and pass `className` and `style` to outer wrapper when `showCount` is `true`. [#27216](https://github.com/ant-design/ant-design/pull/27216)
- 🐞 Fix Checkbox.Group TS2559 error. [#27231](https://github.com/ant-design/ant-design/pull/27231)
## 4.7.1
`2020-10-18`
- DatePicker
- 🐞 Fix DatePicker don't work correctly when `showTime` is `true` and `format` is function. [#27156](https://github.com/ant-design/ant-design/pull/27156)
- 💄 Fix DatePicker wrong animation direction when auto overflow. [#27101](https://github.com/ant-design/ant-design/pull/27101)
- Typography
- 💄 Fix Typography miss `pre` and `blockquote` style. [#27150](https://github.com/ant-design/ant-design/pull/27150)
- 🐞 Fix Typography.Link hover color. [#27119](https://github.com/ant-design/ant-design/pull/27119)
- 🐞 Fix Typography.Link hover color when type is danger. [#27104](https://github.com/ant-design/ant-design/pull/27104)
- 💄 Fix Descriptions `ant-descriptions-item-content` and add style `word-break:break-word;`. [#27195](https://github.com/ant-design/ant-design/pull/27195) [@WLyKan](https://github.com/WLyKan)
- 🐞 Fix clear Password value attribute in controlled mode. [#27191](https://github.com/ant-design/ant-design/pull/27191)
- 🐞 Optimize Notification width in small screen. [#27189](https://github.com/ant-design/ant-design/pull/27189)
- 🐞 Fix Cascader className duplicate. [#27187](https://github.com/ant-design/ant-design/pull/27187) [@huntdream](https://github.com/huntdream)
- 🐞 Fix the issue that the Drawer will trigger form submit. [#27175](https://github.com/ant-design/ant-design/pull/27175)
- 🐞 Fix Dropdown icon missing margin. [#27165](https://github.com/ant-design/ant-design/pull/27165)
- 💄 Fix Layout.Sider `collapsedWidth` cannot work without modifying `@menu-collapsed-width`. [#27154](https://github.com/ant-design/ant-design/pull/27154)
- 🐞 Fix Tabs `animated={true}` not working for panels. [#27145](https://github.com/ant-design/ant-design/pull/27145)
- 🐞 Fix Divider color when contains text. [#27134](https://github.com/ant-design/ant-design/pull/27134)
- 💄 Fix the cursor style when the Radio option is selected and disabled. [#27125](https://github.com/ant-design/ant-design/pull/27125)
- 🇪🇸 Add missing translations in es_ES. [#27079](https://github.com/ant-design/ant-design/pull/27079) [@gersongams](https://github.com/gersongams)
- RTL
- 💄 Optimize the style of Input.TextArea character count in RTL mode. [#27098](https://github.com/ant-design/ant-design/pull/27098)
- TypeScript
- 🤖 Button shape remove undeclared doc type. [#27159](https://github.com/ant-design/ant-design/pull/27159)
- 🤖 Add optional `rules` property into `FormListProps`. [#27164](https://github.com/ant-design/ant-design/pull/27164) [@huntdream](https://github.com/huntdream)
## 4.7.0
`2020-10-10`
- 🔥 Input.TextArea support word count. [#26952](https://github.com/ant-design/ant-design/pull/26952) [@zhangchen915](https://github.com/zhangchen915)
- DatePicker
- 🔥 DatePicker support custom `format` by passing a function. [#26845](https://github.com/ant-design/ant-design/pull/26845)
- 🐞 Fix RangePicker initial date of end panel cannot selected. [#23167](https://github.com/ant-design/ant-design/issues/23167)
- Form
- 🔥 Form.Item support `tooltip` to customize tooltip. [#26780](https://github.com/ant-design/ant-design/pull/26780)
- 🆕 Form.List support `rules` validation and add Form.ErrorList to show the errors. [#26676](https://github.com/ant-design/ant-design/pull/26676)
- 🆕 Form.Item support `messageVariables` prop. [#26597](https://github.com/ant-design/ant-design/pull/26597)
- 🐞 Fix Form `onValuesChange` second param return fully `store` values instead of validate fields. [#26808](https://github.com/ant-design/ant-design/pull/26808)
- Upload
- 🔥 Upload can custom the item of file list by `itemRender` now. [#26333](https://github.com/ant-design/ant-design/pull/26333)
- 🆕 Upload custom action icons now supports callback functions. [#26684](https://github.com/ant-design/ant-design/pull/26684) [@mwaddell](https://github.com/mwaddell)
- Table
- 🆕 Table `sticky` now support `getContainer`. [#26973](https://github.com/ant-design/ant-design/pull/26973)
- 🐞 Fix Table should not render dropdown filter icon when filterDropdown is `undefined`. [#27002](https://github.com/ant-design/ant-design/pull/27002) [@shangyilim](https://github.com/shangyilim)
- Modal
- 🛠 Refactor Modal animation code so that it will remove all dom element by `destroyOnClose` when closed. [#26940](https://github.com/ant-design/ant-design/pull/26940)
- 🆕 Modal add `modalRender` prop which can be used for draggable dialog. [#26507](https://github.com/ant-design/ant-design/pull/26507) [@jhoneybee](https://github.com/jhoneybee)
- 🆕 Space add `split` prop. [#26948](https://github.com/ant-design/ant-design/pull/26948)
- 🆕 Image `preview` prop now support `visible` and `onVisibleChange`. [#26915](https://github.com/ant-design/ant-design/pull/26915)
- 🆕 InputNumber will trigger `onStep` prop when click up/down buttons. [#27075](https://github.com/ant-design/ant-design/pull/27075)
- 🆕 Avatar `size` support responsive config. [#26244](https://github.com/ant-design/ant-design/pull/26244) [@willamesoares](https://github.com/willamesoares)
- 🐞 Fix Radio.Button children cannot apply Tooltip. [#27050](https://github.com/ant-design/ant-design/pull/27050)
- RTL
- ⬅️ Fix List action button position in RTL mode. [#26964](https://github.com/ant-design/ant-design/pull/26964)
- ⬅️ Fix Transfer pagination style in RTL mode. [#26960](https://github.com/ant-design/ant-design/pull/26960)
- ⬅️ Fix Upload style in RTL mode. [#26961](https://github.com/ant-design/ant-design/pull/26961)
- ⬅️ Optimize Tag style to avoid the interaction between theme and RTL mode. [#26955](https://github.com/ant-design/ant-design/pull/26955)
- ⬅️ Optimize Cascader and Tree style of the data expansion loading icon in RTL mode. [#27010](https://github.com/ant-design/ant-design/pull/27010)
- TypeScript
- 🤖 Fix typo `TimeLineItemProps` to `TimelineItemProps`. [#27001](https://github.com/ant-design/ant-design/pull/27001) [@mgcrea](https://github.com/mgcrea)
- 🤖 Fix Slider missing `autoFocus` prop. [#26995](https://github.com/ant-design/ant-design/pull/26995) [@shangyilim](https://github.com/shangyilim)
- 🤖 Fix Slider `step` prop not accepting `null` value. [#26984](https://github.com/ant-design/ant-design/pull/26984) [@shangyilim](https://github.com/shangyilim)
- 🤖 Fix Slider.Range `trackStyle` and `handleStyle` should be array. [#27033](https://github.com/ant-design/ant-design/pull/27033)
- 🤖 Optimize Tag `onClose` TypeScript definition. [#26932](https://github.com/ant-design/ant-design/pull/26932)
- 🤖 Improve Form TypeScript definition to support `getFieldsValue` return generic type without `namePath` argument. [#26791](https://github.com/ant-design/ant-design/pull/26791)
- Locale
- 🇧🇾 Add Belarusian locale. [#27028](https://github.com/ant-design/ant-design/pull/27028) [@StIvan8](https://github.com/StIvan8)
- 🇯🇵 Fix Japanese locale. [#27043](https://github.com/ant-design/ant-design/pull/27043) [@iorikingdom](https://github.com/iorikingdom)
- 🇹🇭 Add Thai locale for Pickers. [#26993](https://github.com/ant-design/ant-design/pull/26993) [@anawinwz](https://github.com/anawinwz)
- 🇹🇷 Add Turkish locale of Form optional text. [#27017](https://github.com/ant-design/ant-design/pull/27017) [@alperTunca](https://github.com/alperTunca)
- 🇵🇱 Add Polish locale of Table. [#26913](https://github.com/ant-design/ant-design/pull/26913) [@daczczcz1](https://github.com/daczczcz1)
## 4.6.6
`2020-09-27`
- 🐞 Fix Steps first item shifts in small screen. [#26894](https://github.com/ant-design/ant-design/pull/26894)
- 💄 Fix Divider border style not work when text is provided. [#26863](https://github.com/ant-design/ant-design/pull/26863)
- 🐞 Fix Radio.Button validation error highlight. [#26849](https://github.com/ant-design/ant-design/pull/26849) [@dhorelik](https://github.com/dhorelik)
- 💄 Fix Typography link-decoration style. [#26854](https://github.com/ant-design/ant-design/pull/26854) [@vineetvk01](https://github.com/vineetvk01)
- Locale
- 🌐 Add Thai locale support. [#26906](https://github.com/ant-design/ant-design/pull/26906) [@anawinwz](https://github.com/anawinwz)
- TypeScript
- 🤖 Fix message.destroy parameter type. [#26864](https://github.com/ant-design/ant-design/pull/26864) [@lihqi](https://github.com/lihqi)
- 🤖 Optimize Slider type definition. [#26884](https://github.com/ant-design/ant-design/pull/26884)
- 🤖 Form properly export `FormListProps` type. [#26831](https://github.com/ant-design/ant-design/pull/26831) [@mgcrea](https://github.com/mgcrea)
## 4.6.5
`2020-09-20`
- 💄 Fix Descriptions item long text ellipsis issue. [#26820](https://github.com/ant-design/ant-design/pull/26820)
- 🐞 Fix Menu unexpected scrollbar when show and hide. [#26817](https://github.com/ant-design/ant-design/pull/26817)
- 🐞 Fix `@layout-sider-background` cannot set to linear gradient color. [#26810](https://github.com/ant-design/ant-design/pull/26810)
- 🐞 Fix Select compositing status lost when input first letter in Chinese. [#26796](https://github.com/ant-design/ant-design/pull/26796)
- 🐞 Fix Table `@table-sticky-zindex` less compile error issue. [#26800](https://github.com/ant-design/ant-design/pull/26800) [@chimp1nski](https://github.com/chimp1nski)
- Button
- 💄 Fix Button align issue when has icon only. [#26785](https://github.com/ant-design/ant-design/pull/26785)
- 🐞 Fix Button warning `Invalid value for prop navigate` when using with react-router. [#26740](https://github.com/ant-design/ant-design/pull/26740) [@knobo](https://github.com/knobo)
- 💄 Fix TimePicker column align issue, add `@picker-time-panel-column-width` and `@picker-time-panel-column-height` less variables. [#26784](https://github.com/ant-design/ant-design/pull/26784)
- 🐞 Fix AutoComplete warning when using `placeholder` and `allowClear`. [#26765](https://github.com/ant-design/ant-design/pull/26765)
- 🐞 Fix Space show items when it's render empty dom. [#26721](https://github.com/ant-design/ant-design/pull/26721) [@knobo](https://github.com/knobo)
- 🛠 Dedupe `rc-trigger` version to reduce package size. [#26803](https://github.com/ant-design/ant-design/pull/26803)
- TypeScript
- 🤖 Cascader add `name` and `id` props definition. [#26660](https://github.com/ant-design/ant-design/pull/26660) [@alwaysloseall](https://github.com/alwaysloseall)
## 4.6.4
`2020-09-13`
- 💄 style: Card card image has extra 1px border. [#26659](https://github.com/ant-design/ant-design/pull/26659)
- 💄 Fix Select `placeholder` color not same as Input. [#26651](https://github.com/ant-design/ant-design/pull/26651) [@wangcch](https://github.com/wangcch)
- 🐞 Fix Menu not support React.Fragment inside. [#26656](https://github.com/ant-design/ant-design/pull/26656)
- 🐞 Fix TextArea different behavior with Input when set `value` to `undefined`. [#26652](https://github.com/ant-design/ant-design/pull/26652)
- 🐞 Fix Motion related issue like Upload align flash and Form.Item with `help` ssr issue. [#26628](https://github.com/ant-design/ant-design/pull/26628)
- 🐞 Fix Typography.Link warning `Invalid value for prop navigate` when using with react-router. [#26623](https://github.com/ant-design/ant-design/pull/26623)
- 🐞 Fix Table pagination missing when is above table. [#26618](https://github.com/ant-design/ant-design/pull/26618)
- 🐞 Fix Upload in control miss file when upload multiple file in same time. [#26612](https://github.com/ant-design/ant-design/pull/26612)
- TypeScript
- 🤖 Fix Table that sorter `compare` and `multiple` should be optional. [#26686](https://github.com/ant-design/ant-design/pull/26686)
## 4.6.3
`2020-09-06`
- 🛎 Sort props `className` to the end. [#26602](https://github.com/ant-design/ant-design/pull/26602)
- Table
- 💄 Fix Table nested table styles affects all sub-level tables. [#26568](https://github.com/ant-design/ant-design/pull/26568) [@willc001](https://github.com/willc001)
- 🐞 Fix elements above Table was not clickable elements which has `float: right;` style. [#26599](https://github.com/ant-design/ant-design/pull/26599)
- 🐞 Fix Modal closing cause scroll position jump up. [#26538](https://github.com/ant-design/ant-design/pull/26538)
- 🐞 Fix the type declaration of onError in `customRequest` options of Upload. [#26601](https://github.com/ant-design/ant-design/pull/26601) [@yingpengsha](https://github.com/yingpengsha)
- 🐞 Shutdown Select/TreeSelect autocomplete list in Chrome. [#26590](https://github.com/ant-design/ant-design/pull/26590)
- 🐞 Fix Cascader value overwritten when filtering. [#26569](https://github.com/ant-design/ant-design/pull/26569) [@lich-yoo](https://github.com/lich-yoo)
- 🐞 Fix Modal jump out of screen in some situations. [#25765](https://github.com/ant-design/ant-design/pull/25765) [@tanmoyopenroot](https://github.com/tanmoyopenroot)
- 🐞 Fix Radio.Group not working properly, when is used in legacy Form. [#26555](https://github.com/ant-design/ant-design/pull/26555) [@willc001](https://github.com/willc001)
- 🐞 Fix Pagination align issue in windows. [#26549](https://github.com/ant-design/ant-design/pull/26549)
- 🐞 Fix Form with `help` make ssr un-sync issue. [#26542](https://github.com/ant-design/ant-design/pull/26542)
- 🐞 Fix Avatar doesn't scale fallback text well when display is none. [#26522](https://github.com/ant-design/ant-design/pull/26522) [@zhangyu1818](https://github.com/zhangyu1818)
- TypeScript
- 🤖 Col Add `flex` type to `ColSize` interface. [#26578](https://github.com/ant-design/ant-design/pull/26578) [@blaiz](https://github.com/blaiz)
- 🤖 Fix Tooltip/Popover `children` tsd to accept ReactNode. [#26534](https://github.com/ant-design/ant-design/pull/26534)
## 4.6.2
`2020-08-31`
@@ -52,6 +316,7 @@ timeline: true
- 💄 Darker `@text-color` for WCAG 2.0 on contrast ratio. [#25630](https://github.com/ant-design/ant-design/pull/25630)
- 🔥 New Image component. [#26296](https://github.com/ant-design/ant-design/pull/26296)
- 🔥 Table support `sticky` prop to sticky header and scroll bar. [#25939](https://github.com/ant-design/ant-design/pull/25939)
- 🛠 Refactor Upload via hooks. [#26196](https://github.com/ant-design/ant-design/pull/26196)
- Form
- 🆕 Form support style of required mark with `requiredMark` and deprecate `hideRequiredMark` prop. [#26309](https://github.com/ant-design/ant-design/pull/26309)
- 🆕 Form.List support the second `index` param in `add`. [#26081](https://github.com/ant-design/ant-design/pull/26081)
@@ -1292,7 +1557,7 @@ Ant Design 4.0-rc released! Here is the release [document](https://github.com/an
- 🌟 antd package size optimization, js gzipped dropped from 532.75KB to 289.89 KB. [#20356](https://github.com/ant-design/ant-design/pull/20356)
- 💄 New dark theme support. [#20281](https://github.com/ant-design/ant-design/pull/20281)
- 🌟 ConfigProvider supports `direction` internationalization setting`rtl`. [#19380](https://github.com/ant-design/ant-design/pull/19380)
- 🌟 ConfigProvider supports `direction` internationalization setting `rtl`. [#19380](https://github.com/ant-design/ant-design/pull/19380)
- 🌟 New Form component. [#17327](https://github.com/ant-design/ant-design/pull/17327)
- 🌟 Form comes with data binding function.
- 🌟 Field changes only affect the rendering of related field components and not the entire Form.
@@ -1319,7 +1584,7 @@ Ant Design 4.0-rc released! Here is the release [document](https://github.com/an
- 💄 Optimized `expand` animation effect.
- 🌟 New DatePicker, TimePicker and Calendar components. [#20023](https://github.com/ant-design/ant-design/pull/20023)
- 🌟 Support custom date library.
- 🌟 Added `picker` support for setting selectors (no longer need to simulate selectors via controlled`mode`).
- 🌟 Added `picker` support for setting selectors (no longer need to simulate selectors via controlled `mode`).
- 🌟 Full range selector support: time, date, week, month, year.
- 🌟 Range selector can now select start and end times individually.
- 🌟 The range selector can be set to `disabled` separately for the start and end time.
@@ -1337,7 +1602,7 @@ Ant Design 4.0-rc released! Here is the release [document](https://github.com/an
- 🌟 Uncontrolled mode when `value` is `undefined` now.
- 🌟 TreeSelect uses virtual scrolling and optimizes keyboard support. [#19040](https://github.com/ant-design/ant-design/pull/19040)
- 🌟 Uncontrolled mode when `value` is `undefined` now.
- 🌟 Button adds `default` and`link` styles for `danger`. [#19837](https://github.com/ant-design/ant-design/pull/19837)
- 🌟 Button adds `default` and `link` styles for `danger`. [#19837](https://github.com/ant-design/ant-design/pull/19837)
- 🌟 Form and ConfigProvider support `size` setting to include component size. [#20570](https://github.com/ant-design/ant-design/pull/20570)
- 🌟 Typography adds `suffix` attribute. [#20224](https://github.com/ant-design/ant-design/pull/20224)
- 🌟 Progress adds `steps` subcomponent. [#19613](https://github.com/ant-design/ant-design/pull/19613)
@@ -1346,7 +1611,7 @@ Ant Design 4.0-rc released! Here is the release [document](https://github.com/an
- 🌟 Upload supports iconRender to customize icons. [#20034](https://github.com/ant-design/ant-design/pull/20034) [@qq645381995](https://github.com/qq645381995)
- 🌟 Tag component preset status color. [#19399](https://github.com/ant-design/ant-design/pull/19399)
- 🌟 Grid uses `flex` layout. [#16635](https://github.com/ant-design/ant-design/pull/16635)
- 🐞 Fix the display error of Carousel component `dotposition` as`left | right`. [#20645](https://github.com/ant-design/ant-design/pull/20645) [@xrkffgg](https://github.com/xrkffgg)
- 🐞 Fix the display error of Carousel component `dotposition` as `left | right`. [#20645](https://github.com/ant-design/ant-design/pull/20645) [@xrkffgg](https://github.com/xrkffgg)
- 🐞 Fix Alert style text overflow. [#20318](https://github.com/ant-design/ant-design/pull/20318)
- 🙅 Removed warning messages for deprecated APIs. [#17510](https://github.com/ant-design/ant-design/pull/17510)
- 🙅 Added warning for Avatar, Button, Modal.method and Result components using v3 strings as icons. [#20226](https://github.com/ant-design/ant-design/pull/20226)

View File

@@ -15,6 +15,270 @@ timeline: true
---
## 4.8.4
`2020-11-16`
- 💄 修复 Button 和 Form 校验 loading 样式错误的问题。[#27794](https://github.com/ant-design/ant-design/pull/27794)
- 🐞 修复 Modal.confirm 关闭时国际化丢失的问题。[#27797](https://github.com/ant-design/ant-design/pull/27797)
- 🐞 修复 Button 和 Anchor 等组件在 React 17 下 `findDOMNode is deprecated` 的警告。[#27755](https://github.com/ant-design/ant-design/pull/27755) [@hosseinmd](https://github.com/hosseinmd)
## 4.8.3
`2020-11-14`
- 🛠 使用 React hooks 重构 Carousel。[#27694](https://github.com/ant-design/ant-design/pull/27694)
- 🛠 使用 React hooks 重构 `<Typography editable />`。[#27655](https://github.com/ant-design/ant-design/pull/27655)
- 🐞 修复 Form 在 namePath 为数组的时候表现异常的问题。[#27664](https://github.com/ant-design/ant-design/pull/27664)
- 💄 修复 DateRangePicker 选择已选范围内一行的首尾日期时的悬浮样式位置异常问题。[#27731](https://github.com/ant-design/ant-design/pull/27731) [@AlanCutFlim](https://github.com/AlanCutFlim)
- 🐞 修复 Select `tags` 模式下无法输入空格的问题。[#27726](https://github.com/ant-design/ant-design/pull/27726) [@baxtergu](https://github.com/baxtergu)
- 💄 修复 Typography.Link 禁用时鼠标样式问题。[#27734](https://github.com/ant-design/ant-design/pull/27734)
- 🐞 修复 Menu 下拉框显示时动画会播放两次的问题。[#27663](https://github.com/ant-design/ant-design/pull/27663)
- 💄 修复 Avatar src 为 Image 时的样式问题。[#27691](https://github.com/ant-design/ant-design/pull/27691)
- 💄 修复 Select `mode="multiple"` 的光标位置偏左的问题。[#27689](https://github.com/ant-design/ant-design/pull/27689)
- 🐞 修复 TextArea 使用 emoji 时被裁切的问题。[#27679](https://github.com/ant-design/ant-design/pull/27679) [@372623460jh](https://github.com/372623460jh)
- 🐞 修复 RangePicker `size="small"` 时高亮线没有对齐的问题。[#27673](https://github.com/ant-design/ant-design/pull/27673) [@Ifeinstein](https://github.com/Ifeinstein)
- 💄 新增 `@radio-border-width` less 变量。[#27703](https://github.com/ant-design/ant-design/pull/27703)
## 4.8.2
`2020-11-09`
- 🐞 修复 Pagination 快速跳转 margin 丢失的问题。[#27650](https://github.com/ant-design/ant-design/pull/27650)
- 🐞 修复 Steps `type="navigation"` 最后一项的样式问题。[#27654](https://github.com/ant-design/ant-design/pull/27654)
## 4.8.1
`2020-11-08`
- 🛠 使用 React hooks 重构 TreeSelect。[#27593](https://github.com/ant-design/ant-design/pull/27593)
- 🛠 使用 React hooks 重构 Layout。[#27595](https://github.com/ant-design/ant-design/pull/27595)
- 🐞 再次修复 Select 组件在 Form 中触发校验时外边框样式异常的问题。[#27607](https://github.com/ant-design/ant-design/pull/27607)
- 🐞 修复 Pagination 开启页码切换器时右侧多余的 `margin`。[#27610](https://github.com/ant-design/ant-design/pull/27610)
- 🐞 修复 Input.Search `enterButton={null}` 报错的问题。[#27591](https://github.com/ant-design/ant-design/pull/27591) [@davidebianchi](https://github.com/davidebianchi)
- 🐞 修复 Avatar.Group `size` 不生效的问题。[#27531](https://github.com/ant-design/ant-design/pull/27531)
- 🐞 修复垂直 Tabs 标题文字很长时导致页签宽度跳动的问题。[#27569](https://github.com/ant-design/ant-design/pull/27569)
- 🐞 修复 Table `column.children` 内的筛选功能不展示的问题。[#27435](https://github.com/ant-design/ant-design/pull/27435) [@JhonXY](https://github.com/JhonXY)
- 💄 修复 Steps 内嵌 Steps 时的样式。[#27514](https://github.com/ant-design/ant-design/pull/27514)
- TypeScript
- 🤖 修复 Select `ref` 属性 TS 错误。[#27482](https://github.com/ant-design/ant-design/pull/27482)
- 🤖 修复 Avatar `src` 类型。[#27524](https://github.com/ant-design/ant-design/pull/27524) [@n0ruSh](https://github.com/n0ruSh)
- RTL
- 💄 修复 Progress.Line `strokeColor` 在 RTL 模式下方向错误。[#27515](https://github.com/ant-design/ant-design/pull/27515)
## 4.8.0
`2020-11-02`
- Image
- 🔥 Image 支持 `preview.getContainer` 属性用于指定预览对话框的容器。[#26713](https://github.com/ant-design/ant-design/pull/26713) [@rfreling](https://github.com/rfreling)
- 🐞 修复 Image `style` 属性未作用于 img 元素的问题。[#27446](https://github.com/ant-design/ant-design/pull/27446)
- 🆕 ConfigProvider 增加 `form.requiredMark` 配置。[#27322](https://github.com/ant-design/ant-design/pull/27322)
- 🆕 Statistic 组件增加 `loading` 属性。[#26811](https://github.com/ant-design/ant-design/pull/26811) [@appleshell](https://github.com/appleshell)
- Avatar
- 🔥 Avatar 组件支持直接传入 Image 元素。[#27448](https://github.com/ant-design/ant-design/pull/27448) [@n0ruSh](https://github.com/n0ruSh)
- 🆕 Avatar.Group 增加 `size` 属性。[#27348](https://github.com/ant-design/ant-design/pull/27348)
- 🆕 Row 支持 `noWrap` 属性以使 Col 不错行。[#27469](https://github.com/ant-design/ant-design/pull/27469)
- Tree
- 🐞 修复 Tree 双击折叠图标时会选中文字的问题。[#27476](https://github.com/ant-design/ant-design/pull/27476)
- 🐞 修复 Tree 配置 `showLine``title` 多行的时候,线会截断的问题。[#27386](https://github.com/ant-design/ant-design/pull/27386)
- Modal
- 🆕 `modal.update()` 支持函数式更新。[#27163](https://github.com/ant-design/ant-design/pull/27163) [@Mongkii](https://github.com/Mongkii)
- 🆕 Modal method 增加 `bodyStyle` 属性。[#27292](https://github.com/ant-design/ant-design/pull/27292)
- 🐞 Fix Modal missing `modalRender` prop。[#27272](https://github.com/ant-design/ant-design/pull/27272) [@jieny](https://github.com/jieny)
- 🐞 `Modal.config` 中设置的 `rootPrefixCls` 可以对 `title``content` 下使用的 antd 组件生效。[#27376](https://github.com/ant-design/ant-design/pull/27376) [@Chersquwn](https://github.com/Chersquwn)
- Input
- 🆕 Input.Textarea 支持 `size` 属性。[#27110](https://github.com/ant-design/ant-design/pull/27110)
- 🐞 修复 Input `allowClear``className` 丢失的问题。[#27462](https://github.com/ant-design/ant-design/pull/27462)
- Table
- 🆕 Table.Summary.Cell 支持 `align` 配置。[#27365](https://github.com/ant-design/ant-design/pull/27365)
- 🐞 修复 Table 切换页长时 `onShowSizeChange` 触发两次的问题。[#27417](https://github.com/ant-design/ant-design/pull/27417)
- 🐞 修复 Table `pagination` 有时候会缓存先前设置的问题。[#27412](https://github.com/ant-design/ant-design/pull/27412)
- Typography
- 🐞 修复 Typography 特定内容出现非法正则表达式错误的问题。[#27383](https://github.com/ant-design/ant-design/pull/27383) [@ttys026](https://github.com/ttys026)
- 💄 修复 Typography.Link 禁用时鼠标悬浮或点击的颜色问题。[@27487](https://github.com/ant-design/ant-design/pull/27487) [@Liu-Ya](https://github.com/Liu-Ya)
- Steps
- 🐞 修复当开启 `progressDot` 时,标题未居中对齐的问题。[#27406](https://github.com/ant-design/ant-design/pull/27406)
- 🐞 修复在小屏幕下的各类样式错乱问题。[#27499](https://github.com/ant-design/ant-design/pull/27499)
- 🐞 修复 PageHeader `title` 为空时,会展示空 DOM 的问题。[#27485](https://github.com/ant-design/ant-design/pull/27485)
- 🐞 修复 Slider 拖拽时提示内容对齐问题。[#27489](https://github.com/ant-design/ant-design/pull/27489)
- 🐞 修复 RangePicker 选择同一时间后再次选择时边框样式异常的问题。[#27438](https://github.com/ant-design/ant-design/pull/27438)
- 💄 调整 Collapse 折叠箭头的位置与第一行文字对齐。[#27363](https://github.com/ant-design/ant-design/pull/27363)
- 💄 修复 Descriptions 在 `label` 自定义为块状元素时的样式问题。[#27375](https://github.com/ant-design/ant-design/pull/27375)
- 💄 修复 Select 组件在 Form 中触发校验时边框样式异常的问题。[#27378](https://github.com/ant-design/ant-design/pull/27378)
## 4.7.3
`2020-10-24`
- Form
- 🐞 修复 Form 在 ConfigProvider 下会警告 `non-boolean attribute 'virtual'` 的问题。[#27343](https://github.com/ant-design/ant-design/pull/27343)
- 🛠 调整 Form.Item `initialValue` 的同步时机改由与 `initialValues` 相同。[#27319](https://github.com/ant-design/ant-design/pull/27319)
- Typography
- 🛠 优化 Typography 省略时的 `title` 提示,现在会在 `...` 上展现剩余文本。[#27328](https://github.com/ant-design/ant-design/pull/27328)
- 💄 修复 Typography 在 Card title 中编辑样式问题。[#27221](https://github.com/ant-design/ant-design/pull/27221)
- Input
- 🐞 修复 Input.Search 指定 `allowClear``className` 重复出现的问题。[#27261](https://github.com/ant-design/ant-design/pull/27261)
- 🐞 修复 修复 Input.Search 激活 `allowClear` 时边框样式异常的问题。[#27325](https://github.com/ant-design/ant-design/pull/27325)
- 🐞 修复 Upload.List 图片预览显示不全的问题。[#27312](https://github.com/ant-design/ant-design/pull/27312) [@JuniorTour](https://github.com/JuniorTour)
- 🐞 修复 Notification 长文本不换行的问题。[#27285](https://github.com/ant-design/ant-design/pull/27285) [@littleee](https://github.com/littleee)
- 🐞 修复 Menu 在 flex 容器内不会正常收缩省略的问题。[#27253](https://github.com/ant-design/ant-design/pull/27253)
- 🌐 修复 en_US、en_GB、ga_IE 国际化语法问题。[#27259](https://github.com/ant-design/ant-design/pull/27259) [@yasikovsky](https://github.com/yasikovsky)
- 🐞 修复 Tag 标签自定义关闭图标会导致换行的问题。[#27226](https://github.com/ant-design/ant-design/pull/27226) [@handycode](https://github.com/handycode)
## 4.7.2
`2020-10-19`
- 💄 修复 Layout.Sider `light` 主题失效问题。[#27227](https://github.com/ant-design/ant-design/pull/27227) [@lingjieee](https://github.com/lingjieee)
- 💄 修复 TextArea 没有设置 `showCount` 时仍然会包裹 div 的问题,同时解决 `showCount``className``style` 没有传递给最外层节点的问题。[#27216](https://github.com/ant-design/ant-design/pull/27216)
- 🐞 修复 Checkbox.Group TS2559 错误。[#27231](https://github.com/ant-design/ant-design/pull/27231)
## 4.7.1
`2020-10-18`
- DatePicker
- 🐞 修复 DatePicker `showTime``true` 并且 `format` 为一个函数时报错的问题。[#27156](https://github.com/ant-design/ant-design/pull/27156)
- 💄 修复 DatePicker 在下拉空间不足时的动画方向问题。[#27101](https://github.com/ant-design/ant-design/pull/27101)
- Typography
- 💄 修复 Typography 没有 `pre``blockquote` 样式的问题。[#27150](https://github.com/ant-design/ant-design/pull/27150)
- 🐞 修复 Typography.Link 悬浮颜色错误的问题。[#27119](https://github.com/ant-design/ant-design/pull/27119)
- 🐞 修复 Typography.Link 危险类型的悬浮颜色问题。[#27104](https://github.com/ant-design/ant-design/pull/27104)
- 💄 修复 Descriptions 组件的内容含有超长数字时无法换行的问题。[#27195](https://github.com/ant-design/ant-design/pull/27195) [@WLyKan](https://github.com/WLyKan)
- 🐞 修复 Password 在受控模式下未清除 `value` 属性的问题。[#27191](https://github.com/ant-design/ant-design/pull/27191)
- 🐞 修复 Notification 在小尺寸屏幕下的宽度问题。[#27189](https://github.com/ant-design/ant-design/pull/27189)
- 🐞 修复 Cascader 类名重复的问题。[#27187](https://github.com/ant-design/ant-design/pull/27187) [@huntdream](https://github.com/huntdream)
- 🐞 修复 Drawer 会触发 Form 提交事件的问题。[#27175](https://github.com/ant-design/ant-design/pull/27175)
- 🐞 修复 Dropdown 下拉菜单图标间距丢失的问题。[#27165](https://github.com/ant-design/ant-design/pull/27165)
- 💄 修复 Layout.Sider 指定 `collapsedWidth` 后侧边菜单部分宽度不对的问题。[#27154](https://github.com/ant-design/ant-design/pull/27154)
- 🐞 修复 Tabs `animated` 属性为 `true` 时未开启内容切换动画的问题。[#27145](https://github.com/ant-design/ant-design/pull/27145)
- 🐞 修复 Divider 带标题时的分割线颜色。[#27134](https://github.com/ant-design/ant-design/pull/27134)
- 💄 修复 Radio 选项选中并禁用时的鼠标样式。[#27125](https://github.com/ant-design/ant-design/pull/27125)
- 🇪🇸 为西班牙语 es_ES 中添加缺少的翻译。[#27079](https://github.com/ant-design/ant-design/pull/27079) [@gerongams](https://github.com/gersongams)
- RTL
- 💄 优化 Input.TextArea 字数提示在 RTL 模式下的样式。[#27098](https://github.com/ant-design/ant-design/pull/27098)
- TypeScript
- 🤖 Button `shape` 移除文档中未声明的类型。[#27159](https://github.com/ant-design/ant-design/pull/27159)
- 🤖 修复 Form.List `rules` 属性缺失的问题。[#27164](https://github.com/ant-design/ant-design/pull/27164) [@huntdream](https://github.com/huntdream)
## 4.7.0
`2020-10-10`
- 🔥 Input.TextArea 支持字数统计功能。[#26952](https://github.com/ant-design/ant-design/pull/26952) [@zhangchen915](https://github.com/zhangchen915)
- DatePicker
- 🔥 DatePicker `format` 支持传入一个函数以自定义显示内容。[#26845](https://github.com/ant-design/ant-design/pull/26845)
- 🐞 修复 RangePicker 结束日期初始值无法选择的问题。[#23167](https://github.com/ant-design/ant-design/issues/23167)
- Form
- 🔥 Form.Item 支持 `tooltip` 属性自定义提示信息。[#26780](https://github.com/ant-design/ant-design/pull/26780)
- 🆕 Form.List 支持 `rules` 校验并添加 Form.ErrorList 组件用于展示。[#26676](https://github.com/ant-design/ant-design/pull/26676)
- 🆕 Form.Item 支持 `messageVariables` 属性。[#26597](https://github.com/ant-design/ant-design/pull/26597)
- 🐞 修复 Form `onValuesChange` 第二个参数返回整个 `store` 的值而不是有效字段值的问题。[#26808](https://github.com/ant-design/ant-design/pull/26808)
- Upload
- 🔥 Upload 添加 `itemRender` 用于自定义文件列表项。[#26333](https://github.com/ant-design/ant-design/pull/26333)
- 🆕 Upload `removeIcon``downloadIcon` 现在支持传入一个函数。[#26684](https://github.com/ant-design/ant-design/pull/26684) [@mwaddell](https://github.com/mwaddell)
- Table
- 🆕 Table `sticky` 支持 `getContainer` 以指定滚动容器。[#26973](https://github.com/ant-design/ant-design/pull/26973)
- 🐞 修复 Table `column.filterDropdown``undefined` 时依旧会展示筛选菜单的问题。[#27002](https://github.com/ant-design/ant-design/pull/27002) [@shangyilim](https://github.com/shangyilim)
- Modal
- 🛠 重构 Modal 组件动画,现在 `destroyOnClose` 关闭时将完全清理相关 Dom 节点。[#26940](https://github.com/ant-design/ant-design/pull/26940)
- 🆕 Modal 新增 `modalRender` 属性,支持可拖拽的对话框。[#26507](https://github.com/ant-design/ant-design/pull/26507) [@jhoneybee](https://github.com/jhoneybee)
- 🆕 Space 增加 `split` 属性以支持分隔符间隔。[#26948](https://github.com/ant-design/ant-design/pull/26948)
- 🆕 Image `preview` 属性扩展支持 `visible``onVisibleChange`。[#26915](https://github.com/ant-design/ant-design/pull/26915)
- 🆕 InputNumber 点击上下按钮时将触发 `onStep`。[#27075](https://github.com/ant-design/ant-design/pull/27075)
- 🆕 Avatar `size` 可以进行响应式的大小配置。[#26244](https://github.com/ant-design/ant-design/pull/26244) [@willamesoares](https://github.com/willamesoares)
- 🐞 修复 Radio.Button 内无法使用 Tooltip 的问题。[#27050](https://github.com/ant-design/ant-design/pull/27050)
- RTL
- ⬅️ 修复 List 按钮在 RTL 模式下的样式。[#26964](https://github.com/ant-design/ant-design/pull/26964)
- ⬅️ 优化 Transfer 分页在 RTL 模式下的样式。[#26960](https://github.com/ant-design/ant-design/pull/26960)
- ⬅️ 修复 Upload RTL 模式下样式。[#26961](https://github.com/ant-design/ant-design/pull/26961)
- ⬅️ 优化 Tag 样式避免主题和 RTL 模式互相影响。[#26955](https://github.com/ant-design/ant-design/pull/26955)
- ⬅️ 优化 Cascader/Tree 组件中数据扩展 `loading` 按钮在 RTL 模式下的样式。[#27010](https://github.com/ant-design/ant-design/pull/27010)
- TypeScript
- 🤖 修复 `TimeLineItemProps``TimelineItemProps`。[#27001](https://github.com/ant-design/ant-design/pull/27001) [@mgcrea](https://github.com/mgcrea)
- 🤖 修复 Slider `autoFocus` 属性定义。[#26995](https://github.com/ant-design/ant-design/pull/26995) [@shangyilim](https://github.com/shangyilim)
- 🤖 修复 Slider `step` 属性不接收 `null` 的问题。[#26984](https://github.com/ant-design/ant-design/pull/26984) [@shangyilim](https://github.com/shangyilim)
- 🤖 修复 Slider.Range `trackStyle``handleStyle` 应该接受数组的问题。[#27033](https://github.com/ant-design/ant-design/pull/27033)
- 🤖 优化 Tag `onClose` TypeScript 定义。[#26932](https://github.com/ant-design/ant-design/pull/26932)
- 🤖 调整 Form 定义,现在当 `getFieldsValue` 不配置 `namePath` 时返回类型为 FormValue 的泛型定义。[#26791](https://github.com/ant-design/ant-design/pull/26791)
- 国际化
- 🇧🇾 新增白俄罗斯语支持。[#27028](https://github.com/ant-design/ant-design/pull/27028) [@StIvan8](https://github.com/StIvan8)
- 🇯🇵 调整日语国际化文案。[#27043](https://github.com/ant-design/ant-design/pull/27043) [@iorikingdom](https://github.com/iorikingdom)
- 🇵🇱 补充 Table 波兰语国际化文案。[#26913](https://github.com/ant-design/ant-design/pull/26913) [@daczczcz1](https://github.com/daczczcz1)
- 🇹🇷 补充土耳其语可选文案。[#27017](https://github.com/ant-design/ant-design/pull/27017) [@alperTunca](https://github.com/alperTunca)
- 🇹🇭 补充 DatePicker 的泰语国际化文案。[#26993](https://github.com/ant-design/ant-design/pull/26993) [@anawinwz](https://github.com/anawinwz)
## 4.6.6
`2020-09-27`
- 🐞 修复 Steps 在小屏幕下第一项偏移的问题。[#26894](https://github.com/ant-design/ant-design/pull/26894)
- 💄 修复 Divider 在有文字时,设置边框颜色无效的问题。[#26863](https://github.com/ant-design/ant-design/pull/26863)
- 🐞 修复 Radio.Button 错误校验高亮样式的问题。[#26849](https://github.com/ant-design/ant-design/pull/26849) [@dhorelik](https://github.com/dhorelik)
- 💄 修复 Typography 链接下划线样式。[#26854](https://github.com/ant-design/ant-design/pull/26854) [@vineetvk01](https://github.com/vineetvk01)
- 国际化
- 🌐 添加泰语支持。[#26906](https://github.com/ant-design/ant-design/pull/26906) [@anawinwz](https://github.com/anawinwz)
- TypeScript
- 🤖 修复 message.destroy 参数类型错误。[#26864](https://github.com/ant-design/ant-design/pull/26864) [@lihqi](https://github.com/lihqi)
- 🤖 优化 Slider 类型定义。[#26884](https://github.com/ant-design/ant-design/pull/26884)
- 🤖 导出 Form 中的 `FormListProps` 类型。[#26831](https://github.com/ant-design/ant-design/pull/26831) [@mgcrea](https://github.com/mgcrea)
## 4.6.5
`2020-09-20`
- 💄 修复 Descriptions 长文本溢出的样式问题。[#26820](https://github.com/ant-design/ant-design/pull/26820)
- 🐞 修复 Menu 子菜单展开/收起时会出现滚动条的问题。[#26817](https://github.com/ant-design/ant-design/pull/26817)
- 🐞 修复 `@layout-sider-background` 变量不能设置为渐变色的问题。[#26810](https://github.com/ant-design/ant-design/pull/26810)
- 🐞 修复 Select 搜索时输入第一个字符后中文输入法状态丢失的问题。[#26796](https://github.com/ant-design/ant-design/pull/26796)
- 🐞 修复 Table `@table-sticky-zindex` less 报错问题。[#26800](https://github.com/ant-design/ant-design/pull/26800) [@chimp1nski](https://github.com/chimp1nski)
- Button
- 💄 修复 Button 只有图标时的对齐问题。[#26785](https://github.com/ant-design/ant-design/pull/26785)
- 🐞 修复 Button 和 react-router 一起使用时抛出 `Invalid value for prop navigate` 的问题。[#26740](https://github.com/ant-design/ant-design/pull/26740) [@knobo](https://github.com/knobo)
- 💄 修复 TimePicker 选择框 hover 时文字内容左移的问题,并新增 `@picker-time-panel-column-width``@picker-time-panel-column-height` less 变量。[#26784](https://github.com/ant-design/ant-design/pull/26784)
- 🐞 修复 AutoComplete 使用 `placeholder``allowClear` 时抛出警告的问题。[#26765](https://github.com/ant-design/ant-design/pull/26765)
- 🐞 修复 Space 空条目会占据一格的样式问题。[#26721](https://github.com/ant-design/ant-design/pull/26721) [@knobo](https://github.com/knobo)
- 🛠 去重多版本 `rc-trigger` 以降低打包尺寸。[#26803](https://github.com/ant-design/ant-design/pull/26803)
- TypeScript
- 🤖 Cascader 增加 `name``id` 属性。[#26660](https://github.com/ant-design/ant-design/pull/26660) [@alwaysloseall](https://github.com/alwaysloseall)
## 4.6.4
`2020-09-13`
- 💄 修复 Card 封面图片上有 1px 白边的问题。[#26659](https://github.com/ant-design/ant-design/pull/26659)
- 💄 修复 Select 的 `placeholder` 颜色与 Input 不一致的问题。[#26651](https://github.com/ant-design/ant-design/pull/26651) [@wangcch](https://github.com/wangcch)
- 🐞 修复 Menu 不支持 React.Fragment 的问题。[#26656](https://github.com/ant-design/ant-design/pull/26656)
- 🐞 修复 TextArea 设置 `value``undefined` 时和 Input 行为不一致的问题。[#26652](https://github.com/ant-design/ant-design/pull/26652)
- 🐞 修复 Motion 相关问题例如 Upload 对齐闪烁与 Form.Item 配置 `help` 的 ssr 问题。[#26628](https://github.com/ant-design/ant-design/pull/26628)
- 🐞 修复 Typography.Link 和 react-router 一起使用时抛出 `Invalid value for prop navigate` 的问题。[#26623](https://github.com/ant-design/ant-design/pull/26623)
- 🐞 修复 Table 分页器在表格上方消失的问题。[#26618](https://github.com/ant-design/ant-design/pull/26618)
- 🐞 修复 Upload 受控时同时上传多份文件会丢失部分文件的问题。[#26612](https://github.com/ant-design/ant-design/pull/26612)
- TypeScript
- 🤖 修复 Table sorter 的 `compare``multiple` 不是可选的问题。[#26686](https://github.com/ant-design/ant-design/pull/26686)
## 4.6.3
`2020-09-06`
- 🛎 移动 props 中的 `className` 到最后。[#26602](https://github.com/ant-design/ant-design/pull/26602)
- Table
- 💄 修复 Table 嵌套表格样式会影响所有子层级表格的问题。[#26568](https://github.com/ant-design/ant-design/pull/26568) [@willc001](https://github.com/willc001)
- 🐞 修复 Table 上方元素 `float: right;` 后无法交互的问题。[#26599](https://github.com/ant-design/ant-design/pull/26599)
- 🐞 修复 Modal 关闭时导致滚动条向上跳动的问题。[#26538](https://github.com/ant-design/ant-design/pull/26538)
- 🐞 修复 Upload 组件中 `customRequest``onError` 的类型定义。[#26601](https://github.com/ant-design/ant-design/pull/26601) [@yingpengsha](https://github.com/yingpengsha)
- 🐞 修复 Select/TreeSelect 在 Chrome 下出现原生自动完成列表的问题。[#26590](https://github.com/ant-design/ant-design/pull/26590)
- 🐞 修复 Cascader 搜索时 value 被覆盖的情况。[#26569](https://github.com/ant-design/ant-design/pull/26569) [@lich-yoo](https://github.com/lich-yoo)
- 🐞 修复 Modal 在某些情况下溢出视窗的问题。[#25765](https://github.com/ant-design/ant-design/pull/25765) [@tanmoyopenroot](https://github.com/tanmoyopenroot)
- 🐞 修复 Radio.Group 在 legacy Form 中,不能正常工作的问题。[#26555](https://github.com/ant-design/ant-design/pull/26555) [@willc001](https://github.com/willc001)
- 🐞 修复 Pagination 切换按钮在 windows 下的对齐问题。[#26549](https://github.com/ant-design/ant-design/pull/26549)
- 🐞 修复 Form 使用 `help` 时出现的同构问题。[#26542](https://github.com/ant-design/ant-design/pull/26542)
- 🐞 修复 Avatar 在 `display: none` 时不会正确缩放 fallback 文字的问题。[#26522](https://github.com/ant-design/ant-design/pull/26522) [@zhangyu1818](https://github.com/zhangyu1818)
- TypeScript
- 🤖 Col 增加 `ColSize` 增加 `flex` 的定义。 [#26578](https://github.com/ant-design/ant-design/pull/26578) [@blaiz](https://github.com/blaiz)
- 🤖 修复 Tooltip/Popover `children` 定义不接受 ReactNode 的问题。[#26534](https://github.com/ant-design/ant-design/pull/26534)
## 4.6.2
`2020-08-31`
@@ -52,6 +316,7 @@ timeline: true
- 💄 加深默认文本 `@text-color` 以满足 WCAG 2.0 对比度的规范。[#25630](https://github.com/ant-design/ant-design/pull/25630)
- 🔥 新增图片组件 Image。[#26296](https://github.com/ant-design/ant-design/pull/26296)
- 🔥 Table 新增 `sticky` 属性以支持固定表头和滚动条。[#25939](https://github.com/ant-design/ant-design/pull/25939)
- 🛠 用 hooks 重构 Upload。[#26196](https://github.com/ant-design/ant-design/pull/26196)
- Form
- 🆕 Form 添加 `requiredMark` 属性以支持设置必选样式,废弃原 `hideRequiredMark`。[#26309](https://github.com/ant-design/ant-design/pull/26309)
- 🆕 Form.List 中的 `add` 方法支持第二个 `index` 参数。[#26081](https://github.com/ant-design/ant-design/pull/26081)
@@ -83,7 +348,7 @@ timeline: true
- Badge
- 💄 新增 `@badge-color` less 变量。[#26159](https://github.com/ant-design/ant-design/pull/26159)
- 🆕 Badge 新增 `size` 属性用于设置大小。[#25851](https://github.com/ant-design/ant-design/pull/25851) [@moonrailgun](https://github.com/moonrailgun)
- 🆕 Tabs 可自定义`tabBarExtraContent` 的渲染位置。[#25138](https://github.com/ant-design/ant-design/pull/25138) [@jesse3mh9a](https://github.com/jesse3mh9a)
- 🆕 Tabs 可自定义 `tabBarExtraContent` 的渲染位置。[#25138](https://github.com/ant-design/ant-design/pull/25138) [@jesse3mh9a](https://github.com/jesse3mh9a)
- 💄 优化 Descriptions 在内容比较多时的显示效果。[#25903](https://github.com/ant-design/ant-design/pull/25903)
- 🆕 message 支持通过 `message.desctroy(key)` 销毁。[#26052](https://github.com/ant-design/ant-design/pull/26052) [@lihqi](https://github.com/lihqi)
- 💄 调整 InputNumber 操作栏在 `readOnly` 时为隐藏。[#25998](https://github.com/ant-design/ant-design/pull/25998)
@@ -208,7 +473,7 @@ timeline: true
- 🐞 修复 Form 垂直布局时 Form.Item 设置 `labelCol={{ offset: number }}` 不生效的问题。[#25713](https://github.com/ant-design/ant-design/pull/25713) [@zhangchen915](https://github.com/zhangchen915)
- ⌨️ Form 错误信息节点增加属性 `role="alert"` 以增强可访问性。[#25735](https://github.com/ant-design/ant-design/pull/25735) [@AlbertAZ1992](https://github.com/AlbertAZ1992)
- Calendar
- 🐞 修复 Calendar 组件的 `validRange` 导致 `disabledDate` 不生效 。[#25626](https://github.com/ant-design/ant-design/pull/25626) [@zhangchen915](https://github.com/zhangchen915)
- 🐞 修复 Calendar 组件的 `validRange` 导致 `disabledDate` 不生效。[#25626](https://github.com/ant-design/ant-design/pull/25626) [@zhangchen915](https://github.com/zhangchen915)
- 🐞 修复 Calendar `validRange` 对月份下拉菜单不生效的问题。[#25626](https://github.com/ant-design/ant-design/pull/25626) [@zhangchen915](https://github.com/zhangchen915)
- 🐞 修复 Table `getCheckboxProps` 返回的 `indeterminate` 不生效。[#25649](https://github.com/ant-design/ant-design/pull/25649)
- 🐞 修复 Select 清除按钮在 Form.Item 下位置不对的问题。[#25728](https://github.com/ant-design/ant-design/pull/25728)

View File

@@ -2,6 +2,5 @@ FROM buildkite/puppeteer:v3.0.4
RUN mkdir /app
WORKDIR /app
COPY package.json ./
RUN npm install
ENV PATH="${PATH}:/app/node_modules/.bin"
COPY . .

View File

@@ -18,8 +18,8 @@
[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
[circleci-image]: https://img.shields.io/circleci/build/github/ant-design/ant-design/master?style=flat-square
[circleci-url]: https://circleci.com/gh/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
@@ -42,8 +42,8 @@
[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
[semver-stability-url]: https://dependabot.com/compatibility-score.html/?dependency-name=antd&package-manager=npm_and_yarn
[semver-stability-image]: https://api.dependabot.com/badges/compatibility_score?dependency-name=antd&package-manager=npm_and_yarn&version-scheme=semver
</div>

View File

@@ -18,8 +18,8 @@ An enterprise-class UI design language and React UI library.
[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
[circleci-image]: https://img.shields.io/circleci/build/github/ant-design/ant-design/master?style=flat-square
[circleci-url]: https://circleci.com/gh/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

16
SECURITY.md Normal file
View File

@@ -0,0 +1,16 @@
# Security Policy
## Supported Versions
Use this section to tell people about which versions of your project are currently being supported with security updates.
| Version | Supported |
| ------- | ------------------ |
| 4.x | :white_check_mark: |
| < 4.0 | :x: |
## Reporting a Vulnerability
Use this section to tell people how to report a vulnerability.
Tell them where to go, how often they can expect to get an update on a reported vulnerability, what to expect if the vulnerability is accepted or declined, etc.

View File

@@ -13,6 +13,7 @@ pool:
stages:
- stage: site
condition: and(succeeded(), eq(variables['Build.Reason'], 'PullRequest'))
jobs:
- job: Build_Site
steps:
@@ -59,59 +60,3 @@ stages:
- 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: '14.7.0'
- 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: '14.7.0'
- 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

@@ -3,39 +3,61 @@ import React from 'react';
import { mount } from 'enzyme';
import KeyCode from 'rc-util/lib/KeyCode';
import delayRaf from '../raf';
import throttleByAnimationFrame from '../throttleByAnimationFrame';
import {
throttleByAnimationFrame,
throttleByAnimationFrameDecorator,
} from '../throttleByAnimationFrame';
import getDataOrAriaProps from '../getDataOrAriaProps';
import Wave from '../wave';
import TransButton from '../transButton';
import openAnimation from '../openAnimation';
import { isStyleSupport, isFlexSupported } from '../styleChecker';
import { sleep } from '../../../tests/utils';
import focusTest from '../../../tests/shared/focusTest';
describe('Test utils function', () => {
focusTest(TransButton);
it('throttle function should work', async () => {
const callback = jest.fn();
const throttled = throttleByAnimationFrame(callback);
expect(callback).not.toHaveBeenCalled();
describe('throttle', () => {
it('throttle function should work', async () => {
const callback = jest.fn();
const throttled = throttleByAnimationFrame(callback);
expect(callback).not.toHaveBeenCalled();
throttled();
throttled();
await sleep(20);
throttled();
throttled();
await sleep(20);
expect(callback).toHaveBeenCalled();
expect(callback.mock.calls.length).toBe(1);
});
expect(callback).toHaveBeenCalled();
expect(callback.mock.calls.length).toBe(1);
});
it('throttle function should be canceled', async () => {
const callback = jest.fn();
const throttled = throttleByAnimationFrame(callback);
it('throttle function should be canceled', async () => {
const callback = jest.fn();
const throttled = throttleByAnimationFrame(callback);
throttled();
throttled.cancel();
await sleep(20);
throttled();
throttled.cancel();
await sleep(20);
expect(callback).not.toHaveBeenCalled();
expect(callback).not.toHaveBeenCalled();
});
it('throttleByAnimationFrameDecorator should works', async () => {
const callbackFn = jest.fn();
class Test {
@throttleByAnimationFrameDecorator()
// eslint-disable-next-line class-methods-use-this
callback() {
callbackFn();
}
}
const test = new Test();
test.callback();
test.callback();
test.callback();
await sleep(30);
expect(callbackFn).toHaveBeenCalledTimes(1);
});
});
describe('getDataOrAriaProps', () => {
@@ -187,20 +209,23 @@ describe('Test utils function', () => {
});
});
describe('openAnimation', () => {
it('should support openAnimation', () => {
const done = jest.fn();
const domNode = document.createElement('div');
expect(typeof openAnimation.enter).toBe('function');
expect(typeof openAnimation.leave).toBe('function');
expect(typeof openAnimation.appear).toBe('function');
const appear = openAnimation.appear(domNode, done);
const enter = openAnimation.enter(domNode, done);
const leave = openAnimation.leave(domNode, done);
expect(typeof appear.stop).toBe('function');
expect(typeof enter.stop).toBe('function');
expect(typeof leave.stop).toBe('function');
expect(done).toHaveBeenCalled();
describe('style', () => {
it('isFlexSupported', () => {
expect(isFlexSupported).toBe(true);
});
it('isStyleSupport', () => {
expect(isStyleSupport('color')).toBe(true);
expect(isStyleSupport('not-existed')).toBe(false);
});
it('isStyleSupport return false in service side', () => {
const spy = jest
.spyOn(window.document, 'documentElement', 'get')
.mockImplementation(() => undefined);
expect(isStyleSupport('color')).toBe(false);
expect(isStyleSupport('not-existed')).toBe(false);
spy.mockRestore();
});
});
});

View File

@@ -0,0 +1,19 @@
import * as React from 'react';
import { fillRef } from '../ref';
function useCombinedRefs<T>(
...refs: Array<React.MutableRefObject<T> | ((instance: T) => void) | null>
) {
const targetRef = React.useRef<T>();
React.useEffect(() => {
refs.forEach(ref => {
if (!ref) return;
fillRef(ref, targetRef.current);
});
}, [refs]);
return targetRef;
}
export default useCombinedRefs;

View File

@@ -1,5 +1,4 @@
import { CSSMotionProps } from 'rc-motion';
import { MotionEventHandler, MotionEndEventHandler } from 'rc-motion/lib/CSSMotion';
import { CSSMotionProps, MotionEventHandler, MotionEndEventHandler } from 'rc-motion';
// ================== Collapse Motion ==================
const getCollapsedHeight: MotionEventHandler = () => ({ height: 0, opacity: 0 });

View File

@@ -1,6 +1,7 @@
export type Breakpoint = 'xxl' | 'xl' | 'lg' | 'md' | 'sm' | 'xs';
export type BreakpointMap = Partial<Record<Breakpoint, string>>;
export type BreakpointMap = Record<Breakpoint, string>;
export type ScreenMap = Partial<Record<Breakpoint, boolean>>;
export type ScreenSizeMap = Partial<Record<Breakpoint, number>>;
export const responsiveArray: Breakpoint[] = ['xxl', 'xl', 'lg', 'md', 'sm', 'xs'];
@@ -43,7 +44,7 @@ const responsiveObserve = {
},
unregister() {
Object.keys(responsiveMap).forEach((screen: Breakpoint) => {
const matchMediaQuery = responsiveMap[screen]!;
const matchMediaQuery = responsiveMap[screen];
const handler = this.matchHandlers[matchMediaQuery];
handler?.mql.removeListener(handler?.listener);
});
@@ -51,7 +52,7 @@ const responsiveObserve = {
},
register() {
Object.keys(responsiveMap).forEach((screen: Breakpoint) => {
const matchMediaQuery = responsiveMap[screen]!;
const matchMediaQuery = responsiveMap[screen];
const listener = ({ matches }: { matches: boolean }) => {
this.dispatch({
...screens,

View File

@@ -13,7 +13,6 @@ interface ScrollToOptions {
export default function scrollTo(y: number, options: ScrollToOptions = {}) {
const { getContainer = () => window, callback, duration = 450 } = options;
const container = getContainer();
const scrollTop = getScroll(container, true);
const startTime = Date.now();

View File

@@ -1,4 +1,4 @@
const isStyleSupport = (styleName: string | Array<string>): boolean => {
export const isStyleSupport = (styleName: string | Array<string>): boolean => {
if (typeof window !== 'undefined' && window.document && window.document.documentElement) {
const styleNameList = Array.isArray(styleName) ? styleName : [styleName];
const { documentElement } = window.document;
@@ -9,5 +9,3 @@ const isStyleSupport = (styleName: string | Array<string>): boolean => {
};
export const isFlexSupported = isStyleSupport(['flex', 'webkitFlex', 'Flex', 'msFlex']);
export default isStyleSupport;

View File

@@ -1,6 +1,6 @@
import raf from 'raf';
export default function throttleByAnimationFrame(fn: (...args: any[]) => void) {
export function throttleByAnimationFrame(fn: (...args: any[]) => void) {
let requestId: number | null;
const later = (args: any[]) => () => {
@@ -20,15 +20,18 @@ export default function throttleByAnimationFrame(fn: (...args: any[]) => void) {
}
export function throttleByAnimationFrameDecorator() {
// eslint-disable-next-line func-names
return function(target: any, key: string, descriptor: any) {
return function throttle(target: any, key: string, descriptor: any) {
const fn = descriptor.value;
let definingProperty = false;
return {
configurable: true,
get() {
// In IE11 calling Object.defineProperty has a side-effect of evaluating the
// getter for the property which is being replaced. This causes infinite
// recursion and an "Out of stack space" error.
// eslint-disable-next-line no-prototype-builtins
if (definingProperty || this === target.prototype || this.hasOwnProperty(key)) {
/* istanbul ignore next */
return fn;
}

View File

@@ -8,7 +8,7 @@ export const tupleNum = <T extends number[]>(...args: T) => args;
* https://stackoverflow.com/a/59187769
* Extract the type of an element of an array/tuple without performing indexing
*/
export type ElementOf<T> = T extends (infer E)[] ? E : T extends readonly (infer E)[] ? E : never;
export type ElementOf<T> = T extends (infer E)[] ? E : T extends readonly (infer F)[] ? F : never;
/**
* https://github.com/Microsoft/TypeScript/issues/29729

View File

@@ -1,10 +1,11 @@
import * as React from 'react';
import { findDOMNode } from 'react-dom';
import TransitionEvents from '@ant-design/css-animation/lib/Event';
import { supportRef, composeRef } from 'rc-util/lib/ref';
import raf from './raf';
import { ConfigConsumer, ConfigConsumerProps, CSPConfig, ConfigContext } from '../config-provider';
import { cloneElement } from './reactNode';
let styleForPesudo: HTMLStyleElement | null;
let styleForPseudo: HTMLStyleElement | null;
// Where el is the DOM element you'd like to test for visibility
function isHidden(element: HTMLElement) {
@@ -30,6 +31,8 @@ export default class Wave extends React.Component<{ insertExtraNode?: boolean }>
cancel: () => void;
};
private containerRef = React.createRef<HTMLDivElement>();
private extraNode: HTMLDivElement;
private clickWaveTimeoutId: number;
@@ -45,7 +48,7 @@ export default class Wave extends React.Component<{ insertExtraNode?: boolean }>
context: ConfigConsumerProps;
componentDidMount() {
const node = findDOMNode(this) as HTMLElement;
const node = this.containerRef.current as HTMLDivElement;
if (!node || node.nodeType !== 1) {
return;
}
@@ -74,8 +77,8 @@ export default class Wave extends React.Component<{ insertExtraNode?: boolean }>
extraNode.className = `${getPrefixCls('')}-click-animating-node`;
const attributeName = this.getAttributeName();
node.setAttribute(attributeName, 'true');
// Not white or transparnt or grey
styleForPesudo = styleForPesudo || document.createElement('style');
// Not white or transparent or grey
styleForPseudo = styleForPseudo || document.createElement('style');
if (
waveColor &&
waveColor !== '#ffffff' &&
@@ -86,18 +89,18 @@ export default class Wave extends React.Component<{ insertExtraNode?: boolean }>
) {
// Add nonce if CSP exist
if (this.csp && this.csp.nonce) {
styleForPesudo.nonce = this.csp.nonce;
styleForPseudo.nonce = this.csp.nonce;
}
extraNode.style.borderColor = waveColor;
styleForPesudo.innerHTML = `
styleForPseudo.innerHTML = `
[${getPrefixCls('')}-click-animating-without-extra-node='true']::after, .${getPrefixCls(
'',
)}-click-animating-node {
--antd-wave-shadow-color: ${waveColor};
}`;
if (!document.body.contains(styleForPesudo)) {
document.body.appendChild(styleForPesudo);
if (!document.body.contains(styleForPseudo)) {
document.body.appendChild(styleForPseudo);
}
}
if (insertExtraNode) {
@@ -112,11 +115,10 @@ export default class Wave extends React.Component<{ insertExtraNode?: boolean }>
return;
}
const node = findDOMNode(this) as HTMLElement;
const node = this.containerRef.current as HTMLDivElement;
if (!e || e.target !== node || this.animationStart) {
return;
}
this.resetEffect(node);
};
@@ -181,8 +183,8 @@ export default class Wave extends React.Component<{ insertExtraNode?: boolean }>
const attributeName = this.getAttributeName();
node.setAttribute(attributeName, 'false'); // edge has bug on `removeAttribute` #14466
if (styleForPesudo) {
styleForPesudo.innerHTML = '';
if (styleForPseudo) {
styleForPseudo.innerHTML = '';
}
if (insertExtraNode && this.extraNode && node.contains(this.extraNode)) {
@@ -196,7 +198,14 @@ export default class Wave extends React.Component<{ insertExtraNode?: boolean }>
const { children } = this.props;
this.csp = csp;
return children;
if (!React.isValidElement(children)) return children;
let ref: React.Ref<any> = this.containerRef;
if (supportRef(children)) {
ref = composeRef((children as any).ref, this.containerRef as any);
}
return cloneElement(children, { ref });
};
render() {

View File

@@ -186,7 +186,7 @@ describe('Affix Render', () => {
it.each([
{ name: 'inner', index: 0 },
{ name: 'outer', index: 1 },
])(name, async ({ index }) => {
])('inner or outer', async ({ index }) => {
document.body.innerHTML = '<div id="mounter" />';
const updateCalled = jest.fn();

View File

@@ -0,0 +1,5 @@
import { imageDemoTest } from '../../../tests/shared/imageTest';
describe('Affix image', () => {
imageDemoTest('affix');
});

View File

@@ -19,8 +19,8 @@ Please note that Affix should not cover other content on the page, especially wh
| --- | --- | --- | --- |
| offsetBottom | Offset from the bottom of the viewport (in pixels) | number | - |
| offsetTop | Offset from the top of the viewport (in pixels) | number | 0 |
| onChange | Callback for when Affix state is changed | function(affixed) | - |
| target | Specifies the scrollable area DOM node | () => HTMLElement | () => window |
| onChange | Callback for when Affix state is changed | function(affixed) | - |
**Note:** Children of `Affix` must not have the property `position: absolute`, but you can set `position: absolute` on `Affix` itself:

View File

@@ -20,8 +20,8 @@ cover: https://gw.alipayobjects.com/zos/alicdn/tX6-md4H6/Affix.svg
| --- | --- | --- | --- |
| offsetBottom | 距离窗口底部达到指定偏移量后触发 | number | - |
| offsetTop | 距离窗口顶部达到指定偏移量后触发 | number | - |
| onChange | 固定状态改变时触发的回调函数 | function(affixed) | - |
| target | 设置 `Affix` 需要监听其滚动事件的元素,值为一个返回对应 DOM 元素的函数 | () => HTMLElement | () => window |
| onChange | 固定状态改变时触发的回调函数 | function(affixed) | - |
**注意:**`Affix` 内的元素不要使用绝对定位,如需要绝对定位的效果,可以直接设置 `Affix` 为绝对定位:

View File

@@ -14,7 +14,6 @@ Array [
>
<svg
aria-hidden="true"
class=""
data-icon="exclamation-circle"
fill="currentColor"
focusable="false"
@@ -49,7 +48,6 @@ Array [
>
<svg
aria-hidden="true"
class=""
data-icon="exclamation-circle"
fill="currentColor"
focusable="false"
@@ -82,7 +80,6 @@ Array [
>
<svg
aria-hidden="true"
class=""
data-icon="close"
fill="currentColor"
focusable="false"
@@ -125,7 +122,6 @@ Array [
>
<svg
aria-hidden="true"
class=""
data-icon="close-circle"
fill="currentColor"
focusable="false"
@@ -194,7 +190,6 @@ Array [
>
<svg
aria-hidden="true"
class=""
data-icon="close"
fill="currentColor"
focusable="false"
@@ -236,7 +231,6 @@ Array [
>
<svg
aria-hidden="true"
class=""
data-icon="close"
fill="currentColor"
focusable="false"
@@ -310,7 +304,6 @@ Array [
>
<svg
aria-hidden="true"
class=""
data-icon="smile"
fill="currentColor"
focusable="false"
@@ -344,7 +337,6 @@ Array [
>
<svg
aria-hidden="true"
class=""
data-icon="smile"
fill="currentColor"
focusable="false"
@@ -378,7 +370,6 @@ Array [
>
<svg
aria-hidden="true"
class=""
data-icon="smile"
fill="currentColor"
focusable="false"
@@ -412,7 +403,6 @@ Array [
>
<svg
aria-hidden="true"
class=""
data-icon="smile"
fill="currentColor"
focusable="false"
@@ -446,7 +436,6 @@ Array [
>
<svg
aria-hidden="true"
class=""
data-icon="smile"
fill="currentColor"
focusable="false"
@@ -482,7 +471,6 @@ Array [
>
<svg
aria-hidden="true"
class=""
data-icon="smile"
fill="currentColor"
focusable="false"
@@ -518,7 +506,6 @@ Array [
>
<svg
aria-hidden="true"
class=""
data-icon="smile"
fill="currentColor"
focusable="false"
@@ -554,7 +541,6 @@ Array [
>
<svg
aria-hidden="true"
class=""
data-icon="smile"
fill="currentColor"
focusable="false"
@@ -675,7 +661,6 @@ Array [
>
<svg
aria-hidden="true"
class=""
data-icon="check-circle"
fill="currentColor"
focusable="false"
@@ -709,7 +694,6 @@ Array [
>
<svg
aria-hidden="true"
class=""
data-icon="info-circle"
fill="currentColor"
focusable="false"
@@ -743,7 +727,6 @@ Array [
>
<svg
aria-hidden="true"
class=""
data-icon="exclamation-circle"
fill="currentColor"
focusable="false"
@@ -776,7 +759,6 @@ Array [
>
<svg
aria-hidden="true"
class=""
data-icon="close"
fill="currentColor"
focusable="false"
@@ -803,7 +785,6 @@ Array [
>
<svg
aria-hidden="true"
class=""
data-icon="close-circle"
fill="currentColor"
focusable="false"
@@ -837,7 +818,6 @@ Array [
>
<svg
aria-hidden="true"
class=""
data-icon="check-circle"
fill="currentColor"
focusable="false"
@@ -876,7 +856,6 @@ Array [
>
<svg
aria-hidden="true"
class=""
data-icon="info-circle"
fill="currentColor"
focusable="false"
@@ -915,7 +894,6 @@ Array [
>
<svg
aria-hidden="true"
class=""
data-icon="exclamation-circle"
fill="currentColor"
focusable="false"
@@ -953,7 +931,6 @@ Array [
>
<svg
aria-hidden="true"
class=""
data-icon="close"
fill="currentColor"
focusable="false"
@@ -980,7 +957,6 @@ Array [
>
<svg
aria-hidden="true"
class=""
data-icon="close-circle"
fill="currentColor"
focusable="false"
@@ -1023,7 +999,6 @@ exports[`renders ./components/alert/demo/loop-banner.md correctly 1`] = `
>
<svg
aria-hidden="true"
class=""
data-icon="exclamation-circle"
fill="currentColor"
focusable="false"
@@ -1089,7 +1064,6 @@ exports[`renders ./components/alert/demo/smooth-closed.md correctly 1`] = `
>
<svg
aria-hidden="true"
class=""
data-icon="close"
fill="currentColor"
focusable="false"

View File

@@ -0,0 +1,5 @@
import { imageDemoTest } from '../../../tests/shared/imageTest';
describe('Alert image', () => {
imageDemoTest('alert');
});

View File

@@ -19,17 +19,17 @@ Alert component for feedback.
| afterClose | Called when close animation is finished | () => void | - |
| banner | Whether to show as banner | boolean | false |
| closable | Whether Alert can be closed | boolean | - |
| closeText | Close text to show | string \| ReactNode | - |
| description | Additional content of Alert | string \| ReactNode | - |
| closeText | Close text to show | ReactNode | - |
| description | Additional content of Alert | ReactNode | - |
| icon | Custom icon, effective when `showIcon` is true | ReactNode | - |
| message | Content of Alert | string \| ReactNode | - |
| message | Content of Alert | ReactNode | - |
| showIcon | Whether to show icon | boolean | false, in `banner` mode default is true |
| type | Type of Alert styles, options: `success`, `info`, `warning`, `error` | string | `info`, in `banner` mode default is `warning` |
| onClose | Callback when Alert is closed | (e: MouseEvent) => void | - |
### Alert.ErrorBoundary
| Property | Description | Type | Default | Version |
| ----------- | -------------------------------- | --------- | ----------------- | ------- |
| message | Custom error message to show | ReactNode | {{ error }} | |
| description | Custom error description to show | ReactNode | {{ error stack }} | |
| Property | Description | Type | Default | Version |
| --- | --- | --- | --- | --- |
| description | Custom error description to show | ReactNode | {{ error stack }} | |
| message | Custom error message to show | ReactNode | {{ error }} | |

View File

@@ -20,10 +20,10 @@ cover: https://gw.alipayobjects.com/zos/alicdn/8emPa3fjl/Alert.svg
| afterClose | 关闭动画结束后触发的回调函数 | () => void | - |
| banner | 是否用作顶部公告 | boolean | false |
| closable | 默认不显示关闭按钮 | boolean | - |
| closeText | 自定义关闭按钮 | string \| ReactNode | - |
| description | 警告提示的辅助性文字介绍 | string \| ReactNode | - |
| closeText | 自定义关闭按钮 | ReactNode | - |
| description | 警告提示的辅助性文字介绍 | ReactNode | - |
| icon | 自定义图标,`showIcon` 为 true 时有效 | ReactNode | - |
| message | 警告提示内容 | string \| ReactNode | - |
| message | 警告提示内容 | ReactNode | - |
| showIcon | 是否显示辅助图标 | boolean | false`banner` 模式下默认值为 true |
| type | 指定警告提示的样式,有四种选择 `success``info``warning``error` | string | `info``banner` 模式下默认值为 `warning` |
| onClose | 关闭时触发的回调函数 | (e: MouseEvent) => void | - |
@@ -32,5 +32,5 @@ cover: https://gw.alipayobjects.com/zos/alicdn/8emPa3fjl/Alert.svg
| 参数 | 说明 | 类型 | 默认值 | 版本 |
| --- | --- | --- | --- | --- |
| message | 自定义错误标题,如果未指定会展示原生报错信息 | ReactNode | {{ error }} | |
| description | 自定义错误内容,如果未指定会展示报错堆栈 | ReactNode | {{ error stack }} | |
| message | 自定义错误标题,如果未指定会展示原生报错信息 | ReactNode | {{ error }} | |

View File

@@ -1,8 +1,3 @@
@import '../../style/themes/index';
@import '../../style/mixins/index';
@alert-prefix-cls: ~'@{ant-prefix}-alert';
.@{alert-prefix-cls} {
&&-rtl {
padding: 8px 37px 8px 15px;

View File

@@ -1,5 +1,4 @@
import * as React from 'react';
import * as ReactDOM from 'react-dom';
import classNames from 'classnames';
import addEventListener from 'rc-util/lib/Dom/addEventListener';
import Affix from '../affix';
@@ -9,6 +8,8 @@ import scrollTo from '../_util/scrollTo';
import getScroll from '../_util/getScroll';
import AnchorContext from './context';
export type AnchorContainer = HTMLElement | Window;
function getDefaultContainer() {
return window;
}
@@ -38,8 +39,6 @@ type Section = {
top: number;
};
export type AnchorContainer = HTMLElement | Window;
export interface AnchorProps {
prefixCls?: string;
className?: string;
@@ -100,6 +99,8 @@ export default class Anchor extends React.Component<AnchorProps, AnchorState, Co
content: ConfigConsumerProps;
private wrapperRef = React.createRef<HTMLDivElement>();
private inkNode: HTMLSpanElement;
// scroll scope's container
@@ -253,9 +254,10 @@ export default class Anchor extends React.Component<AnchorProps, AnchorState, Co
};
updateInk = () => {
const { prefixCls } = this;
const anchorNode = ReactDOM.findDOMNode(this) as Element;
const linkNode = anchorNode.getElementsByClassName(`${prefixCls}-link-title-active`)[0];
const { prefixCls, wrapperRef } = this;
const anchorNode = wrapperRef.current;
const linkNode = anchorNode?.getElementsByClassName(`${prefixCls}-link-title-active`)[0];
if (linkNode) {
this.inkNode.style.top = `${(linkNode as any).offsetTop + linkNode.clientHeight / 2 - 4.5}px`;
}
@@ -286,9 +288,13 @@ export default class Anchor extends React.Component<AnchorProps, AnchorState, Co
visible: activeLink,
});
const wrapperClass = classNames(className, `${prefixCls}-wrapper`, {
[`${prefixCls}-rtl`]: direction === 'rtl',
});
const wrapperClass = classNames(
`${prefixCls}-wrapper`,
{
[`${prefixCls}-rtl`]: direction === 'rtl',
},
className,
);
const anchorClass = classNames(prefixCls, {
fixed: !affix && !showInkInFixed,
@@ -300,7 +306,7 @@ export default class Anchor extends React.Component<AnchorProps, AnchorState, Co
};
const anchorContent = (
<div className={wrapperClass} style={wrapperStyle}>
<div ref={this.wrapperRef} className={wrapperClass} style={wrapperStyle}>
<div className={anchorClass}>
<div className={`${prefixCls}-ink`}>
<span className={inkClass} ref={this.saveInkNode} />

View File

@@ -51,9 +51,13 @@ class AnchorLink extends React.Component<AnchorLinkProps, any, AntAnchor> {
const { prefixCls: customizePrefixCls, href, title, children, className, target } = this.props;
const prefixCls = getPrefixCls('anchor', customizePrefixCls);
const active = this.context.activeLink === href;
const wrapperClassName = classNames(className, `${prefixCls}-link`, {
[`${prefixCls}-link-active`]: active,
});
const wrapperClassName = classNames(
`${prefixCls}-link`,
{
[`${prefixCls}-link-active`]: active,
},
className,
);
const titleClassName = classNames(`${prefixCls}-link-title`, {
[`${prefixCls}-link-title-active`]: active,
});

View File

@@ -41,18 +41,6 @@ exports[`renders ./components/anchor/demo/basic.md correctly 1`] = `
Static demo
</a>
</div>
<div
class="ant-anchor-link"
>
<a
class="ant-anchor-link-title"
href="#components-anchor-demo-basic"
target="_blank"
title="Basic demo with Target"
>
Basic demo with Target
</a>
</div>
<div
class="ant-anchor-link"
>

View File

@@ -0,0 +1,5 @@
import { imageDemoTest } from '../../../tests/shared/imageTest';
describe('Anchor image', () => {
imageDemoTest('anchor');
});

View File

@@ -22,7 +22,6 @@ ReactDOM.render(
<Anchor>
<Link href="#components-anchor-demo-basic" title="Basic demo" />
<Link href="#components-anchor-demo-static" title="Static demo" />
<Link href="#components-anchor-demo-basic" title="Basic demo with Target" target="_blank" />
<Link href="#API" title="API">
<Link href="#Anchor-Props" title="Anchor Props" />
<Link href="#Link-Props" title="Link Props" />

View File

@@ -19,14 +19,14 @@ import { Anchor } from 'antd';
const { Link } = Anchor;
const handleClick = (
e: React.MouseEvent<HTMLElement>,
link: {
title: React.ReactNode;
href: string;
},
) => {
e.preventDefault();
console.log(link);
e: React.MouseEvent<HTMLElement>,
link: {
title: React.ReactNode;
href: string;
},
) => {
e.preventDefault();
console.log(link);
};
ReactDOM.render(

View File

@@ -21,18 +21,17 @@ For displaying anchor hyperlinks on page and jumping between them.
| affix | Fixed mode of Anchor | boolean | true | |
| bounds | Bounding distance of anchor area | number | 5 | |
| getContainer | Scrolling container | () => HTMLElement | () => window | |
| offsetBottom | Pixels to offset from bottom when calculating position of scroll | number | - | |
| offsetTop | Pixels to offset from top when calculating position of scroll | number | 0 | |
| showInkInFixed | Whether show ink-balls in Fixed mode | boolean | false | |
| onClick | Set the handler to handle `click` event | function(e: Event, link: Object) | - | |
| getCurrentAnchor | Customize the anchor highlight | () => string | - | |
| offsetTop | Pixels to offset from top when calculating position of scroll | number | 0 | |
| showInkInFixed | Whether show ink-balls when `affix={false}` | boolean | false | |
| targetOffset | Anchor scroll offset, default as `offsetTop`, [example](#components-anchor-demo-targetOffset) | number | - | |
| onChange | Listening for anchor link change | (currentActiveLink: string) => void | | |
| onClick | Set the handler to handle `click` event | function(e: Event, link: Object) | - | |
### Link Props
| Property | Description | Type | Default | Version |
| -------- | ----------------------------------------- | ------------------- | ------- | ------- |
| href | The target of hyperlink | string | | |
| title | The content of hyperlink | string \| ReactNode | | |
| target | Specifies where to display the linked URL | string | | |
| Property | Description | Type | Default | Version |
| --- | --- | --- | --- | --- |
| href | The target of hyperlink | string | | |
| target | Specifies where to display the linked URL | string | | |
| title | The content of hyperlink | ReactNode | | |

View File

@@ -22,18 +22,17 @@ cover: https://gw.alipayobjects.com/zos/alicdn/_1-C1JwsC/Anchor.svg
| affix | 固定模式 | boolean | true | |
| bounds | 锚点区域边界 | number | 5 | |
| getContainer | 指定滚动的容器 | () => HTMLElement | () => window | |
| offsetBottom | 距离窗口底部达到指定偏移量后触发 | number | | |
| offsetTop | 距离窗口顶部达到指定偏移量后触发 | number | | |
| showInkInFixed | 固定模式是否显示小圆点 | boolean | false | |
| onClick | `click` 事件的 handler | function(e: Event, link: Object) | - | |
| getCurrentAnchor | 自定义高亮的锚点 | () => string | - | |
| offsetTop | 距离窗口顶部达到指定偏移量后触发 | number | | |
| showInkInFixed | `affix={false}` 时是否显示小圆点 | boolean | false | |
| targetOffset | 锚点滚动偏移量,默认与 offsetTop 相同,[例子](#components-anchor-demo-targetOffset) | number | - | |
| onChange | 监听锚点链接改变 | (currentActiveLink: string) => void | - | |
| onClick | `click` 事件的 handler | function(e: Event, link: Object) | - | |
### Link Props
| 成员 | 说明 | 类型 | 默认值 | 版本 |
| ------ | -------------------------------- | ------------------- | ------ | ---- |
| href | 锚点链接 | string | - | |
| title | 文字内容 | string \| ReactNode | - | |
| target | 该属性指定在何处显示链接的资源。 | string | - | |
| 成员 | 说明 | 类型 | 默认值 | 版本 |
| --- | --- | --- | --- | --- |
| href | 锚点链接 | string | - | |
| target | 该属性指定在何处显示链接的资源。 | string | - | |
| title | 文字内容 | ReactNode | - | |

View File

@@ -1,8 +1,3 @@
@import '../../style/themes/index';
@import '../../style/mixins/index';
@anchor-border-width: 2px;
.@{ant-prefix}-anchor {
&-rtl {
direction: rtl;

View File

@@ -21,6 +21,7 @@ Array [
autocomplete="off"
class="ant-select-selection-search-input"
role="combobox"
type="search"
value=""
/>
</span>
@@ -52,6 +53,7 @@ Array [
autocomplete="off"
class="ant-select-selection-search-input"
role="combobox"
type="search"
value=""
/>
</span>
@@ -77,44 +79,51 @@ exports[`renders ./components/auto-complete/demo/certain-category.md correctly 1
class="ant-select-selection-search"
>
<span
class="ant-input-search ant-select-selection-search-input ant-input-affix-wrapper ant-input-affix-wrapper-lg"
class="ant-input-group-wrapper ant-input-group-wrapper-lg ant-input-search ant-input-search-large ant-select-selection-search-input"
>
<input
aria-activedescendant="undefined_list_0"
aria-autocomplete="list"
aria-controls="undefined_list"
aria-haspopup="listbox"
aria-owns="undefined_list"
autocomplete="off"
class="ant-input ant-input-lg"
placeholder="input here"
role="combobox"
type="text"
value=""
/>
<span
class="ant-input-suffix"
class="ant-input-wrapper ant-input-group"
>
<input
aria-activedescendant="undefined_list_0"
aria-autocomplete="list"
aria-controls="undefined_list"
aria-haspopup="listbox"
aria-owns="undefined_list"
autocomplete="off"
class="ant-input ant-input-lg"
placeholder="input here"
role="combobox"
type="search"
value=""
/>
<span
aria-label="search"
class="anticon anticon-search ant-input-search-icon"
role="img"
tabindex="-1"
class="ant-input-group-addon"
>
<svg
aria-hidden="true"
class=""
data-icon="search"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
<button
class="ant-btn ant-btn-lg ant-btn-icon-only ant-input-search-button"
type="button"
>
<path
d="M909.6 854.5L649.9 594.8C690.2 542.7 712 479 712 412c0-80.2-31.3-155.4-87.9-212.1-56.6-56.7-132-87.9-212.1-87.9s-155.5 31.3-212.1 87.9C143.2 256.5 112 331.8 112 412c0 80.1 31.3 155.5 87.9 212.1C256.5 680.8 331.8 712 412 712c67 0 130.6-21.8 182.7-62l259.7 259.6a8.2 8.2 0 0011.6 0l43.6-43.5a8.2 8.2 0 000-11.6zM570.4 570.4C528 612.7 471.8 636 412 636s-116-23.3-158.4-65.6C211.3 528 188 471.8 188 412s23.3-116.1 65.6-158.4C296 211.3 352.2 188 412 188s116.1 23.2 158.4 65.6S636 352.2 636 412s-23.3 116.1-65.6 158.4z"
/>
</svg>
<span
aria-label="search"
class="anticon anticon-search"
role="img"
>
<svg
aria-hidden="true"
data-icon="search"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M909.6 854.5L649.9 594.8C690.2 542.7 712 479 712 412c0-80.2-31.3-155.4-87.9-212.1-56.6-56.7-132-87.9-212.1-87.9s-155.5 31.3-212.1 87.9C143.2 256.5 112 331.8 112 412c0 80.1 31.3 155.5 87.9 212.1C256.5 680.8 331.8 712 412 712c67 0 130.6-21.8 182.7-62l259.7 259.6a8.2 8.2 0 0011.6 0l43.6-43.5a8.2 8.2 0 000-11.6zM570.4 570.4C528 612.7 471.8 636 412 636s-116-23.3-158.4-65.6C211.3 528 188 471.8 188 412s23.3-116.1 65.6-158.4C296 211.3 352.2 188 412 188s116.1 23.2 158.4 65.6S636 352.2 636 412s-23.3 116.1-65.6 158.4z"
/>
</svg>
</span>
</button>
</span>
</span>
</span>
@@ -148,6 +157,7 @@ exports[`renders ./components/auto-complete/demo/custom.md correctly 1`] = `
placeholder="input here"
role="combobox"
style="height:50px"
type="search"
/>
</span>
<span
@@ -202,6 +212,7 @@ exports[`renders ./components/auto-complete/demo/form-debug.md correctly 1`] = `
autocomplete="off"
class="ant-select-selection-search-input"
role="combobox"
type="search"
value=""
/>
</span>
@@ -256,6 +267,7 @@ exports[`renders ./components/auto-complete/demo/form-debug.md correctly 1`] = `
readonly=""
role="combobox"
style="opacity:0"
type="search"
unselectable="on"
value=""
/>
@@ -277,7 +289,6 @@ exports[`renders ./components/auto-complete/demo/form-debug.md correctly 1`] = `
>
<svg
aria-hidden="true"
class=""
data-icon="down"
fill="currentColor"
focusable="false"
@@ -342,6 +353,7 @@ exports[`renders ./components/auto-complete/demo/form-debug.md correctly 1`] = `
readonly=""
role="combobox"
style="opacity:0"
type="search"
unselectable="on"
value=""
/>
@@ -363,7 +375,6 @@ exports[`renders ./components/auto-complete/demo/form-debug.md correctly 1`] = `
>
<svg
aria-hidden="true"
class=""
data-icon="down"
fill="currentColor"
focusable="false"
@@ -396,6 +407,7 @@ exports[`renders ./components/auto-complete/demo/form-debug.md correctly 1`] = `
autocomplete="off"
class="ant-select-selection-search-input"
role="combobox"
type="search"
value=""
/>
</span>
@@ -441,7 +453,7 @@ exports[`renders ./components/auto-complete/demo/form-debug.md correctly 1`] = `
class="ant-select-selection-search"
>
<span
class="ant-select-selection-search-input ant-input-affix-wrapper"
class="ant-input-affix-wrapper ant-select-selection-search-input"
>
<input
aria-activedescendant="undefined_list_0"
@@ -452,7 +464,7 @@ exports[`renders ./components/auto-complete/demo/form-debug.md correctly 1`] = `
autocomplete="off"
class="ant-input"
role="combobox"
type="text"
type="search"
value=""
/>
<span
@@ -465,7 +477,6 @@ exports[`renders ./components/auto-complete/demo/form-debug.md correctly 1`] = `
>
<svg
aria-hidden="true"
class=""
data-icon="search"
fill="currentColor"
focusable="false"
@@ -536,6 +547,7 @@ exports[`renders ./components/auto-complete/demo/form-debug.md correctly 1`] = `
readonly=""
role="combobox"
style="opacity:0"
type="search"
unselectable="on"
value=""
/>
@@ -557,7 +569,6 @@ exports[`renders ./components/auto-complete/demo/form-debug.md correctly 1`] = `
>
<svg
aria-hidden="true"
class=""
data-icon="down"
fill="currentColor"
focusable="false"
@@ -582,7 +593,7 @@ exports[`renders ./components/auto-complete/demo/form-debug.md correctly 1`] = `
class="ant-select-selection-search"
>
<span
class="ant-select-selection-search-input ant-input-affix-wrapper"
class="ant-input-affix-wrapper ant-select-selection-search-input"
>
<input
aria-activedescendant="undefined_list_0"
@@ -593,7 +604,7 @@ exports[`renders ./components/auto-complete/demo/form-debug.md correctly 1`] = `
autocomplete="off"
class="ant-input"
role="combobox"
type="text"
type="search"
value=""
/>
<span
@@ -606,7 +617,6 @@ exports[`renders ./components/auto-complete/demo/form-debug.md correctly 1`] = `
>
<svg
aria-hidden="true"
class=""
data-icon="search"
fill="currentColor"
focusable="false"
@@ -678,6 +688,7 @@ exports[`renders ./components/auto-complete/demo/form-debug.md correctly 1`] = `
readonly=""
role="combobox"
style="opacity:0"
type="search"
unselectable="on"
value=""
/>
@@ -699,7 +710,6 @@ exports[`renders ./components/auto-complete/demo/form-debug.md correctly 1`] = `
>
<svg
aria-hidden="true"
class=""
data-icon="down"
fill="currentColor"
focusable="false"
@@ -724,43 +734,50 @@ exports[`renders ./components/auto-complete/demo/form-debug.md correctly 1`] = `
class="ant-select-selection-search"
>
<span
class="ant-input-search ant-select-selection-search-input ant-input-affix-wrapper"
class="ant-input-group-wrapper ant-input-search ant-select-selection-search-input"
>
<input
aria-activedescendant="undefined_list_0"
aria-autocomplete="list"
aria-controls="undefined_list"
aria-haspopup="listbox"
aria-owns="undefined_list"
autocomplete="off"
class="ant-input"
role="combobox"
type="text"
value=""
/>
<span
class="ant-input-suffix"
class="ant-input-wrapper ant-input-group"
>
<input
aria-activedescendant="undefined_list_0"
aria-autocomplete="list"
aria-controls="undefined_list"
aria-haspopup="listbox"
aria-owns="undefined_list"
autocomplete="off"
class="ant-input"
role="combobox"
type="search"
value=""
/>
<span
aria-label="search"
class="anticon anticon-search ant-input-search-icon"
role="img"
tabindex="-1"
class="ant-input-group-addon"
>
<svg
aria-hidden="true"
class=""
data-icon="search"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
<button
class="ant-btn ant-btn-icon-only ant-input-search-button"
type="button"
>
<path
d="M909.6 854.5L649.9 594.8C690.2 542.7 712 479 712 412c0-80.2-31.3-155.4-87.9-212.1-56.6-56.7-132-87.9-212.1-87.9s-155.5 31.3-212.1 87.9C143.2 256.5 112 331.8 112 412c0 80.1 31.3 155.5 87.9 212.1C256.5 680.8 331.8 712 412 712c67 0 130.6-21.8 182.7-62l259.7 259.6a8.2 8.2 0 0011.6 0l43.6-43.5a8.2 8.2 0 000-11.6zM570.4 570.4C528 612.7 471.8 636 412 636s-116-23.3-158.4-65.6C211.3 528 188 471.8 188 412s23.3-116.1 65.6-158.4C296 211.3 352.2 188 412 188s116.1 23.2 158.4 65.6S636 352.2 636 412s-23.3 116.1-65.6 158.4z"
/>
</svg>
<span
aria-label="search"
class="anticon anticon-search"
role="img"
>
<svg
aria-hidden="true"
data-icon="search"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M909.6 854.5L649.9 594.8C690.2 542.7 712 479 712 412c0-80.2-31.3-155.4-87.9-212.1-56.6-56.7-132-87.9-212.1-87.9s-155.5 31.3-212.1 87.9C143.2 256.5 112 331.8 112 412c0 80.1 31.3 155.5 87.9 212.1C256.5 680.8 331.8 712 412 712c67 0 130.6-21.8 182.7-62l259.7 259.6a8.2 8.2 0 0011.6 0l43.6-43.5a8.2 8.2 0 000-11.6zM570.4 570.4C528 612.7 471.8 636 412 636s-116-23.3-158.4-65.6C211.3 528 188 471.8 188 412s23.3-116.1 65.6-158.4C296 211.3 352.2 188 412 188s116.1 23.2 158.4 65.6S636 352.2 636 412s-23.3 116.1-65.6 158.4z"
/>
</svg>
</span>
</button>
</span>
</span>
</span>
@@ -821,6 +838,7 @@ exports[`renders ./components/auto-complete/demo/form-debug.md correctly 1`] = `
readonly=""
role="combobox"
style="opacity:0"
type="search"
unselectable="on"
value=""
/>
@@ -842,7 +860,6 @@ exports[`renders ./components/auto-complete/demo/form-debug.md correctly 1`] = `
>
<svg
aria-hidden="true"
class=""
data-icon="down"
fill="currentColor"
focusable="false"
@@ -867,43 +884,50 @@ exports[`renders ./components/auto-complete/demo/form-debug.md correctly 1`] = `
class="ant-select-selection-search"
>
<span
class="ant-input-search ant-select-selection-search-input ant-input-affix-wrapper"
class="ant-input-group-wrapper ant-input-search ant-select-selection-search-input"
>
<input
aria-activedescendant="undefined_list_0"
aria-autocomplete="list"
aria-controls="undefined_list"
aria-haspopup="listbox"
aria-owns="undefined_list"
autocomplete="off"
class="ant-input"
role="combobox"
type="text"
value=""
/>
<span
class="ant-input-suffix"
class="ant-input-wrapper ant-input-group"
>
<input
aria-activedescendant="undefined_list_0"
aria-autocomplete="list"
aria-controls="undefined_list"
aria-haspopup="listbox"
aria-owns="undefined_list"
autocomplete="off"
class="ant-input"
role="combobox"
type="search"
value=""
/>
<span
aria-label="search"
class="anticon anticon-search ant-input-search-icon"
role="img"
tabindex="-1"
class="ant-input-group-addon"
>
<svg
aria-hidden="true"
class=""
data-icon="search"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
<button
class="ant-btn ant-btn-icon-only ant-input-search-button"
type="button"
>
<path
d="M909.6 854.5L649.9 594.8C690.2 542.7 712 479 712 412c0-80.2-31.3-155.4-87.9-212.1-56.6-56.7-132-87.9-212.1-87.9s-155.5 31.3-212.1 87.9C143.2 256.5 112 331.8 112 412c0 80.1 31.3 155.5 87.9 212.1C256.5 680.8 331.8 712 412 712c67 0 130.6-21.8 182.7-62l259.7 259.6a8.2 8.2 0 0011.6 0l43.6-43.5a8.2 8.2 0 000-11.6zM570.4 570.4C528 612.7 471.8 636 412 636s-116-23.3-158.4-65.6C211.3 528 188 471.8 188 412s23.3-116.1 65.6-158.4C296 211.3 352.2 188 412 188s116.1 23.2 158.4 65.6S636 352.2 636 412s-23.3 116.1-65.6 158.4z"
/>
</svg>
<span
aria-label="search"
class="anticon anticon-search"
role="img"
>
<svg
aria-hidden="true"
data-icon="search"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M909.6 854.5L649.9 594.8C690.2 542.7 712 479 712 412c0-80.2-31.3-155.4-87.9-212.1-56.6-56.7-132-87.9-212.1-87.9s-155.5 31.3-212.1 87.9C143.2 256.5 112 331.8 112 412c0 80.1 31.3 155.5 87.9 212.1C256.5 680.8 331.8 712 412 712c67 0 130.6-21.8 182.7-62l259.7 259.6a8.2 8.2 0 0011.6 0l43.6-43.5a8.2 8.2 0 000-11.6zM570.4 570.4C528 612.7 471.8 636 412 636s-116-23.3-158.4-65.6C211.3 528 188 471.8 188 412s23.3-116.1 65.6-158.4C296 211.3 352.2 188 412 188s116.1 23.2 158.4 65.6S636 352.2 636 412s-23.3 116.1-65.6 158.4z"
/>
</svg>
</span>
</button>
</span>
</span>
</span>
@@ -924,7 +948,6 @@ exports[`renders ./components/auto-complete/demo/form-debug.md correctly 1`] = `
>
<svg
aria-hidden="true"
class=""
data-icon="search"
fill="currentColor"
focusable="false"
@@ -969,6 +992,7 @@ exports[`renders ./components/auto-complete/demo/non-case-sensitive.md correctly
autocomplete="off"
class="ant-select-selection-search-input"
role="combobox"
type="search"
value=""
/>
</span>
@@ -1001,6 +1025,7 @@ exports[`renders ./components/auto-complete/demo/options.md correctly 1`] = `
autocomplete="off"
class="ant-select-selection-search-input"
role="combobox"
type="search"
value=""
/>
</span>
@@ -1025,7 +1050,7 @@ exports[`renders ./components/auto-complete/demo/uncertain-category.md correctly
class="ant-select-selection-search"
>
<span
class="ant-input-search ant-select-selection-search-input ant-input-search-enter-button ant-input-search-large ant-input-group-wrapper ant-input-group-wrapper-lg"
class="ant-input-group-wrapper ant-input-group-wrapper-lg ant-input-search ant-input-search-large ant-input-search-with-button ant-select-selection-search-input"
>
<span
class="ant-input-wrapper ant-input-group"
@@ -1040,14 +1065,14 @@ exports[`renders ./components/auto-complete/demo/uncertain-category.md correctly
class="ant-input ant-input-lg"
placeholder="input here"
role="combobox"
type="text"
type="search"
value=""
/>
<span
class="ant-input-group-addon"
>
<button
class="ant-btn ant-input-search-button ant-btn-primary ant-btn-lg"
class="ant-btn ant-btn-primary ant-btn-lg ant-input-search-button"
type="button"
>
<span
@@ -1057,7 +1082,6 @@ exports[`renders ./components/auto-complete/demo/uncertain-category.md correctly
>
<svg
aria-hidden="true"
class=""
data-icon="search"
fill="currentColor"
focusable="false"

View File

@@ -20,6 +20,7 @@ exports[`AutoComplete legacy dataSource should accept react element option 1`] =
autocomplete="off"
class="ant-select-selection-search-input"
role="combobox"
type="search"
value=""
/>
</span>
@@ -63,6 +64,7 @@ exports[`AutoComplete legacy dataSource should accept react element option 1`] =
<div
aria-selected="false"
class="ant-select-item ant-select-item-option ant-select-item-option-active"
title="ReactNode"
>
<div
class="ant-select-item-option-content"
@@ -88,7 +90,7 @@ exports[`AutoComplete legacy dataSource should accept react element option 1`] =
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"
class="ant-select ant-select-rtl ant-select-auto-complete ant-select-single ant-select-show-search"
>
<div
class="ant-select-selector"
@@ -105,6 +107,7 @@ exports[`AutoComplete rtl render component should be rendered correctly in RTL d
autocomplete="off"
class="ant-select-selection-search-input"
role="combobox"
type="search"
value=""
/>
</span>

View File

@@ -24,10 +24,7 @@ describe('AutoComplete children could be focus', () => {
it('focus() and onFocus', () => {
const handleFocus = jest.fn();
const wrapper = mount(<AutoComplete onFocus={handleFocus} />, { attachTo: container });
wrapper
.find('input')
.instance()
.focus();
wrapper.find('input').instance().focus();
jest.runAllTimers();
expect(handleFocus).toHaveBeenCalled();
});
@@ -35,15 +32,9 @@ describe('AutoComplete children could be focus', () => {
it('blur() and onBlur', () => {
const handleBlur = jest.fn();
const wrapper = mount(<AutoComplete onBlur={handleBlur} />, { attachTo: container });
wrapper
.find('input')
.instance()
.focus();
wrapper.find('input').instance().focus();
jest.runAllTimers();
wrapper
.find('input')
.instance()
.blur();
wrapper.find('input').instance().blur();
jest.runAllTimers();
expect(handleBlur).toHaveBeenCalled();
});

View File

@@ -0,0 +1,5 @@
import { imageDemoTest } from '../../../tests/shared/imageTest';
describe('AutoComplete image', () => {
imageDemoTest('auto-complete');
});

View File

@@ -69,4 +69,13 @@ describe('AutoComplete', () => {
wrapper.find('input').simulate('change', { target: { value: '1' } });
expect(wrapper.find('.ant-select-item-option').length).toBe(2);
});
it('should not warning when getInputElement is null', () => {
jest.spyOn(console, 'warn').mockImplementation(() => undefined);
mount(<AutoComplete placeholder="input here" allowClear />);
// eslint-disable-next-line no-console
expect(console.warn).not.toBeCalled();
// eslint-disable-next-line no-console
console.warn.mockRestore();
});
});

View File

@@ -7,7 +7,7 @@ title:
## zh-CN
基本使用通过 options 设置自动完成的数据源
基本使用通过 `options` 设置自动完成的数据源
## en-US

View File

@@ -22,27 +22,30 @@ When there is a need for autocomplete functionality.
| children (for customize input element) | Customize input element | HTMLInputElement \| HTMLTextAreaElement \| React.ReactElement&lt;InputProps> | &lt;Input /> | |
| children (for dataSource) | Data source to auto complete | React.ReactElement&lt;OptionProps> \| Array&lt;React.ReactElement&lt;OptionProps>> | - | |
| defaultActiveFirstOption | Whether active first option by default | boolean | true | |
| defaultOpen | Initial open state of dropdown | boolean | - | |
| defaultValue | Initial selected option | string | - | |
| disabled | Whether disabled select | boolean | false | |
| dropdownClassName | The className of dropdown menu | string | - | |
| dropdownMatchSelectWidth | Determine whether the dropdown menu and the select input are the same width. Default set `min-width` same as input. Will ignore when value less than select width. `false` will disable virtual scroll | boolean \| number | true | |
| filterOption | If true, filter options by input, if function, filter options against it. The function will receive two arguments, `inputValue` and `option`, if the function returns true, the option will be included in the filtered set; Otherwise, it will be excluded | boolean \| function(inputValue, option) | true | |
| notFoundContent | Specify content to show when no result matches | string | `Not Found` | |
| open | Controlled open state of dropdown | boolean | - | |
| options | Select options. Will get better perf than jsx definition | { label, value }\[] | - | |
| placeholder | The placeholder of input | string | - | |
| value | Selected option | string | - | |
| onBlur | Called when leaving the component | function() | - | |
| onChange | Called when select an option or input value change, or value of input is changed | function(value) | - | |
| onDropdownVisibleChange | Call when dropdown open | function(open) | - | |
| onFocus | Called when entering the component | function() | - | |
| onSearch | Called when searching items | function(value) | - | |
| onSelect | Called when a option is selected. param is option's value and option instance | function(value, option) | - | |
| 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
| Name | Description | Version |
| ------- | ------------ | ------- |
| blur() | Remove focus | |
| focus() | Get focus | |
| Name | Description | Version |
| --- | --- | --- |
| blur() | Remove focus | |
| focus() | Get focus | |
## FAQ
@@ -55,3 +58,25 @@ Related issue: [#18230](https://github.com/ant-design/ant-design/issues/18230) [
### Part of api from v3 not available in v4?
AutoComplete is a Input component support auto complete tips which should not support `labelInValue` prop to modify dispaly value in input. In v3, AutoComplete realization can not handle case that user type match of both `value` & `label` are the same. v4 not longer support `label` as the value input.
Besides, to unique API, `dataSource` replaced with `options`:
#### v3
```tsx
dataSource = ['light', 'bamboo'];
// or
dataSource = [
{ value: 'light', text: 'Light' },
{ value: 'bamboo', text: 'Bamboo' },
];
```
#### v4
```tsx
options = [
{ value: 'light', label: 'Light' },
{ value: 'bamboo', label: 'Bamboo' },
];
```

View File

@@ -7,18 +7,15 @@
import * as React from 'react';
import toArray from 'rc-util/lib/Children/toArray';
import { SelectProps as RcSelectProps } from 'rc-select';
import classNames from 'classnames';
import omit from 'omit.js';
import Select, { InternalSelectProps, OptionType } from '../select';
import Select, { InternalSelectProps, OptionType, RefSelectProps } from '../select';
import { ConfigConsumer, ConfigConsumerProps } from '../config-provider';
import devWarning from '../_util/devWarning';
import { isValidElement } from '../_util/reactNode';
const { Option } = Select;
const InternalSelect = Select as React.ComponentClass<RcSelectProps>;
export interface DataSourceItemObject {
value: string;
text: string;
@@ -37,16 +34,15 @@ function isSelectOptionOrSelectOptGroup(child: any): Boolean {
return child && child.type && (child.type.isSelectOption || child.type.isSelectOptGroup);
}
const AutoComplete: React.ForwardRefRenderFunction<Select, AutoCompleteProps> = (props, ref) => {
const AutoComplete: React.ForwardRefRenderFunction<RefSelectProps, AutoCompleteProps> = (
props,
ref,
) => {
const { prefixCls: customizePrefixCls, className, children, dataSource } = props;
const childNodes: React.ReactElement[] = toArray(children);
const selectRef = React.useRef<Select>();
React.useImperativeHandle<Select, Select>(ref, () => selectRef.current!);
// ============================= Input =============================
let customizeInput: React.ReactElement;
let customizeInput: React.ReactElement | undefined;
if (
childNodes.length === 1 &&
@@ -56,7 +52,7 @@ const AutoComplete: React.ForwardRefRenderFunction<Select, AutoCompleteProps> =
[customizeInput] = childNodes;
}
const getInputElement = (): React.ReactElement => customizeInput;
const getInputElement = customizeInput ? (): React.ReactElement => customizeInput! : undefined;
// ============================ Options ============================
let optionChildren: React.ReactNode;
@@ -113,28 +109,28 @@ const AutoComplete: React.ForwardRefRenderFunction<Select, AutoCompleteProps> =
const prefixCls = getPrefixCls('select', customizePrefixCls);
return (
<InternalSelect
ref={selectRef as any}
<Select
ref={ref}
{...omit(props, ['dataSource'])}
prefixCls={prefixCls}
className={classNames(className, `${prefixCls}-auto-complete`)}
className={classNames(`${prefixCls}-auto-complete`, className)}
mode={Select.SECRET_COMBOBOX_MODE_DO_NOT_USE as any}
getInputElement={getInputElement}
>
{optionChildren}
</InternalSelect>
</Select>
);
}}
</ConfigConsumer>
);
};
const RefAutoComplete = React.forwardRef<Select, AutoCompleteProps>(AutoComplete);
const RefAutoComplete = React.forwardRef<RefSelectProps, AutoCompleteProps>(AutoComplete);
type RefAutoComplete = typeof RefAutoComplete & {
type RefAutoCompleteWithOption = typeof RefAutoComplete & {
Option: OptionType;
};
(RefAutoComplete as RefAutoComplete).Option = Option;
(RefAutoComplete as RefAutoCompleteWithOption).Option = Option;
export default RefAutoComplete as RefAutoComplete;
export default RefAutoComplete as RefAutoCompleteWithOption;

View File

@@ -11,7 +11,13 @@ cover: https://gw.alipayobjects.com/zos/alicdn/qtJm4yt45/AutoComplete.svg
## 何时使用
需要自动完成时
- 需要一个输入框而不是选择器
- 需要输入建议/辅助提示。
和 Select 的区别是:
- AutoComplete 是一个带提示的文本输入框,用户可以自由输入,关键词是辅助**输入**。
- Select 是在限定的可选项中进行选择,关键词是**选择**。
## API
@@ -20,31 +26,34 @@ cover: https://gw.alipayobjects.com/zos/alicdn/qtJm4yt45/AutoComplete.svg
| allowClear | 支持清除, 单选模式有效 | boolean | false | |
| autoFocus | 自动获取焦点 | boolean | false | |
| backfill | 使用键盘选择选项的时候把选中项回填到输入框中 | boolean | false | |
| children (自定义输入框) | 自定义输入框 | HTMLInputElement \| HTMLTextAreaElement \| React.ReactElement&lt;InputProps> | &lt;Input /> | |
| children (自动完成的数据源) | 自动完成的数据源 | React.ReactElement&lt;OptionProps> \| Array&lt;React.ReactElement&lt;OptionProps>> | - | |
| children (自定义输入框) | 自定义输入框 | HTMLInputElement \| HTMLTextAreaElement \| React.ReactElement&lt;InputProps> | &lt;Input /> | |
| defaultActiveFirstOption | 是否默认高亮第一个选项 | boolean | true | |
| defaultOpen | 是否默认展开下拉菜单 | boolean | - | |
| defaultValue | 指定默认选中的条目 | string | - | |
| disabled | 是否禁用 | boolean | false | |
| dropdownClassName | 下拉菜单的 className 属性 | string | - | |
| dropdownMatchSelectWidth | 下拉菜单和选择器同宽。默认将设置 `min-width`当值小于选择框宽度时会被忽略。false 时会关闭虚拟滚动 | boolean \| number | true | |
| filterOption | 是否根据输入项进行筛选。当其为一个函数时,会接收 `inputValue` `option` 两个参数,当 `option` 符合筛选条件时,应返回 true反之则返回 false | boolean \| function(inputValue, option) | true | |
| getPopupContainer | 菜单渲染父节点。默认渲染到 body 上,如果你遇到菜单滚动定位问题,试试修改为滚动的区域,并相对其定位。[示例](https://codesandbox.io/s/4j168r7jw0) | function(triggerNode) | () => document.body | |
| notFoundContent | 当下拉列表为空时显示的内容 | ReactNode | - | |
| open | 是否展开下拉菜单 | boolean | - | |
| options | 数据化配置选项内容,相比 jsx 定义会获得更好的渲染性能 | { label, value }\[] | - | |
| placeholder | 输入框提示 | string | - | |
| value | 指定当前选中的条目 | string | - | |
| onBlur | 失去焦点时的回调 | function() | - | |
| onChange | 选中 option或 input 的 value 变化时,调用此函数 | function(value) | - | |
| onDropdownVisibleChange | 展开下拉菜单的回调 | function(open) | - | |
| onFocus | 获得焦点时的回调 | function() | - | |
| onSearch | 搜索补全项的时候调用 | function(value) | - | |
| onSelect | 被选中时调用,参数为选中项的 value 值 | function(value, option) | - | |
| defaultOpen | 是否默认展开下拉菜单 | boolean | - | |
| open | 是否展开下拉菜单 | boolean | - | |
| onDropdownVisibleChange | 展开下拉菜单的回调 | function(open) | - | |
| notFoundContent | 当下拉列表为空时显示的内容 | ReactNode | - | |
## 方法
| 名称 | 描述 | 版本 |
| ------- | -------- | ---- |
| blur() | 移除焦点 | |
| focus() | 获取焦点 | |
| 名称 | 描述 | 版本 |
| --- | --- | --- |
| blur() | 移除焦点 | |
| focus() | 获取焦点 | |
## FAQ
@@ -57,3 +66,25 @@ cover: https://gw.alipayobjects.com/zos/alicdn/qtJm4yt45/AutoComplete.svg
### v3 的部分属性为何在 v4 中没有了?
AutoComplete 组件是一个支持自动提示的 Input 组件,因而其不具有 `labelInValue` 等影响 value 展示的属性。在 v3 版本AutoComplete 实现存在输入值如果遇到 `value``label` 相同时无法映射的问题。 v4 中不再支持 `label` 为值的输入形态。
此外为了统一 API`dataSource` 改为 `options` 你可以如下转换:
#### v3
```tsx
dataSource = ['light', 'bamboo'];
// or
dataSource = [
{ value: 'light', text: 'Light' },
{ value: 'bamboo', text: 'Bamboo' },
];
```
#### v4
```tsx
options = [
{ value: 'light', label: 'Light' },
{ value: 'bamboo', label: 'Bamboo' },
];
```

View File

@@ -0,0 +1,20 @@
import * as React from 'react';
import { ScreenSizeMap } from '../_util/responsiveObserve';
export type AvatarSize = 'large' | 'small' | 'default' | number | ScreenSizeMap;
const SizeContext = React.createContext<AvatarSize>('default');
export interface SizeContextProps {
size?: AvatarSize;
}
export const SizeContextProvider: React.FC<SizeContextProps> = ({ children, size }) => (
<SizeContext.Consumer>
{originSize => (
<SizeContext.Provider value={size || originSize}>{children}</SizeContext.Provider>
)}
</SizeContext.Consumer>
);
export default SizeContext;

View File

@@ -1,13 +1,19 @@
import React from 'react';
import ReactDOM from 'react-dom';
import { act } from 'react-dom/test-utils';
import { mount } from 'enzyme';
import Avatar from '..';
import mountTest from '../../../tests/shared/mountTest';
import rtlTest from '../../../tests/shared/rtlTest';
import useBreakpoint from '../../grid/hooks/useBreakpoint';
jest.mock('../../grid/hooks/useBreakpoint');
describe('Avatar Render', () => {
mountTest(Avatar);
rtlTest(Avatar);
const sizes = { xs: 24, sm: 32, md: 40, lg: 64, xl: 80, xxl: 100 };
let originOffsetWidth;
beforeAll(() => {
// Mock offsetHeight
@@ -152,6 +158,19 @@ describe('Avatar Render', () => {
expect(wrapper).toMatchRenderedSnapshot();
});
Object.entries(sizes).forEach(([key, value]) => {
it(`adjusts component size to ${value} when window size is ${key}`, () => {
const wrapper = global.document.createElement('div');
useBreakpoint.mockReturnValue({ [key]: true });
act(() => {
ReactDOM.render(<Avatar size={sizes} />, wrapper);
});
expect(wrapper).toMatchSnapshot();
});
});
it('support onMouseEnter', () => {
const onMouseEnter = jest.fn();
const wrapper = mount(<Avatar onMouseEnter={onMouseEnter}>TestString</Avatar>);

View File

@@ -1,5 +1,89 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`Avatar Render adjusts component size to 24 when window size is xs 1`] = `
<div>
<span
class="ant-avatar ant-avatar-circle"
style="width: 24px; height: 24px; line-height: 24px; font-size: 18px;"
>
<span
class="ant-avatar-string"
style="transform: scale(0.32) translateX(-50%);"
/>
</span>
</div>
`;
exports[`Avatar Render adjusts component size to 32 when window size is sm 1`] = `
<div>
<span
class="ant-avatar ant-avatar-circle"
style="width: 32px; height: 32px; line-height: 32px; font-size: 18px;"
>
<span
class="ant-avatar-string"
style="transform: scale(0.32) translateX(-50%);"
/>
</span>
</div>
`;
exports[`Avatar Render adjusts component size to 40 when window size is md 1`] = `
<div>
<span
class="ant-avatar ant-avatar-circle"
style="width: 40px; height: 40px; line-height: 40px; font-size: 18px;"
>
<span
class="ant-avatar-string"
style="transform: scale(0.32) translateX(-50%);"
/>
</span>
</div>
`;
exports[`Avatar Render adjusts component size to 64 when window size is lg 1`] = `
<div>
<span
class="ant-avatar ant-avatar-circle"
style="width: 64px; height: 64px; line-height: 64px; font-size: 18px;"
>
<span
class="ant-avatar-string"
style="transform: scale(0.32) translateX(-50%);"
/>
</span>
</div>
`;
exports[`Avatar Render adjusts component size to 80 when window size is xl 1`] = `
<div>
<span
class="ant-avatar ant-avatar-circle"
style="width: 80px; height: 80px; line-height: 80px; font-size: 18px;"
>
<span
class="ant-avatar-string"
style="transform: scale(0.32) translateX(-50%);"
/>
</span>
</div>
`;
exports[`Avatar Render adjusts component size to 100 when window size is xxl 1`] = `
<div>
<span
class="ant-avatar ant-avatar-circle"
style="width: 100px; height: 100px; line-height: 100px; font-size: 18px;"
>
<span
class="ant-avatar-string"
style="transform: scale(0.32) translateX(-50%);"
/>
</span>
</div>
`;
exports[`Avatar Render fallback 1`] = `
<span
class="ant-avatar ant-avatar-circle ant-avatar-image"
@@ -97,18 +181,22 @@ exports[`Avatar Render should show image on success after a failure state 1`] =
className="ant-avatar ant-avatar-circle"
style={Object {}}
>
<span
className="ant-avatar-string"
style={
Object {
"WebkitTransform": "scale(0.72) translateX(-50%)",
"msTransform": "scale(0.72) translateX(-50%)",
"transform": "scale(0.72) translateX(-50%)",
}
}
<ResizeObserver
onResize={[Function]}
>
Fallback
</span>
<span
className="ant-avatar-string"
style={
Object {
"WebkitTransform": "scale(1) translateX(-50%)",
"msTransform": "scale(1) translateX(-50%)",
"transform": "scale(1) translateX(-50%)",
}
}
>
Fallback
</span>
</ResizeObserver>
</span>
</Avatar>
`;

View File

@@ -18,7 +18,6 @@ Array [
>
<svg
aria-hidden="true"
class=""
data-icon="user"
fill="currentColor"
focusable="false"
@@ -209,7 +208,6 @@ Array [
>
<svg
aria-hidden="true"
class=""
data-icon="user"
fill="currentColor"
focusable="false"
@@ -246,7 +244,6 @@ Array [
>
<svg
aria-hidden="true"
class=""
data-icon="user"
fill="currentColor"
focusable="false"
@@ -270,7 +267,6 @@ Array [
>
<svg
aria-hidden="true"
class=""
data-icon="user"
fill="currentColor"
focusable="false"
@@ -294,7 +290,6 @@ Array [
>
<svg
aria-hidden="true"
class=""
data-icon="user"
fill="currentColor"
focusable="false"
@@ -318,7 +313,6 @@ Array [
>
<svg
aria-hidden="true"
class=""
data-icon="user"
fill="currentColor"
focusable="false"
@@ -345,7 +339,6 @@ Array [
>
<svg
aria-hidden="true"
class=""
data-icon="user"
fill="currentColor"
focusable="false"
@@ -369,7 +362,6 @@ Array [
>
<svg
aria-hidden="true"
class=""
data-icon="user"
fill="currentColor"
focusable="false"
@@ -393,7 +385,6 @@ Array [
>
<svg
aria-hidden="true"
class=""
data-icon="user"
fill="currentColor"
focusable="false"
@@ -417,7 +408,6 @@ Array [
>
<svg
aria-hidden="true"
class=""
data-icon="user"
fill="currentColor"
focusable="false"
@@ -469,6 +459,25 @@ Array [
]
`;
exports[`renders ./components/avatar/demo/fallback.md correctly 1`] = `
Array [
<span
class="ant-avatar ant-avatar-circle ant-avatar-image"
>
<img
src="http://abc.com/not-exist.jpg"
/>
</span>,
<span
class="ant-avatar ant-avatar-circle ant-avatar-image"
>
<img
src="http://abc.com/not-exist.jpg"
/>
</span>,
]
`;
exports[`renders ./components/avatar/demo/group.md correctly 1`] = `
Array [
<div
@@ -503,7 +512,6 @@ Array [
>
<svg
aria-hidden="true"
class=""
data-icon="user"
fill="currentColor"
focusable="false"
@@ -528,7 +536,6 @@ Array [
>
<svg
aria-hidden="true"
class=""
data-icon="ant-design"
fill="currentColor"
focusable="false"
@@ -580,26 +587,70 @@ Array [
</span>
</span>
</div>,
<div
class="ant-divider ant-divider-horizontal"
role="separator"
/>,
<div
class="ant-avatar-group"
>
<span
class="ant-avatar ant-avatar-lg ant-avatar-circle ant-avatar-image"
>
<img
src="https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png"
/>
</span>
<span
class="ant-avatar ant-avatar-lg ant-avatar-circle"
style="background-color:#f56a00"
>
<span
class="ant-avatar-string"
style="opacity:0"
>
K
</span>
</span>
<span
class="ant-avatar ant-avatar-lg ant-avatar-circle"
style="color:#f56a00;background-color:#fde3cf"
>
<span
class="ant-avatar-string"
style="opacity:0"
>
+2
</span>
</span>
</div>,
]
`;
exports[`renders ./components/avatar/demo/fallback.md correctly 1`] = `
Array [
exports[`renders ./components/avatar/demo/responsive.md correctly 1`] = `
<span
class="ant-avatar ant-avatar-circle ant-avatar-icon"
>
<span
class="ant-avatar ant-avatar-circle ant-avatar-image"
aria-label="ant-design"
class="anticon anticon-ant-design"
role="img"
>
<img
src="http://abc.com/not-exist.jpg"
/>
</span>,
<span
class="ant-avatar ant-avatar-circle ant-avatar-image"
>
<img
src="http://abc.com/not-exist.jpg"
/>
</span>,
]
<svg
aria-hidden="true"
data-icon="ant-design"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M716.3 313.8c19-18.9 19-49.7 0-68.6l-69.9-69.9.1.1c-18.5-18.5-50.3-50.3-95.3-95.2-21.2-20.7-55.5-20.5-76.5.5L80.9 474.2a53.84 53.84 0 000 76.4L474.6 944a54.14 54.14 0 0076.5 0l165.1-165c19-18.9 19-49.7 0-68.6a48.7 48.7 0 00-68.7 0l-125 125.2c-5.2 5.2-13.3 5.2-18.5 0L189.5 521.4c-5.2-5.2-5.2-13.3 0-18.5l314.4-314.2c.4-.4.9-.7 1.3-1.1 5.2-4.1 12.4-3.7 17.2 1.1l125.2 125.1c19 19 49.8 19 68.7 0zM408.6 514.4a106.3 106.2 0 10212.6 0 106.3 106.2 0 10-212.6 0zm536.2-38.6L821.9 353.5c-19-18.9-49.8-18.9-68.7.1a48.4 48.4 0 000 68.6l83 82.9c5.2 5.2 5.2 13.3 0 18.5l-81.8 81.7a48.4 48.4 0 000 68.6 48.7 48.7 0 0068.7 0l121.8-121.7a53.93 53.93 0 00-.1-76.4z"
/>
</svg>
</span>
</span>
`;
exports[`renders ./components/avatar/demo/toggle-debug.md correctly 1`] = `
@@ -691,7 +742,6 @@ Array [
>
<svg
aria-hidden="true"
class=""
data-icon="user"
fill="currentColor"
focusable="false"
@@ -733,6 +783,18 @@ Array [
src="https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png"
/>
</span>,
<span
class="ant-avatar ant-avatar-circle ant-avatar-image"
>
<div
class="ant-image"
>
<img
class="ant-image-img"
src="https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png"
/>
</div>
</span>,
<span
class="ant-avatar ant-avatar-circle"
style="color:#f56a00;background-color:#fde3cf"
@@ -755,7 +817,6 @@ Array [
>
<svg
aria-hidden="true"
class=""
data-icon="user"
fill="currentColor"
focusable="false"

View File

@@ -0,0 +1,5 @@
import { imageDemoTest } from '../../../tests/shared/imageTest';
describe('Avatar image', () => {
imageDemoTest('avatar');
});

View File

@@ -1,9 +1,13 @@
import * as React from 'react';
import classNames from 'classnames';
import ResizeObserver from 'rc-resize-observer';
import { ConfigContext } from '../config-provider';
import devWarning from '../_util/devWarning';
import { composeRef } from '../_util/ref';
import { Breakpoint, responsiveArray } from '../_util/responsiveObserve';
import useBreakpoint from '../grid/hooks/useBreakpoint';
import SizeContext, { AvatarSize } from './SizeContext';
export interface AvatarProps {
/** Shape of avatar, options:`circle`, `square` */
@@ -12,10 +16,10 @@ export interface AvatarProps {
* Size of avatar, options: `large`, `small`, `default`
* or a custom number size
* */
size?: 'large' | 'small' | 'default' | number;
size?: AvatarSize;
gap?: number;
/** Src of image avatar */
src?: string;
src?: React.ReactNode;
/** Srcset of image avatar */
srcSet?: string;
draggable?: boolean;
@@ -32,6 +36,8 @@ export interface AvatarProps {
}
const InternalAvatar: React.ForwardRefRenderFunction<unknown, AvatarProps> = (props, ref) => {
const groupSize = React.useContext(SizeContext);
const [scale, setScale] = React.useState(1);
const [mounted, setMounted] = React.useState(false);
const [isImgExist, setIsImgExist] = React.useState(true);
@@ -41,9 +47,6 @@ const InternalAvatar: React.ForwardRefRenderFunction<unknown, AvatarProps> = (pr
const avatarNodeMergeRef = composeRef(ref, avatarNodeRef);
let lastChildrenWidth: number;
let lastNodeWidth: number;
const { getPrefixCls } = React.useContext(ConfigContext);
const setScaleParam = () => {
@@ -52,19 +55,12 @@ const InternalAvatar: React.ForwardRefRenderFunction<unknown, AvatarProps> = (pr
}
const childrenWidth = avatarChildrenRef.current.offsetWidth; // offsetWidth avoid affecting be transform scale
const nodeWidth = avatarNodeRef.current.offsetWidth;
const { gap = 4 } = props;
// denominator is 0 is no meaning
if (
childrenWidth !== 0 &&
nodeWidth !== 0 &&
(lastChildrenWidth !== childrenWidth || lastNodeWidth !== nodeWidth)
) {
lastChildrenWidth = childrenWidth;
lastNodeWidth = nodeWidth;
}
if (gap * 2 < nodeWidth) {
setScale(nodeWidth - gap * 2 < childrenWidth ? (nodeWidth - gap * 2) / childrenWidth : 1);
if (childrenWidth !== 0 && nodeWidth !== 0) {
const { gap = 4 } = props;
if (gap * 2 < nodeWidth) {
setScale(nodeWidth - gap * 2 < childrenWidth ? (nodeWidth - gap * 2) / childrenWidth : 1);
}
}
};
@@ -79,13 +75,7 @@ const InternalAvatar: React.ForwardRefRenderFunction<unknown, AvatarProps> = (pr
React.useEffect(() => {
setScaleParam();
}, [props.children, props.gap, props.size]);
React.useEffect(() => {
if (props.children) {
setScaleParam();
}
}, [isImgExist]);
}, [props.gap]);
const handleImgLoadError = () => {
const { onError } = props;
@@ -98,7 +88,7 @@ const InternalAvatar: React.ForwardRefRenderFunction<unknown, AvatarProps> = (pr
const {
prefixCls: customizePrefixCls,
shape,
size,
size: customSize,
src,
srcSet,
icon,
@@ -109,6 +99,27 @@ const InternalAvatar: React.ForwardRefRenderFunction<unknown, AvatarProps> = (pr
...others
} = props;
const size = customSize === 'default' ? groupSize : customSize;
const screens = useBreakpoint();
const responsiveSizeStyle: React.CSSProperties = React.useMemo(() => {
if (typeof size !== 'object') {
return {};
}
const currentBreakpoint: Breakpoint = responsiveArray.find(screen => screens[screen])!;
const currentSize = size[currentBreakpoint];
return currentSize
? {
width: currentSize,
height: currentSize,
lineHeight: `${currentSize}px`,
fontSize: icon ? currentSize / 2 : 18,
}
: {};
}, [screens, size]);
devWarning(
!(typeof icon === 'string' && icon.length > 2),
'Avatar',
@@ -122,11 +133,18 @@ const InternalAvatar: React.ForwardRefRenderFunction<unknown, AvatarProps> = (pr
[`${prefixCls}-sm`]: size === 'small',
});
const classString = classNames(prefixCls, className, sizeCls, {
[`${prefixCls}-${shape}`]: shape,
[`${prefixCls}-image`]: src && isImgExist,
[`${prefixCls}-icon`]: icon,
});
const hasImageElement = React.isValidElement(src);
const classString = classNames(
prefixCls,
sizeCls,
{
[`${prefixCls}-${shape}`]: shape,
[`${prefixCls}-image`]: hasImageElement || (src && isImgExist),
[`${prefixCls}-icon`]: icon,
},
className,
);
const sizeStyle: React.CSSProperties =
typeof size === 'number'
@@ -139,10 +157,12 @@ const InternalAvatar: React.ForwardRefRenderFunction<unknown, AvatarProps> = (pr
: {};
let childrenToRender;
if (src && isImgExist) {
if (typeof src === 'string' && isImgExist) {
childrenToRender = (
<img src={src} draggable={draggable} srcSet={srcSet} onError={handleImgLoadError} alt={alt} />
);
} else if (hasImageElement) {
childrenToRender = src;
} else if (icon) {
childrenToRender = icon;
} else if (mounted || scale !== 1) {
@@ -161,15 +181,17 @@ const InternalAvatar: React.ForwardRefRenderFunction<unknown, AvatarProps> = (pr
: {};
childrenToRender = (
<span
className={`${prefixCls}-string`}
ref={(node: HTMLElement) => {
avatarChildrenRef.current = node;
}}
style={{ ...sizeChildrenStyle, ...childrenStyle }}
>
{children}
</span>
<ResizeObserver onResize={setScaleParam}>
<span
className={`${prefixCls}-string`}
ref={(node: HTMLElement) => {
avatarChildrenRef.current = node;
}}
style={{ ...sizeChildrenStyle, ...childrenStyle }}
>
{children}
</span>
</ResizeObserver>
);
} else {
childrenToRender = (
@@ -193,7 +215,7 @@ const InternalAvatar: React.ForwardRefRenderFunction<unknown, AvatarProps> = (pr
return (
<span
{...others}
style={{ ...sizeStyle, ...others.style }}
style={{ ...sizeStyle, ...responsiveSizeStyle, ...others.style }}
className={classString}
ref={avatarNodeMergeRef as any}
>

View File

@@ -38,6 +38,19 @@ class Demo extends React.Component {
</Tooltip>
<Avatar style={{ backgroundColor: '#1890ff' }} icon={<AntDesignOutlined />} />
</Avatar.Group>
<Divider />
<Avatar.Group
maxCount={2}
size="large"
maxStyle={{ color: '#f56a00', backgroundColor: '#fde3cf' }}
>
<Avatar src="https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png" />
<Avatar style={{ backgroundColor: '#f56a00' }}>K</Avatar>
<Tooltip title="Ant User" placement="top">
<Avatar style={{ backgroundColor: '#87d068' }} icon={<UserOutlined />} />
</Tooltip>
<Avatar style={{ backgroundColor: '#1890ff' }} icon={<AntDesignOutlined />} />
</Avatar.Group>
</>
);
}

View File

@@ -0,0 +1,27 @@
---
order: 5
title:
zh-CN: 响应式尺寸
en-US: Responsive Size
---
## zh-CN
头像大小可以根据屏幕大小自动调整。
## en-US
Avatar size can be automatically adjusted based on the screen size.
```tsx
import { Avatar } from 'antd';
import { AntDesignOutlined } from '@ant-design/icons';
ReactDOM.render(
<Avatar
size={{ xs: 24, sm: 32, md: 40, lg: 64, xl: 80, xxl: 100 }}
icon={<AntDesignOutlined />}
/>,
mountNode,
);
```

View File

@@ -14,7 +14,7 @@ title:
Image, Icon and letter are supported, and the latter two kinds of avatar can have custom colors and background colors.
```tsx
import { Avatar } from 'antd';
import { Avatar, Image } from 'antd';
import { UserOutlined } from '@ant-design/icons';
ReactDOM.render(
@@ -23,6 +23,9 @@ ReactDOM.render(
<Avatar>U</Avatar>
<Avatar size={40}>USER</Avatar>
<Avatar src="https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png" />
<Avatar
src={<Image src="https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png" />}
/>
<Avatar style={{ color: '#f56a00', backgroundColor: '#fde3cf' }}>U</Avatar>
<Avatar style={{ backgroundColor: '#87d068' }} icon={<UserOutlined />} />
</>,

View File

@@ -5,6 +5,7 @@ import { cloneElement } from '../_util/reactNode';
import { ConfigContext } from '../config-provider';
import Avatar from './avatar';
import Popover from '../popover';
import { AvatarSize, SizeContextProvider } from './SizeContext';
export interface GroupProps {
className?: string;
@@ -14,12 +15,19 @@ export interface GroupProps {
maxCount?: number;
maxStyle?: React.CSSProperties;
maxPopoverPlacement?: 'top' | 'bottom';
/*
* Size of avatar, options: `large`, `small`, `default`
* or a custom number size
* */
size?: AvatarSize;
}
const Group: React.FC<GroupProps> = props => {
const { getPrefixCls, direction } = React.useContext(ConfigContext);
const { prefixCls: customizePrefixCls, className = '', maxCount, maxStyle } = props;
const { prefixCls: customizePrefixCls, className = '', maxCount, maxStyle, size } = props;
const prefixCls = getPrefixCls('avatar-group', customizePrefixCls);
const cls = classNames(
prefixCls,
{
@@ -51,15 +59,20 @@ const Group: React.FC<GroupProps> = props => {
</Popover>,
);
return (
<div className={cls} style={props.style}>
{childrenShow}
</div>
<SizeContextProvider size={size}>
<div className={cls} style={props.style}>
{childrenShow}
</div>
</SizeContextProvider>
);
}
return (
<div className={cls} style={props.style}>
{children}
</div>
<SizeContextProvider size={size}>
<div className={cls} style={props.style}>
{childrenWithProps}
</div>
</SizeContextProvider>
);
};

View File

@@ -13,21 +13,22 @@ Avatars can be used to represent people or objects. It supports images, `Icon`s,
| Property | Description | Type | Default | Version |
| --- | --- | --- | --- | --- |
| alt | This attribute defines the alternative text describing the image | string | - | |
| gap | Letter type unit distance between left and right sides | number | 4 | 4.3.0 |
| icon | Custom icon type for an icon avatar | ReactNode | - | |
| shape | The shape of avatar | `circle` \| `square` | `circle` | |
| size | The size of the avatar | number \| `large` \| `small` \| `default` | `default` | |
| src | The address of the image for an image avatar | string | - | |
| size | The size of the avatar | number \| `large` \| `small` \| `default` \| { xs: number, sm: number, ...} | `default` | 4.7.0 |
| src | The address of the image for an image avatar or image element | string \| ReactNode | - | ReactNode: 4.8.0 |
| srcSet | A list of sources to use for different screen resolutions | string | - | |
| alt | This attribute defines the alternative text describing the image | string | - | |
| onError | Handler when img load error, return false to prevent default fallback behavior | () => boolean | - | |
| gap | Letter type unit distance between left and right sides | number | 4 | 4.3.0 |
> Tip: You can set `icon` or `children` as the fallback for image load error, with the priority of `icon` > `children`
### Avatar.Group (4.5.0+)
| 参数 | 说明 | 类型 | 默认值 | 版本 |
| ------------------- | -------------------------------------- | ----------------- | ------ | ---- |
| maxCount | Max avatars to show | number | - | |
| maxStyle | The style of excess avatar style | CSSProperties | - | |
| maxPopoverPlacement | The placement of excess avatar Popover | `top` \| `bottom` | `top` | |
| 参数 | 说明 | 类型 | 默认值 | 版本 |
| --- | --- | --- | --- | --- |
| maxCount | Max avatars to show | number | - | |
| maxPopoverPlacement | The placement of excess avatar Popover | `top` \| `bottom` | `top` | |
| maxStyle | The style of excess avatar style | CSSProperties | - | |
| size | The size of the avatar | number \| `large` \| `small` \| `default` \| { xs: number, sm: number, ...} | `default` | 4.8.0 |

View File

@@ -1,3 +1,4 @@
import * as React from 'react';
import InternalAvatar, { AvatarProps } from './avatar';
import Group from './group';

View File

@@ -10,7 +10,7 @@ cover: https://gw.alipayobjects.com/zos/antfincdn/aBcnbw68hP/Avatar.svg
## 设计师专属
安装 [Kitchen Sketch 插件 💎](https://kitchen.alipay.com),一键填充高逼格头像和文本.
安装 [Kitchen Sketch 插件 💎](https://kitchen.alipay.com),一键填充高逼格头像和文本
## API
@@ -18,21 +18,22 @@ cover: https://gw.alipayobjects.com/zos/antfincdn/aBcnbw68hP/Avatar.svg
| 参数 | 说明 | 类型 | 默认值 | 版本 |
| --- | --- | --- | --- | --- |
| alt | 图像无法显示时的替代文本 | string | - | |
| gap | 字符类型距离左右两侧边界单位像素 | number | 4 | 4.3.0 |
| icon | 设置头像的自定义图标 | ReactNode | - | |
| shape | 指定头像的形状 | `circle` \| `square` | `circle` | |
| size | 设置头像的大小 | number \| `large` \| `small` \| `default` | `default` | |
| src | 图片类头像的资源地址 | string | - | |
| size | 设置头像的大小 | number \| `large` \| `small` \| `default` \| { xs: number, sm: number, ...} | `default` | 4.7.0 |
| src | 图片类头像的资源地址或者图片元素 | string \| ReactNode | - | ReactNode: 4.8.0 |
| srcSet | 设置图片类头像响应式资源地址 | string | - | |
| alt | 图像无法显示时的替代文本 | string | - | |
| onError | 图片加载失败的事件,返回 false 会关闭组件默认的 fallback 行为 | () => boolean | - | |
| gap | 字符类型距离左右两侧边界单位像素 | number | 4 | 4.3.0 |
> Tip你可以设置 `icon` 或 `children` 作为图片加载失败的默认 fallback 行为,优先级为 `icon` > `children`
### Avatar.Group (4.5.0+)
| 参数 | 说明 | 类型 | 默认值 | 版本 |
| ------------------- | -------------------- | ----------------- | ------ | ---- |
| maxCount | 显示的最大头像个数 | number | - | |
| maxStyle | 多余头像样式 | CSSProperties | - | |
| maxPopoverPlacement | 多余头像气泡弹出位置 | `top` \| `bottom` | `top` | |
| 参数 | 说明 | 类型 | 默认值 | 版本 |
| --- | --- | --- | --- | --- |
| maxCount | 显示的最大头像个数 | number | - | |
| maxPopoverPlacement | 多余头像气泡弹出位置 | `top` \| `bottom` | `top` | |
| maxStyle | 多余头像样式 | CSSProperties | - | |
| size | 设置头像的大小 | number \| `large` \| `small` \| `default` \| { xs: number, sm: number, ...} | `default` | 4.8.0 |

View File

@@ -1,8 +1,3 @@
@import '../../style/themes/index';
@import '../../style/mixins/index';
@avatar-prefix-cls: ~'@{ant-prefix}-avatar';
.@{avatar-prefix-cls}-group {
display: inline-flex;

View File

@@ -19,6 +19,10 @@
background: transparent;
}
.@{ant-prefix}-image-img {
display: block;
}
.avatar-size(@avatar-size-base, @avatar-font-size-base);
&-lg {

View File

@@ -2,4 +2,5 @@ import '../../style/index.less';
import './index.less';
// style dependencies
// deps-lint-skip: grid
import '../../popover/style';

View File

@@ -1,8 +1,3 @@
@import '../../style/themes/index';
@import '../../style/mixins/index';
@avatar-prefix-cls: ~'@{ant-prefix}-avatar';
.@{avatar-prefix-cls}-group {
&-rtl {
.@{avatar-prefix-cls}:not(:first-child) {

View File

@@ -0,0 +1,5 @@
import { imageDemoTest } from '../../../tests/shared/imageTest';
describe('BackTop image', () => {
imageDemoTest('back-top');
});

View File

@@ -20,7 +20,7 @@ cover: https://gw.alipayobjects.com/zos/alicdn/tJZ5jbTwX/BackTop.svg
| Property | Description | Type | Default | Version |
| --- | --- | --- | --- | --- |
| duration | Time to return to topms | number | 450 | 4.4.0 |
| target | Specifies the scrollable area dom node | () => HTMLElement | () => window | |
| visibilityHeight | The BackTop button will not show until the scroll height reaches this value | number | 400 | |
| onClick | A callback function, which can be executed when you click the button | function | - | |
| duration | Time to return to topms | number | 450 | 4.4.0 |

View File

@@ -4,7 +4,7 @@ import addEventListener from 'rc-util/lib/Dom/addEventListener';
import classNames from 'classnames';
import omit from 'omit.js';
import VerticalAlignTopOutlined from '@ant-design/icons/VerticalAlignTopOutlined';
import throttleByAnimationFrame from '../_util/throttleByAnimationFrame';
import { throttleByAnimationFrame } from '../_util/throttleByAnimationFrame';
import { ConfigContext } from '../config-provider';
import getScroll from '../_util/getScroll';
import scrollTo from '../_util/scrollTo';
@@ -98,9 +98,13 @@ const BackTop: React.FC<BackTopProps> = props => {
const { getPrefixCls, direction } = React.useContext(ConfigContext);
const { prefixCls: customizePrefixCls, className = '' } = props;
const prefixCls = getPrefixCls('back-top', customizePrefixCls);
const classString = classNames(prefixCls, className, {
[`${prefixCls}-rtl`]: direction === 'rtl',
});
const classString = classNames(
prefixCls,
{
[`${prefixCls}-rtl`]: direction === 'rtl',
},
className,
);
// fix https://fb.me/react-unknown-prop
const divProps = omit(props, [

View File

@@ -21,7 +21,7 @@ cover: https://gw.alipayobjects.com/zos/alicdn/tJZ5jbTwX/BackTop.svg
| 参数 | 说明 | 类型 | 默认值 | 版本 |
| --- | --- | --- | --- | --- |
| duration | 回到顶部所需时间ms | number | 450 | 4.4.0 |
| target | 设置需要监听其滚动事件的元素,值为一个返回对应 DOM 元素的函数 | () => HTMLElement | () => window | |
| visibilityHeight | 滚动高度达到此参数值才出现 BackTop | number | 400 | |
| onClick | 点击按钮的回调函数 | function | - | |
| duration | 回到顶部所需时间ms | number | 450 | 4.4.0 |

View File

@@ -32,11 +32,11 @@
text-align: center;
background-color: @back-top-bg;
border-radius: 20px;
transition: all 0.3s @ease-in-out;
transition: all 0.3s;
&:hover {
background-color: @back-top-hover-bg;
transition: all 0.3s @ease-in-out;
transition: all 0.3s;
}
}

View File

@@ -29,10 +29,15 @@ const Ribbon: React.FC<RibbonProps> = function Ribbon({
const { getPrefixCls, direction } = React.useContext(ConfigContext);
const prefixCls = getPrefixCls('ribbon', customizePrefixCls);
const colorInPreset = isPresetColor(color);
const ribbonCls = classNames(prefixCls, className, `${prefixCls}-placement-${placement}`, {
[`${prefixCls}-rtl`]: direction === 'rtl',
[`${prefixCls}-color-${color}`]: colorInPreset,
});
const ribbonCls = classNames(
prefixCls,
`${prefixCls}-placement-${placement}`,
{
[`${prefixCls}-rtl`]: direction === 'rtl',
[`${prefixCls}-color-${color}`]: colorInPreset,
},
className,
);
const colorStyle: React.CSSProperties = {};
const cornerColorStyle: React.CSSProperties = {};
if (color && !colorInPreset) {
@@ -43,7 +48,7 @@ const Ribbon: React.FC<RibbonProps> = function Ribbon({
<div className={`${prefixCls}-wrapper`}>
{children}
<div className={ribbonCls} style={{ ...colorStyle, ...style }}>
{text}
<span className={`${prefixCls}-text`}>{text}</span>
<div className={`${prefixCls}-corner`} style={cornerColorStyle} />
</div>
</div>

View File

@@ -201,7 +201,6 @@ exports[`renders ./components/badge/demo/basic.md correctly 1`] = `
>
<svg
aria-hidden="true"
class=""
data-icon="clock-circle"
fill="currentColor"
focusable="false"
@@ -407,7 +406,6 @@ exports[`renders ./components/badge/demo/change.md correctly 1`] = `
>
<svg
aria-hidden="true"
class=""
data-icon="minus"
fill="currentColor"
focusable="false"
@@ -432,7 +430,6 @@ exports[`renders ./components/badge/demo/change.md correctly 1`] = `
>
<svg
aria-hidden="true"
class=""
data-icon="plus"
fill="currentColor"
focusable="false"
@@ -762,7 +759,6 @@ exports[`renders ./components/badge/demo/dot.md correctly 1`] = `
>
<svg
aria-hidden="true"
class=""
data-icon="notification"
fill="currentColor"
focusable="false"
@@ -790,7 +786,6 @@ exports[`renders ./components/badge/demo/dot.md correctly 1`] = `
>
<svg
aria-hidden="true"
class=""
data-icon="notification"
fill="currentColor"
focusable="false"
@@ -1318,7 +1313,7 @@ exports[`renders ./components/badge/demo/no-wrapper.md correctly 1`] = `
</sup>
</span>
<span
class="site-badge-count-4 ant-badge ant-badge-not-a-wrapper"
class="ant-badge ant-badge-not-a-wrapper site-badge-count-4"
>
<sup
class="ant-scroll-number ant-badge-count"
@@ -1483,7 +1478,7 @@ exports[`renders ./components/badge/demo/no-wrapper.md correctly 1`] = `
</sup>
</span>
<span
class="site-badge-count-109 ant-badge ant-badge-not-a-wrapper"
class="ant-badge ant-badge-not-a-wrapper site-badge-count-109"
>
<sup
class="ant-scroll-number ant-badge-count ant-badge-multiple-words"
@@ -2060,7 +2055,11 @@ exports[`renders ./components/badge/demo/ribbbon.md correctly 1`] = `
<div
class="ant-ribbon ant-ribbon-placement-end"
>
Pushes open the window
<span
class="ant-ribbon-text"
>
Pushes open the window
</span>
<div
class="ant-ribbon-corner"
/>
@@ -2092,7 +2091,11 @@ exports[`renders ./components/badge/demo/ribbon-debug.md correctly 1`] = `
<div
class="ant-ribbon ant-ribbon-placement-end"
>
啦啦啦啦
<span
class="ant-ribbon-text"
>
啦啦啦啦
</span>
<div
class="ant-ribbon-corner"
/>
@@ -2118,7 +2121,11 @@ exports[`renders ./components/badge/demo/ribbon-debug.md correctly 1`] = `
<div
class="ant-ribbon ant-ribbon-placement-end ant-ribbon-color-purple"
>
啦啦啦啦
<span
class="ant-ribbon-text"
>
啦啦啦啦
</span>
<div
class="ant-ribbon-corner"
/>
@@ -2145,7 +2152,11 @@ exports[`renders ./components/badge/demo/ribbon-debug.md correctly 1`] = `
class="ant-ribbon ant-ribbon-placement-end"
style="background:#2db7f5"
>
啦啦啦啦
<span
class="ant-ribbon-text"
>
啦啦啦啦
</span>
<div
class="ant-ribbon-corner"
style="color:#2db7f5"
@@ -2173,7 +2184,11 @@ exports[`renders ./components/badge/demo/ribbon-debug.md correctly 1`] = `
class="ant-ribbon ant-ribbon-placement-start"
style="background:#2db7f5"
>
啦啦啦啦
<span
class="ant-ribbon-text"
>
啦啦啦啦
</span>
<div
class="ant-ribbon-corner"
style="color:#2db7f5"
@@ -2200,7 +2215,11 @@ exports[`renders ./components/badge/demo/ribbon-debug.md correctly 1`] = `
class="ant-ribbon ant-ribbon-placement-end"
style="background:#2db7f5"
>
啦啦啦啦
<span
class="ant-ribbon-text"
>
啦啦啦啦
</span>
<div
class="ant-ribbon-corner"
style="color:#2db7f5"

View File

@@ -3505,6 +3505,9 @@ exports[`Ribbon rtl render component should be rendered correctly in RTL directi
<div
class="ant-ribbon ant-ribbon-placement-end ant-ribbon-rtl"
>
<span
class="ant-ribbon-text"
/>
<div
class="ant-ribbon-corner"
/>

View File

@@ -0,0 +1,5 @@
import { imageDemoTest } from '../../../tests/shared/imageTest';
describe('Badge image', () => {
imageDemoTest('badge');
});

View File

@@ -23,8 +23,8 @@ Badge normally appears in proximity to notifications or user avatars with eye-ca
| offset | Set offset of the badge dot | \[number, number] | - | |
| overflowCount | Max count to show | number | 99 | |
| showZero | Whether to show badge when `count` is zero | boolean | false | |
| status | Set Badge as a status dot | `success` \| `processing` \| `default` \| `error` \| `warning` | - | |
| size | If `count` is set, `size` sets the size of badge | `default` \| `small` | - | 4.6.0 |
| status | Set Badge as a status dot | `success` \| `processing` \| `default` \| `error` \| `warning` | - | |
| text | If `status` is set, `text` sets the display text of the status `dot` | ReactNode | - | |
| title | Text to show when hovering over the badge | string | - | |

View File

@@ -62,7 +62,8 @@ const Badge: CompoundedComponent = ({
return displayCount as string | number | null;
};
const hasStatus = (): boolean => (status !== null && status !== undefined) || (color !== null && color !== undefined);
const hasStatus = (): boolean =>
(status !== null && status !== undefined) || (color !== null && color !== undefined);
const isZero = () => {
const numberedDisplayCount = getNumberedDisplayCount();
@@ -177,11 +178,15 @@ const Badge: CompoundedComponent = ({
statusStyle.background = color;
}
const badgeClassName = classNames(className, prefixCls, {
[`${prefixCls}-status`]: hasStatus(),
[`${prefixCls}-not-a-wrapper`]: !children,
[`${prefixCls}-rtl`]: direction === 'rtl',
});
const badgeClassName = classNames(
prefixCls,
{
[`${prefixCls}-status`]: hasStatus(),
[`${prefixCls}-not-a-wrapper`]: !children,
[`${prefixCls}-rtl`]: direction === 'rtl',
},
className,
);
// <Badge status="success" />
if (!children && hasStatus()) {

View File

@@ -24,8 +24,8 @@ cover: https://gw.alipayobjects.com/zos/antfincdn/6%26GF9WHwvY/Badge.svg
| offset | 设置状态点的位置偏移 | \[number, number] | - | |
| overflowCount | 展示封顶的数字值 | number | 99 | |
| showZero | 当数值为 0 时,是否展示 Badge | boolean | false | |
| status | 设置 Badge 为状态点 | `success` \| `processing` \| `default` \| `error` \| `warning` | - | |
| size | 在设置了 `count` 的前提下有效,设置小圆点的大小 | `default` \| `small` | - | 4.6.0 |
| status | 设置 Badge 为状态点 | `success` \| `processing` \| `default` \| `error` \| `warning` | - | |
| text | 在设置了 `status` 的前提下有效,设置状态点的文本 | ReactNode | - | |
| title | 设置鼠标放在状态点上时显示的文字 | string | - | |

View File

@@ -9,7 +9,6 @@
position: relative;
display: inline-block;
color: unset;
line-height: 1;
&-count {

View File

@@ -21,12 +21,16 @@
background-color: @primary-color;
border-radius: @border-radius-sm;
&-text {
color: @white;
}
&-corner {
position: absolute;
top: 100%;
width: 8px;
height: 8px;
color: @primary-color;
color: currentColor;
border: 4px solid;
transform: scaleY(0.75);
transform-origin: top;
@@ -50,10 +54,8 @@
@color: extract(@preset-colors, @i);
@darkColor: '@{color}-6';
&-color-@{color} {
background-color: @@darkColor;
.@{ribbon-prefix-cls}-corner {
color: @@darkColor;
}
color: @@darkColor;
background: @@darkColor;
}
}
.make-color-classes();
@@ -65,20 +67,15 @@
.@{ribbon-prefix-cls}-corner {
right: 0;
border-color: currentColor transparent transparent currentColor;
&::after {
border-color: currentColor transparent transparent currentColor;
}
}
}
&.@{ribbon-prefix-cls}-placement-start {
left: -8px;
border-bottom-left-radius: 0;
.@{ribbon-prefix-cls}-corner {
left: 0;
border-color: currentColor currentColor transparent transparent;
&::after {
border-color: currentColor currentColor transparent transparent;
}
}
}
}

View File

@@ -1,10 +1,3 @@
@import '../../style/themes/index';
@import '../../style/mixins/index';
@badge-prefix-cls: ~'@{ant-prefix}-badge';
@number-prefix-cls: ~'@{ant-prefix}-scroll-number';
@ribbon-prefix-cls: ~'@{ant-prefix}-ribbon';
.@{badge-prefix-cls} {
&-rtl {
direction: rtl;

View File

@@ -135,9 +135,13 @@ const Breadcrumb: BreadcrumbInterface = ({
});
}
const breadcrumbClassName = classNames(className, prefixCls, {
[`${prefixCls}-rtl`]: direction === 'rtl',
});
const breadcrumbClassName = classNames(
prefixCls,
{
[`${prefixCls}-rtl`]: direction === 'rtl',
},
className,
);
return (
<div className={breadcrumbClassName} style={style} {...restProps}>

View File

@@ -116,7 +116,7 @@ exports[`Breadcrumb should render a menu 1`] = `
</span>
<span>
<span
class="ant-breadcrumb-overlay-link ant-dropdown-trigger"
class="ant-dropdown-trigger ant-breadcrumb-overlay-link"
>
<span
class="ant-breadcrumb-link"
@@ -134,7 +134,6 @@ exports[`Breadcrumb should render a menu 1`] = `
>
<svg
aria-hidden="true"
class=""
data-icon="down"
fill="currentColor"
focusable="false"

View File

@@ -97,7 +97,7 @@ exports[`renders ./components/breadcrumb/demo/overlay.md correctly 1`] = `
</span>
<span>
<span
class="ant-breadcrumb-overlay-link ant-dropdown-trigger"
class="ant-dropdown-trigger ant-breadcrumb-overlay-link"
>
<span
class="ant-breadcrumb-link"
@@ -115,7 +115,6 @@ exports[`renders ./components/breadcrumb/demo/overlay.md correctly 1`] = `
>
<svg
aria-hidden="true"
class=""
data-icon="down"
fill="currentColor"
focusable="false"
@@ -275,7 +274,6 @@ exports[`renders ./components/breadcrumb/demo/withIcon.md correctly 1`] = `
>
<svg
aria-hidden="true"
class=""
data-icon="home"
fill="currentColor"
focusable="false"
@@ -307,7 +305,6 @@ exports[`renders ./components/breadcrumb/demo/withIcon.md correctly 1`] = `
>
<svg
aria-hidden="true"
class=""
data-icon="user"
fill="currentColor"
focusable="false"

View File

@@ -0,0 +1,5 @@
import { imageDemoTest } from '../../../tests/shared/imageTest';
describe('Breadcrumb image', () => {
imageDemoTest('breadcrumb', { skip: ['router-4.md'] });
});

View File

@@ -72,23 +72,12 @@ describe('react router', () => {
</MemoryRouter>,
);
expect(wrapper.find('BreadcrumbItem').length).toBe(1);
expect(
wrapper
.find('BreadcrumbItem .ant-breadcrumb-link')
.at(0)
.text(),
).toBe('Home');
wrapper
.find('.demo-nav a')
.at(1)
.simulate('click');
expect(wrapper.find('BreadcrumbItem .ant-breadcrumb-link').at(0).text()).toBe('Home');
wrapper.find('.demo-nav a').at(1).simulate('click');
expect(wrapper.find('BreadcrumbItem').length).toBe(2);
expect(
wrapper
.find('BreadcrumbItem .ant-breadcrumb-link')
.at(1)
.text(),
).toBe('Application List');
expect(wrapper.find('BreadcrumbItem .ant-breadcrumb-link').at(1).text()).toBe(
'Application List',
);
});
it('react router 3', () => {

View File

@@ -22,7 +22,7 @@ A breadcrumb displays the current location within a hierarchy. It allows going b
| itemRender | Custom item renderer | (route, params, routes, paths) => ReactNode | - | |
| params | Routing parameters | object | - | |
| routes | The routing stack information of router | [routes\[\]](#routes) | - | |
| separator | Custom separator | string \| ReactNode | `/` | |
| separator | Custom separator | ReactNode | `/` | |
### Breadcrumb.Item
@@ -30,14 +30,14 @@ A breadcrumb displays the current location within a hierarchy. It allows going b
| --- | --- | --- | --- | --- |
| dropdownProps | The dropdown props | [Dropdown](/components/dropdown) | - | |
| href | Target of hyperlink | string | - | |
| onClick | Set the handler to handle click event | (e:MouseEvent) => void | - | |
| overlay | The dropdown menu | [Menu](/components/menu) \| () => Menu | - | |
| onClick | Set the handler to handle click event | (e:MouseEvent) => void | - | |
### Breadcrumb.Separator
| Property | Description | Type | Default | Version |
| -------- | ---------------- | ------------------- | ------- | ------- |
| children | Custom separator | string \| ReactNode | `/` | |
| Property | Description | Type | Default | Version |
| --- | --- | --- | --- | --- |
| children | Custom separator | ReactNode | `/` | |
> When using `Breadcrumb.Separator`,its parent component must be set to `separator=""`, otherwise the default separator of the parent component will appear.

View File

@@ -23,7 +23,7 @@ cover: https://gw.alipayobjects.com/zos/alicdn/9Ltop8JwH/Breadcrumb.svg
| itemRender | 自定义链接函数,和 react-router 配置使用 | (route, params, routes, paths) => ReactNode | - | |
| params | 路由的参数 | object | - | |
| routes | router 的路由栈信息 | [routes\[\]](#routes) | - | |
| separator | 分隔符自定义 | string \| ReactNode | `/` | |
| separator | 分隔符自定义 | ReactNode | `/` | |
### Breadcrumb.Item
@@ -31,14 +31,14 @@ cover: https://gw.alipayobjects.com/zos/alicdn/9Ltop8JwH/Breadcrumb.svg
| --- | --- | --- | --- | --- |
| dropdownProps | 弹出下拉菜单的自定义配置 | [Dropdown](/components/dropdown) | - | |
| href | 链接的目的地 | string | - | |
| onClick | 单击事件 | (e:MouseEvent) => void | - | |
| overlay | 下拉菜单的内容 | [Menu](/components/menu) \| () => Menu | - | |
| onClick | 单击事件 | (e:MouseEvent) => void | - | |
### Breadcrumb.Separator
| 参数 | 说明 | 类型 | 默认值 | 版本 |
| -------- | -------------- | ------------------- | ------ | ---- |
| children | 要显示的分隔符 | string \| ReactNode | `/` | |
| 参数 | 说明 | 类型 | 默认值 | 版本 |
| --- | --- | --- | --- | --- |
| children | 要显示的分隔符 | ReactNode | `/` | |
> 注意:在使用 `Breadcrumb.Separator` 时,其父组件的分隔符必须设置为 `separator=""`,否则会出现父组件默认的分隔符。

View File

@@ -1,5 +1,6 @@
import '../../style/index.less';
import './index.less';
// style dependencies
import '../../menu/style';
import '../../dropdown/style';

View File

@@ -1,8 +1,3 @@
@import '../../style/themes/index';
@import '../../style/mixins/index';
@breadcrumb-prefix-cls: ~'@{ant-prefix}-breadcrumb';
.@{breadcrumb-prefix-cls} {
&-rtl {
.clearfix;

View File

@@ -16,7 +16,7 @@ const getRealWidth = (node: HTMLElement) => ({
transform: 'scale(1)',
});
export default function LoadingIcon({ prefixCls, loading, existIcon }: LoadingIconProps) {
const LoadingIcon: React.FC<LoadingIconProps> = ({ prefixCls, loading, existIcon }) => {
const visible = !!loading;
if (existIcon) {
@@ -50,3 +50,5 @@ export default function LoadingIcon({ prefixCls, loading, existIcon }: LoadingIc
</CSSMotion>
);
}
export default LoadingIcon;

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