diff --git a/.codesandbox/ci.json b/.codesandbox/ci.json index baa4107aaa..f1a673ee16 100644 --- a/.codesandbox/ci.json +++ b/.codesandbox/ci.json @@ -1,3 +1,3 @@ { - "sandboxes": ["wk04r016q8"] + "sandboxes": ["antd-reproduction-template-6e93z"] } diff --git a/.eslintignore b/.eslintignore index 90a47e0b0d..5b7a025679 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,6 +1,5 @@ components/**/*.js components/**/*.jsx -components/*/__tests__/type.tsx !components/*/__tests__/**/*.js !components/*/demo/* !.*.js diff --git a/.eslintrc.js b/.eslintrc.js index 554fe35282..19efb2da44 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -56,6 +56,7 @@ const eslintrc = { 'jsx-a11y/anchor-has-content': 0, 'jsx-a11y/click-events-have-key-events': 0, 'jsx-a11y/anchor-is-valid': 0, + 'jsx-a11y/no-noninteractive-element-interactions': 0, 'comma-dangle': ['error', 'always-multiline'], 'react/jsx-filename-extension': 0, 'react/state-in-constructor': 0, diff --git a/.github/workflows/deploy-site.yml b/.github/workflows/deploy-site.yml index 52f5c2fc5e..51db244ab1 100644 --- a/.github/workflows/deploy-site.yml +++ b/.github/workflows/deploy-site.yml @@ -19,9 +19,11 @@ jobs: run: npm run predeploy - name: deploy - uses: peaceiris/actions-gh-pages@v2.5.0 + uses: peaceiris/actions-gh-pages@v2 env: - ACTIONS_DEPLOY_KEY: ${{ secrets.ACCESS_TOKEN }} + ACTIONS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }} + # PERSONAL_TOKEN: ${{ secrets.PERSONAL_TOKEN }} + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} PUBLISH_BRANCH: gh-pages PUBLISH_DIR: ./_site with: diff --git a/.github/workflows/lighthouse-ci.yml b/.github/workflows/lighthouse-ci.yml new file mode 100644 index 0000000000..9bb66ebce9 --- /dev/null +++ b/.github/workflows/lighthouse-ci.yml @@ -0,0 +1,19 @@ +name: Lighthouse +on: push +jobs: + lighthouse: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - name: Audit URLs using Lighthouse + uses: treosh/lighthouse-ci-action@v2 + with: + urls: | + https://ant.design + https://ant.design/docs/react/introduce-cn + https://ant.design/components/button-cn + - name: Save results + uses: actions/upload-artifact@v1 + with: + name: lighthouse-results + path: '.lighthouseci' # This will save the Lighthouse results as .json files diff --git a/.jest.js b/.jest.js index be5659849c..e360991e71 100644 --- a/.jest.js +++ b/.jest.js @@ -31,7 +31,7 @@ module.exports = { '!components/*/style/index.tsx', '!components/style/index.tsx', '!components/*/locale/index.tsx', - '!components/*/__tests__/**/type.tsx', + '!components/*/__tests__/type.test.tsx', '!components/**/*/interface.{ts,tsx}', ], transformIgnorePatterns, diff --git a/AUTHORS.txt b/AUTHORS.txt index d06afae4d0..b311c53818 100644 --- a/AUTHORS.txt +++ b/AUTHORS.txt @@ -2,17 +2,26 @@ 17073025 <17073025@cnsuning.com> 282159468 <282159468@qq.com> 778758944 <778758944@qq.com> +Aaron Cawte Aaron Planell López Aditya Padhi Adrian Dimitrov +Ahmad Abdelaziz Ahmed AlSammany +Aidin +Aiello <770540123@qq.com> Alan Braithwaite Albert Zheng Albert 理斯特 +Alberto Marchetti Aleck Landgraf +Aleksandr Chernokondratenko +Alex Simons Alexander Alexander Anpleenko +Alexander Kachkaev Alexander Suevalov +Alexander.Kosov Alexandre Kirszenberg Alexey Yakovlev Alfred Qiu @@ -28,21 +37,32 @@ Andrew Shearer Andrey G Andrzej Dybionka André +Andrés +Ankit Babbar +Aobo Yang Ardo Kusuma Arnab Sen Arthur Denner Oliveira Santos +Artin Arvin Xu Ash Kumar +Ashot Mnatsakanyan +Aymen Bouchekoua BK Heleth Babajide Fowotade Barry Bartek +Ben Callaway Benedikt Franke +Benjamin Amelot Benjamin Kniffler Benjy Cui Benoît Latinier Bernie +Bestie +Bhavesh Chowdhury Bilal Sirazitdinov +Bill Searle Bill Sheikh Bo Chen Bolun Zhang @@ -61,9 +81,11 @@ Cam Song Camol Cang Ta Canwen Xu +Carlos Coves Prieto Carter Feldman Catalin Miron Cee Cirno +Cemre Mengu Chandler Moisen Chang Wang Charles Covey-Brandt @@ -75,8 +97,10 @@ Chris Kelly ChrisFan Christian Christian Vadalà +Christophe Hurpeau Christopher Deutsch Chuang Yu +Chuck Claudio Restifo Cody Chan Colton Pierson @@ -89,21 +113,32 @@ Daewoong Moon Damian Green Damian Green Dan Minshew +Dana Janoskova Dane David +Daniel Chang Daniel Gomez +Daniel Harrison Danny Hoower Antonio Viasus Avila +Daphne Won Daqi Song Darren Poon +David Broder-Rodgers David Hatten David Schneider +Dean van Niekerk DengYun +Denis +DiamondYuan <541832074@qq.com> +DiamondYuan Dimitri Mitropoulos +Dmitriy Dmitriy Mironov Dmitry Bolotin Dmitry Gladkikh Dmitry Guryev Dmitry Manannikov Dmitry Snegirev +Dmitry Tikhomirov Dorian DosLin Douglas Mason @@ -118,34 +153,44 @@ Eden Wang Eduardo Ludi Edward <7047924@qq.com> Egor Yurtaev +Eldar Mustafaiev Eli White Emerson Laurentino Emma +Ender Lee Eric <84263800@qq.com> Eric Celeste Eric Turriff Erwann Mest +Eusen <179530591@qq.com> Evgeny Kuznetsov Eward Song Federico Marcos +Ferdi Koomen Fergus Leung Fernando Giarritiello Florian Orpelière Flynn For177 +Frezc Gabe Medrash Gabriel Nunes +GalenWong Gao Jiangmiao Gautier Geoff Holden George Gray +Gin-X Go7hic +Goh Zhao Yang Graeme Yeates Graeme Yeates Grant Klinsing Gray Choi Guan Hao Guan Yu Pan (Jacky) +Guichi Zhao +Hami Abdi HJin.me Hai Phan Nguyen Haibin Yu @@ -155,12 +200,18 @@ Hanz Luo Harlan HarlanLuo Haroen Viaene +Harry.Hou Harshit Mehrotra +He Linming Heaven Henri Normak HeskeyBaozi +HiddenMan <1196089730@qq.com> Hieu Ho +Hieu Pham Higor Araújo dos Anjos +Hsuan Lee +Hsuan Lee Hubert Argasinski Hughen <446370503@163.com> Hugo LEHMANN @@ -168,12 +219,16 @@ Igor Igor G Ilan Ilan Hasanov +Ilya Bondarenko ImJoeHs <865439601@qq.com> Inclined.Z Infinity <305870677@qq.com> +Inian +Ivan Ivan Kravets Ivan Trofimov Ivo Stratev +Jack Jack Hsieh Jack Lo Jack Works @@ -182,19 +237,30 @@ Jacques Kvam JaePil Jung Jake Richards James +James Tsang JamesYin Jaroslav Bereza +Jarvis1010 +Jason Jason Chen +Jason Chung +Jason Yin Jean-Luc Sorak Jeffrey Carl Faden +Jelle de Jong +Jennie JeromeLin Jerry Bendy Jesper We Jiabin Peng Jialei +Jiawei Huang Jieraaa <842533841@qq.com> Jin ZHANG +JinXin Jing Ma +Jingsong Gao +Jinke Li <1359518268@qq.com> Jinxuan Zhu Joao Rabelo Joe @@ -202,90 +268,124 @@ Joe Hsu Johannes Loewe John Johnson III John Nguyen +Johnsen Jonatas Walker +Jonathan Lee <1150974628@qq.com> Jonny Buchanan Jordan Hornblow Josue Peralta Josué JribiBelhassen +JuFeng Zhang +Juan Carlos Lloret H Juan Rodrigo Venegas Boesch Julia Passynkova +Julien Confetti Junyu Zhan +Juraj Carnogursky Justin Reich Kaien Liao +Kamal Mahmudi Kasra Bigdeli +Kelvin Chu Kenaniah Cerny Kenneth Luján Rosas Kenneth Truong KentonYu <975853613@qq.com> Kevin Ivan Kevin Wang +Kevinaskin KgTong +Khaled Khalifa Lame Kian +Kieren Kiho · Cham +Kim, Harim +Kimmo Saari Kimmo Saari Kirill Alexander Khalitov Kirill Stiopin Knacktus +Kodai Nakamura Konrad Machlowski Kyle Kelley Kyle Rosenberg LLinFan- +LT246-VINHNPH\vinhnph Laith Larry Laski +LaySent LeeHarlan <709886167@qq.com> LeezQ Leo +Leon Koole Leon Shi Leon Shi Li Chao +LilyWakana <873435892@qq.com> +Liming Jin +Liu Ya Liu Yang LongYinan Lucien Lee Ludwig Bäcklund Lyndon001 +M Mitchell MG12 Ma Tianxiao Maciej Czekaj Madis Väin Maksym Mosyura +Malven Manjit Kumar Manweill MaoYiWei <137308365@qq.com> +Marcel Jackwerth Marcela Bomfim +Marcio Pamplona Marco Afonso Marcus Bransbury Marius Ileana Mars Wong Marshall Chen +Martin Cermak Martin Litvaj Martin Novák Mathew +Mathieu Anderson +Matias Orellana Matt Lein Max Maximilian Meyer Meck +Meck Zhu MeiLin Meow-z <372086270@qq.com> Miaow +Michael Adams Michael Krog Michael Salaverry +Michael Salaverry Michael Wang +Michal Pekar Michalis Macheras Michelle Zhang Mikasa33 Min MinJeong Kim +MinYuan Ming Hann Minqi Pan Minsung Ryu +Minwei Xu Mitchell Demler Mohamed Seada Mohammad Faisal Mohan Ban Mounish Sai Mr.Tone +MrHeer MuYu Mário Gonçalves Nathan Broadbent @@ -298,6 +398,8 @@ Nekron Neverland Nico Nidhi Agarwal +Nihal Saxena +Nikitenkova Niko Autio Nikolay Nikolay Solovyov @@ -306,8 +408,10 @@ Nimo Nishant Arora Nokecy OAwan +Olaniyi Philip Ojeyinka Oleg Kuzava Oleksandr Kovalchuk +Olivier Louvignes Ooi Yee Wei Open Next Oren Kosto @@ -320,16 +424,20 @@ Peter Peter Berg Phanupong Janthapoon Philip Oliver +Phyllis Pierre Pierre Neter +Piotr Monwid-Olechnowicz Piper Chester Pixy Yuan Pooya Parsa Pyiner Pyroboomka QC-L +Qhan W Qiaosen Huang Qingrong Ke +Radomir Skrzepij Rafael Cosman Rahul Gurung Rallets @@ -338,47 +446,70 @@ Ran Byron Randy RaoHai Raphael Chauveau +Ray Booysen +Ray Booysen +Rayron Victor Reed Sun +Regan Langford +Renovate Bot Rex Ricardo Raphael Joson Richard D. Worth Rick Zhou Robert Wilkinson +Rodrigo Ehlers Rohan Malhotra Rongjian Zhang Rrrandom RunningCoderLee +Rustin +Rustin-Liu RyanHui SHEN Lin +Sagar Jain Sakol Assawasagool +Salavat Gizatov <100ishundred@gmail.com> Sam Chen Sam Lanning Sam Maxwell Samuel Gaus +Sanghyeon Lee Sangle Sanjay Kumar Sanjay Kumar Scott Sturgeon Sean Lin Sean Sun +Sean Willis Sebastian Blade Sebastian Busch +Sebastian Busch Sebastian Busch +Sergey Levkovich Sergey Volynkin Sergio Crisostomo +Sevak Shawn Sit +ShiCheng ShiTengFei +ShuYu Wang Shuai Chen Shubham Kanodia Shun Shuvalov Anton SimaQ Simo Aleksandrov -Sivaraj S +Sivaraj +SoraYama Spencer +Stanley Thijssen +Stanley Thijssen Stephen Esser +Stevche Radevski Subroto Sven Efftinge +SylvanasGone <397009765@qq.com> +TTC <345866517@qq.com> Tao Tao Zhang Taylor Sabell @@ -387,18 +518,22 @@ Teng YANG Tengjiao Cai Terence The Rock +Theo Satloff <1golfball@gmail.com> Thibault Derousseaux Thiebaud Thomas Thomas +Thomas Ladd Tino D Tom Gao Tom Xu Tom Xu TomIsion Tomás Francisco +Tomáš Hylský Tomáš Szabo Trotyl Yu Troy Thompson +TsesamLi Tyler Ubaldo Quintana Vadim Macagon @@ -406,6 +541,8 @@ Valentin Vichnal Van Nguyen Vemund Santi Vic <709147950@qq.com> +Victor Repkow +Vijay Thirugnanam Vincent Zhang Vitaliy Mazurenko ViviaRui @@ -420,17 +557,23 @@ Warren Seymour Wei Zhu Wenchao Hu Wendell +Wensheng Xu +Will Will Chen +William Cai WingGao Wu Haotian XBTop1! +XTY <^@xty.dev> Xiaoming Xie Guanglei +Xinxing Li Xiping.wang <527409987@qq.com> XuMM_12 Yang <504021398@qq.com> Yang Bin Yangzhedi +Yann Normand Yasin Uslu Yevhen Hryhorevskyi Yiming @@ -445,27 +588,36 @@ Yusuke Ito Yuwei Ba Yuxuan Huo YuyingWu +ZYSzys Zack Craig Zap Zhang Zhi Zheeeng Zhiqiang Gong +Zhuo Chen Ziluo Zohaib Ijaz +Zzzen <843968788@qq.com> aashutoshrathi +adam afc163 agent-z <1607291079@qq.com> ahalimkara +alekslario alex <379118572@qq.com> +alex89lj <379118572@qq.com> alexchen amedora arifemrecelik ascoders <576625322@qq.com> ashishg-qburst +atomoo bLue +babycannotsay <335658202@qq.com> bang bang88 baozefeng <727751065@qq.com> +binyellow <571704908@qq.com> blankzust <450811238@qq.com> bukas byuanama @@ -477,14 +629,22 @@ cathayandy cc189 chaofeis <408067385@qq.com> chchen +chen shuai +chen wen jun <731028571@qq.com> chencheng (云谦) chencheng +chenlong +chenshuai2144 +chisus chunlea cjahv clinyong +cnjs <1269075501@qq.com> codesign corneyl +damon.chen david.lv +david.lv davidhatten ddcat1115 decade @@ -493,6 +653,7 @@ denzw dependabot[bot] detailyang devqin +dian.li digz6666 djorkaeff duzliang @@ -501,15 +662,21 @@ edgji eidonjoe <806488716@qq.com> elios elrrrrrrr +eruca ezpub feng zhi hao fengmk2 +fkysly flashback313 frezc <504021398@qq.com> genie gregahren guifu +gxvv gyh9457 +haianweifeng <1531297152@qq.com> +haimrait +handy handycode hank hanpei <75189218@qq.com> @@ -522,10 +689,13 @@ hengkx henryv0 hi-caicai hongxuWei +howard huangyan.py huishiyi huzzbuzz iamcastelli +iamkun +ikobe ilanus imhele imosapatryk @@ -539,6 +709,7 @@ jasonslyvia jasonxia23 jiajiangxu jiang <155259966@qq.com> +jiang.an jim jinouwuque jinyaqiao1102 <405782493@QQ.com> @@ -547,13 +718,20 @@ junjing.zhang kacjay <45483388@qq.com> kagawagao kaifei <150641329@qq.com> +kailunyao +kanweiwei <475801900@qq.com> +kanweiwei +kapiroska kasinooya +kavin kayw kdenz kdepp keng kenve keqingrong +kermolaev +klouskingsley ko konakona kossel @@ -565,13 +743,18 @@ leadream <857098475@qq.com> lehug leijingdao leon.shi +lewis liu <897473127@qq.com> lgmcolin lgmcolin +lhx +lhyt <515593899@qq.com> liangfei liekkas lihqi <455711093@qq.com> lilun littleLane <857183384@qq.com> +liuchuzhang +liuchuzhang lixiaochou077 lixiaoyang lixiaoyang1992 @@ -580,16 +763,21 @@ lizhen loganpowell luyiming lvren +lxnxbnq lyhper mArker <252133226@qq.com> maks +maximest-pierre +melchior voidwolf memoryza mgrdevport +mingyan.yu mitchell.demler mkermani144 mmmveggies mofelee monkindey +moonrailgun mraiguo <810158465@qq.com> mraiguo mushan0x0 @@ -597,21 +785,27 @@ muzea muzuiget natergj neekey +ngolin nick-ChenZe niko <644506165@qq.com> nikogu <644506165@qq.com> +nnecec nuintun ohhoney1 <1269075501@qq.com> +oldchicken orzorzorzorz +orzyyyy paranoidjk parlop pbrink231 pd4d10 peiming +pengtikui <949828390@qq.com> picodoth picodoth pinggod pizn +plainnany plandem popomore qiaojie <1454763497@qq.com> @@ -620,14 +814,18 @@ qliu <1403927509@qq.com> qubaoming ravirambles richardison +riho <873435892@qq.com> ryangun ryanhoho ryannz sadmark sallen450 +saxenanihal95 sdli <1669375803@qq.com> sfturing shangyuan.ning +shao +shaodahong shawtung shelwin shenlin192@gmail.com @@ -645,9 +843,11 @@ sosohime spideeee stevenyuysy stickmy +susiwen swindme sylvanasGone <397009765@qq.com> syssam +tangjinzhou <21251118@zju.edu.cn> tangjinzhou <415800467@qq.com> tangjinzhou taoweicn @@ -655,52 +855,76 @@ thegatheringstorm thilo-behnke tianli.zhao <275287902@qq.com> tom +tom +toshi1127 twobin u3u undefined +unknown ustccjw <317713370@qq.com> +vagusX valleykid +vaytsel +veveue vgeyi +wadezhan wangshantao <605682551@qq.com> wangshuai wangtao0101 wangxiaolei +wangxing wangxingkang <156148958@qq.com> wangxingkang wangxueliang wanli warmhug +wenhong +whinc whtang906 +willc001 wizawu +wleven <408493323@qq.com> wonyun +woodsand +wtzeng1 +wwwxy wwwxy80s wx1322 <289758716@qq.com> xiaofan2406 +xiaohuoni <448627663@qq.com> +xrkffgg +xuqiang y-take yangwukang yangxiaolin ycjcl868 <45808948@qq.com> +ye4241 yeliex yibu.wang yiminanci yiminghe +yinjs yociduo yoyo837 yubozhao yuche +yuezk z zack +zefeng zelongc zerob4wl zhangguanyu02 zhangpc zhangyangxue <383632607@qq.com> +zhangzh zhaocai zhaopeidong zhujun24 zhuyue zilong zinkey +zjf zlljqn zollero zombieJ @@ -708,22 +932,31 @@ zombiej zongzi531 ztplz zuiidea +zx6658 zy410419243 +zytjs °))))彡 爱but的苍蝇 <354788473@qq.com> +Ștefan Filip 高力 <3071730@qq.com> 郑旭 <332171564@qq.com> 拷钉 <41830859@qq.com> +蒋璇 <645762213@qq.com> 苏秦 <646382806@qq.com> +陈杰 <810158465@qq.com> 竹尔 偏右 +黄斌 英布 朮厃 张聪 诸岳 +诸岳 逸达 诸岳 +啸生 +迷渡 二哲 廖星 刘红 @@ -736,6 +969,7 @@ zy410419243 松子 何乐 付引 +萧琚 可乐 山客 曾凯 @@ -743,6 +977,8 @@ zy410419243 信鑫-King <45808948@qq.com> 广彬-梁 <326741518@qq.com> 小哈husky <951565664@qq.com> +诸葛龙 <158362530@qq.com> +李环冀 <158757774@qq.com> 何志勇 <15988134176@163.com> 徐坤龙 <272992168@qq.com> 黄子毅 <576625322@qq.com> @@ -750,22 +986,27 @@ zy410419243 崔宏森 <948346354@qq.com> 黄文鉴 董天成 +龚方闻 方剑成 陈广亮 包子熊 闲耘™ 一喵呜 +王林涛 黄俊亮 吕立青 隋鑫磊 米老朱 +刘宏玺 乔奕轩 马斯特 +廖应龙 王集鹄 徐新航 杨哲迪 柚子男 愚指导 +只捱宅 郭延豪(708674) 愚指导-TZ 杨小事er @@ -773,5 +1014,8 @@ zy410419243 超能刚哥 马金花儿 रोहन मल्होत्रा +芝华塔尼欧 <1150974628@qq.com> 白羊座小葛 薛定谔的猫 +二货机器人 +骗你是小猫咪 diff --git a/CHANGELOG.en-US.md b/CHANGELOG.en-US.md index 29ce8d0e21..6f744b0c96 100644 --- a/CHANGELOG.en-US.md +++ b/CHANGELOG.en-US.md @@ -15,6 +15,56 @@ timeline: true --- +## 3.26.4 + +`2019-12-22` + +- 💄 Optimize Steps `subTitle` UI when `labelPlacement="vertical"`. [#20325](https://github.com/ant-design/ant-design/pull/20325) +- 🐞 Fix upload preview not support ico file type issue. [#20375](https://github.com/ant-design/ant-design/pull/20375) [@Rustin-Liu](https://github.com/Rustin-Liu) +- 🐞 Fix Form feedback icon combine Input `suffix` display not correct. [#20363](https://github.com/ant-design/ant-design/pull/20363) +- 🐞 Fix Tag `onClick` been triggered when close it. [#20355](https://github.com/ant-design/ant-design/pull/20355) +- 🐞 Fix Cascader component form check color trigger issue. [#20347](https://github.com/ant-design/ant-design/pull/20347) [@xrkffgg](https://github.com/xrkffgg) +- 🐞 Disallow auto focus input after triggering `onSearch` event in mobile and tablet devices. [#20332](https://github.com/ant-design/ant-design/pull/20332) [@YaoKaiLun](https://github.com/YaoKaiLun) +- 🐞 Fix Tabs ink bar missing transition animation. [#20283](https://github.com/ant-design/ant-design/pull/20283) +- 🐞 Fix TreeNode without `icon` show white block in `showIcon` mode. [#20274](https://github.com/ant-design/ant-design/pull/20274) +- TypeScript + - ⚡️ Update filters define in Table `onChange`. [#20337](https://github.com/ant-design/ant-design/pull/20337) [@MrHeer](https://github.com/MrHeer) + +## 3.26.3 + +`2019-12-14` + +- 🛠 support `unpkg` field in `package.json`. [#20193](https://github.com/ant-design/ant-design/pull/20193) +- 🐞 Fix Tree `showLine` and `showIcon` missing icon. [#20196](https://github.com/ant-design/ant-design/pull/20196) +- 🐞 Fix Modal combine Drawer cause invalid scroll problem. [#20242](https://github.com/ant-design/ant-design/pull/20242) +- 🐞 Fix Drawer `switchScrollingEffect prop on a DOM element` warning. [#20175](https://github.com/ant-design/ant-design/pull/20175) +- 🐞 Fix Select Option `label` definition. [#20190](https://github.com/ant-design/ant-design/pull/20190) [@ZhechenLi](https://github.com/ZhechenLi) +- 💄 Optimize Form feedback icon padding. [#20164](https://github.com/ant-design/ant-design/pull/20164) [@Satloff](https://github.com/Satloff) +- 💄 Add less variables for Select/Cascader to optimize dropdown padding and border radius. [#20156](https://github.com/ant-design/ant-design/pull/20156) [@Satloff](https://github.com/Satloff) + +## 3.26.2 + +`2019-12-10` + +- 🐞 Fix DatePicker `disabledTime` TypeScript definition to be optional. [#20153](https://github.com/ant-design/ant-design/pull/20153) [@khaledkhalil94](https://github.com/khaledkhalil94) +- 🐞 Fix Transfer's `title` of `dataSource` TypeScript definition to be optional. [#20144](https://github.com/ant-design/ant-design/pull/20144) [@mraiguo](https://github.com/mraiguo) + +## 3.26.1 + +`2019-12-09` + +- 🐞 Fix List pagination options text align. [#20037](https://github.com/ant-design/ant-design/issues/20037) +- 🐞 Fix Button text not align well in Chrome. [#20059](https://github.com/ant-design/ant-design/pull/20059) +- 🐞 Fix DescriptionItem `className` error applied to label. [#20067](https://github.com/ant-design/ant-design/pull/20067) [@Liu-Ya](https://github.com/Liu-Ya) +- 🐞 Fix Tree duplicated icons when `showLine` is true. [#20090](https://github.com/ant-design/ant-design/issues/20090) +- 🐞 Fix Editable Typography flush in Firefox. [#20118](https://github.com/ant-design/ant-design/pull/20118) +- 🐞 Improve Icon `component` definition to be compatible with create-react-app svg component. [#20142](https://github.com/ant-design/ant-design/pull/20142) +- Table + - 🐞 Fix small table header border missing. [#20030](https://github.com/ant-design/ant-design/issues/20030) + - 🐞 Fix `filterIcon` throws error when render string or number. + - 🐞 Fix `filterIcon` shows wrong title when returns Tooltip. [#20049](https://github.com/ant-design/ant-design/issues/20049) + - 🐞 Fix columns have 9px align issue in Windows Chrome. [#19952](https://github.com/ant-design/ant-design/issues/19952) + ## 3.26.0 `2019-12-01` diff --git a/CHANGELOG.zh-CN.md b/CHANGELOG.zh-CN.md index cef8fbcc28..6a1da57c26 100644 --- a/CHANGELOG.zh-CN.md +++ b/CHANGELOG.zh-CN.md @@ -15,6 +15,56 @@ timeline: true --- +## 3.26.4 + +`2019-12-22` + +- 💄 优化 Steps `subTitle` 在 `labelPlacement="vertical"` 下的展现方式。[#20325](https://github.com/ant-design/ant-design/pull/20325) +- 🐞 修复 Upload 组件预览不支持 `.ico` 文件问题。[#20375](https://github.com/ant-design/ant-design/pull/20375) [@Rustin-Liu](https://github.com/Rustin-Liu) +- 🐞 修复 Form feedback 图标结合 Input `suffix` 显示不正确。[#20363](https://github.com/ant-design/ant-design/pull/20363) +- 🐞 修复 Tag 关闭时 `onClick` 被触发的问题。[#20355](https://github.com/ant-design/ant-design/pull/20355) +- 🐞 修复 Cascader 组件 Form 校验触发时,鼠标悬浮显示颜色问题。[#20347](https://github.com/ant-design/ant-design/pull/20347) [@xrkffgg](https://github.com/xrkffgg) +- 🐞 修复移动端点击搜索后,自动聚焦输入框,导致弹出键盘的问题。[#20332](https://github.com/ant-design/ant-design/pull/20332) [@YaoKaiLun](https://github.com/YaoKaiLun) +- 🐞 修复 Tabs 高亮条宽度的 `transition` 过度动画失效的问题。[#20283](https://github.com/ant-design/ant-design/pull/20283) +- 🐞 修复 TreeNode 不设置 `icon` 时会展示一个空白占位的问题。[#20274](https://github.com/ant-design/ant-design/pull/20274) +- TypeScript + - ⚡️ 更新 Table `onChange` 中 `filters` 的定义。[#20337](https://github.com/ant-design/ant-design/pull/20337) [@MrHeer](https://github.com/MrHeer) + +## 3.26.3 + +`2019-12-14` + +- 🛠 antd `package.json` 中补充 `unpkg` 字段。[#20193](https://github.com/ant-design/ant-design/pull/20193) +- 🐞 修复 Tree `showLine` 和 `showIcon` 同时开启时 `[+]` `[-]` 图标丢失的问题。[#20196](https://github.com/ant-design/ant-design/pull/20196) +- 🐞 修复 Modal 和 Drawer 结合使用时导致滚动失效的问题。[#20242](https://github.com/ant-design/ant-design/pull/20242) +- 🐞 修复 Drawer `switchScrollingEffect prop on a DOM element` 警告。[#20175](https://github.com/ant-design/ant-design/pull/20175) +- 🐞 修复 Select Option 的 `label` 属性定义。[#20190](https://github.com/ant-design/ant-design/pull/20190) [@ZhechenLi](https://github.com/ZhechenLi) +- 💄 优化 Form 反馈图标的间距样式。[#20164](https://github.com/ant-design/ant-design/pull/20164) [@Satloff](https://github.com/Satloff) +- 💄 Select/Cascader 新增和优化边距 padding 和圆角的相关 less 变量。[#20156](https://github.com/ant-design/ant-design/pull/20156) [@Satloff](https://github.com/Satloff) + +## 3.26.2 + +`2019-12-10` + +- 🐞 修正 DatePicker `disabledTime` 属性 TypeScript 定义为可选。[#20153](https://github.com/ant-design/ant-design/pull/20153) [@khaledkhalil94](https://github.com/khaledkhalil94) +- 🐞 修正 Transfer `dataSource` 的 `title` 属性 TypeScript 定义为可选。[#20144](https://github.com/ant-design/ant-design/pull/20144) [@mraiguo](https://github.com/mraiguo) + +## 3.26.1 + +`2019-12-09` + +- 🐞 修复 List 下分页选项文本对齐问题。[#20037](https://github.com/ant-design/ant-design/issues/20037) +- 🐞 修复 Chrome 下 Button 文字没有垂直居中的问题。[#20059](https://github.com/ant-design/ant-design/pull/20059) +- 🐞 修复 DescriptionItem 的 `className` 错误应用于 label。[#20067](https://github.com/ant-design/ant-design/pull/20067) [@Liu-Ya](https://github.com/Liu-Ya) +- 🐞 修复 Tree `showLine` 为 true 时展示多余图标的问题。[#20090](https://github.com/ant-design/ant-design/issues/20090) +- 🐞 修复 Typography 可编辑组件在 Firefox 下闪动的问题。[#20118](https://github.com/ant-design/ant-design/pull/20118) +- 🐞 修复 Icon `component` 的定义,使其兼容于 create-react-app 的 svg 组件定义。[#20142](https://github.com/ant-design/ant-design/pull/20142) +- Table + - 🐞 修复小号 Table 表头边框丢失的问题。[#20030](https://github.com/ant-design/ant-design/issues/20030) + - 🐞 修复 `filterIcon` 返回字符串或数字时报错的问题。 + - 🐞 修复 `filterIcon` 返回 Tooltip 时显示了错误的 `title`。[#20049](https://github.com/ant-design/ant-design/issues/20049) + - 🐞 修复在 Windows Chrome 下固定列有 9px 的对齐问题。[#19952](https://github.com/ant-design/ant-design/issues/19952) + ## 3.26.0 `2019-12-01` diff --git a/README-zh_CN.md b/README-zh_CN.md index aa59baaf1c..1838df0fcb 100644 --- a/README-zh_CN.md +++ b/README-zh_CN.md @@ -24,10 +24,12 @@ ## ✨ 特性 -- 提炼自企业级中后台产品的交互语言和视觉风格。 -- 开箱即用的高质量 React 组件。 -- 使用 TypeScript 构建,提供完整的类型定义文件。 -- 全链路开发和设计工具体系。 +- 🌈 提炼自企业级中后台产品的交互语言和视觉风格。 +- 📦 开箱即用的高质量 React 组件。 +- 🛡 使用 TypeScript 开发,提供完整的类型定义文件。 +- ⚙️ 全链路开发和设计工具体系。 +- 🌍 数十个国际化语言支持。 +- 🎨 深入每个细节的主题定制能力。 ## 🖥 支持环境 @@ -51,20 +53,25 @@ yarn add antd ## 🔨 示例 -```jsx -import { DatePicker } from 'antd'; -ReactDOM.render(, mountNode); -``` +````jsx +import { Button, DatePicker } from 'antd'; + +const App = () => ( + <> + + + +); 引入样式: ```jsx import 'antd/dist/antd.css'; // or 'antd/dist/antd.less' -``` +```` -你也可以 [按需加载组件](https://ant.design/docs/react/getting-started-cn#按需加载)。 +你也可以使用 [babel-plugin-import](https://ant.design/docs/react/getting-started-cn#按需加载)。 -### TypeScript +### 🛡 TypeScript 参考 [在 TypeScript 中使用](https://ant.design/docs/react/use-in-typescript-cn) @@ -121,7 +128,7 @@ $ npm start [![Let's fund issues in this repository](https://issuehunt.io/static/embed/issuehunt-button-v1.svg)](https://issuehunt.io/repos/34526884) -## 社区互助 +## 👥 社区互助 如果您在使用的过程中碰到问题,可以通过下面几个途径寻求帮助,同时我们也鼓励资深用户通过下面的途径给新人提供帮助。 diff --git a/README.md b/README.md index 0009fa8486..1a54c58627 100644 --- a/README.md +++ b/README.md @@ -24,10 +24,12 @@ English | [简体中文](./README-zh_CN.md) ## ✨ Features -- An enterprise-class UI design system for web applications. -- A set of high-quality React components out of the box. -- Written in TypeScript with predictable static types. -- The whole package of development and design resources and tools. +- 🌈 Enterprise-class UI designed for web applications. +- 📦 A set of high-quality React components out of the box. +- 🛡 Written in TypeScript with predictable static types. +- ⚙️ Whole package of design resources and development tools. +- 🌍 Internationalization support for dozens of languages. +- 🎨 Powerful theme customization in every detail. ## 🖥 Environment Support @@ -52,8 +54,14 @@ yarn add antd ## 🔨 Usage ```jsx -import { DatePicker } from 'antd'; -ReactDOM.render(, mountNode); +import { Button, DatePicker } from 'antd'; + +const App = () => ( + <> + + + +); ``` And import style manually: @@ -62,7 +70,7 @@ And import style manually: import 'antd/dist/antd.css'; // or 'antd/dist/antd.less' ``` -Or [import components on demand](https://ant.design/docs/react/getting-started#Import-on-Demand). +Or use [babel-plugin-import](https://ant.design/docs/react/getting-started#Import-on-Demand). ### TypeScript diff --git a/components/button/style/index.less b/components/button/style/index.less index b6dd6cf53d..cbcd5246e5 100644 --- a/components/button/style/index.less +++ b/components/button/style/index.less @@ -12,7 +12,15 @@ // Button styles // ----------------------------- .@{btn-prefix-cls} { - line-height: @line-height-base; + // Fixing https://github.com/ant-design/ant-design/issues/12978 + // Fixing https://github.com/ant-design/ant-design/issues/20058 + // Fixing https://github.com/ant-design/ant-design/issues/19972 + // Fixing https://github.com/ant-design/ant-design/issues/12978 + // Fixing https://github.com/ant-design/ant-design/issues/18107 + // Fixing https://github.com/ant-design/ant-design/issues/13214 + // It is a render problem of chrome, which is only happened in the codesandbox demo + // 0.001px solution works and I don't why + line-height: @line-height-base - 0.001; .btn; .btn-default; @@ -87,6 +95,10 @@ &-icon-only { .btn-square(@btn-prefix-cls); + + > i { + vertical-align: middle; + } } &-round { diff --git a/components/cascader/style/index.less b/components/cascader/style/index.less index ee1f0d1a68..09e696803b 100644 --- a/components/cascader/style/index.less +++ b/components/cascader/style/index.less @@ -125,7 +125,7 @@ &-menus { position: absolute; z-index: @zindex-dropdown; - font-size: @font-size-base; + font-size: @cascader-dropdown-font-size; white-space: nowrap; background: @cascader-menu-bg; border-radius: @border-radius-base; @@ -134,7 +134,6 @@ ul, ol { margin: 0; - padding: 0; list-style: none; } @@ -165,7 +164,7 @@ min-width: 111px; height: 180px; margin: 0; - padding: 0; + padding: @cascader-dropdown-edge-child-vertical-padding 0; overflow: auto; vertical-align: top; list-style: none; @@ -185,8 +184,8 @@ } } &-menu-item { - padding: 5px @control-padding-horizontal; - line-height: 22px; + padding: @cascader-dropdown-vertical-padding @control-padding-horizontal; + line-height: @cascader-dropdown-line-height; white-space: nowrap; cursor: pointer; transition: all 0.3s; diff --git a/components/config-provider/index.en-US.md b/components/config-provider/index.en-US.md index 9c462c5522..16d8d72f5d 100644 --- a/components/config-provider/index.en-US.md +++ b/components/config-provider/index.en-US.md @@ -51,3 +51,23 @@ Some components use dynamic style to support wave effect. You can config `csp` p #### Does the locale problem still exist in DatePicker even if ConfigProvider `locale` is used? Please make sure you set moment locale by `moment.locale('zh-cn')` or that you don't have two different versions of moment. + +#### Modal throw error when setting `getPopupContainer`? + +Related issue: https://github.com/ant-design/ant-design/issues/19974 + +When you config `getPopupContainer` to parentNode globally, Modal will throw error of `triggerNode is undefined` because it did not have a triggerNode. You can try the [fix](https://github.com/afc163/feedback-antd/commit/3e4d1ad1bc1a38460dc3bf3c56517f737fe7d44a) below. + +```diff + triggerNode.parentNode} ++ getPopupContainer={node => { ++ if (node) { ++ return node.parentNode; ++ } ++ return document.body; ++ }} + > + + +``` diff --git a/components/config-provider/index.zh-CN.md b/components/config-provider/index.zh-CN.md index fe233c3467..5395751b63 100644 --- a/components/config-provider/index.zh-CN.md +++ b/components/config-provider/index.zh-CN.md @@ -52,3 +52,23 @@ return ( #### 为什么我使用了 ConfigProvider `locale`,时间类组件的国际化还有问题? 请检查是否设置了 `moment.locale('zh-cn')`,或者是否有两个版本的 moment 共存。 + +#### 配置 `getPopupContainer` 导致 Modal 报错? + +相关 issue:https://github.com/ant-design/ant-design/issues/19974 + +当如下全局设置 `getPopupContainer` 为触发节点的 parentNode 时,由于 Modal 的用法不存在 `triggerNode`,这样会导致 `triggerNode is undefined` 的报错,需要增加一个[判断条件](https://github.com/afc163/feedback-antd/commit/3e4d1ad1bc1a38460dc3bf3c56517f737fe7d44a)。 + +```diff + triggerNode.parentNode} ++ getPopupContainer={node => { ++ if (node) { ++ return node.parentNode; ++ } ++ return document.body; ++ }} + > + + +``` diff --git a/components/date-picker/interface.tsx b/components/date-picker/interface.tsx new file mode 100644 index 0000000000..a745881eaa --- /dev/null +++ b/components/date-picker/interface.tsx @@ -0,0 +1,117 @@ +import * as React from 'react'; +import * as moment from 'moment'; +import { TimePickerProps } from '../time-picker'; +import { tuple } from '../_util/type'; + +export interface PickerProps { + id?: number | string; + name?: string; + prefixCls?: string; + inputPrefixCls?: string; + format?: string | string[]; + disabled?: boolean; + allowClear?: boolean; + className?: string; + pickerClass?: string; + pickerInputClass?: string; + suffixIcon?: React.ReactNode; + style?: React.CSSProperties; + popupStyle?: React.CSSProperties; + dropdownClassName?: string; + locale?: any; + size?: 'large' | 'small' | 'default'; + getCalendarContainer?: (triggerNode: Element) => HTMLElement; + open?: boolean; + onOpenChange?: (status: boolean) => void; + disabledDate?: (current: moment.Moment | null) => boolean; + dateRender?: (current: moment.Moment, today: moment.Moment) => React.ReactNode; + autoFocus?: boolean; + onFocus?: React.FocusEventHandler; + onBlur?: (e: React.SyntheticEvent) => void; +} + +export interface SinglePickerProps { + value?: moment.Moment | null; + defaultValue?: moment.Moment | null; + defaultPickerValue?: moment.Moment | null; + placeholder?: string; + renderExtraFooter?: (mode: DatePickerMode) => React.ReactNode; + onChange?: (date: moment.Moment | null, dateString: string) => void; +} + +const DatePickerModes = tuple('time', 'date', 'month', 'year', 'decade'); +export type DatePickerMode = typeof DatePickerModes[number]; + +export interface DatePickerProps extends PickerProps, SinglePickerProps { + showTime?: TimePickerProps | boolean; + showToday?: boolean; + open?: boolean; + disabledTime?: ( + current?: moment.Moment | null, + ) => { + disabledHours?: () => number[]; + disabledMinutes?: () => number[]; + disabledSeconds?: () => number[]; + }; + onOpenChange?: (status: boolean) => void; + onPanelChange?: (value: moment.Moment | null, mode: DatePickerMode) => void; + onOk?: (selectedTime: moment.Moment | null) => void; + mode?: DatePickerMode; +} + +export interface MonthPickerProps extends PickerProps, SinglePickerProps { + monthCellContentRender?: (date: moment.Moment, locale: any) => React.ReactNode; +} + +export type RangePickerValue = + | undefined[] + | null[] + | [moment.Moment] + | [undefined, moment.Moment] + | [moment.Moment, undefined] + | [null, moment.Moment] + | [moment.Moment, null] + | [moment.Moment, moment.Moment]; +export type RangePickerPresetRange = RangePickerValue | (() => RangePickerValue); + +export interface RangePickerProps extends PickerProps { + className?: string; + tagPrefixCls?: string; + value?: RangePickerValue; + defaultValue?: RangePickerValue; + defaultPickerValue?: RangePickerValue; + timePicker?: React.ReactNode; + onChange?: (dates: RangePickerValue, dateStrings: [string, string]) => void; + onCalendarChange?: (dates: RangePickerValue, dateStrings: [string, string]) => void; + onOk?: (selectedTime: RangePickerPresetRange) => void; + showTime?: TimePickerProps | boolean; + showToday?: boolean; + ranges?: { + [range: string]: RangePickerPresetRange; + }; + placeholder?: [string, string]; + mode?: string | string[]; + separator?: React.ReactNode; + disabledTime?: ( + current: RangePickerValue, + type: string, + ) => { + disabledHours?: () => number[]; + disabledMinutes?: () => number[]; + disabledSeconds?: () => number[]; + }; + onPanelChange?: (value?: RangePickerValue, mode?: string | string[]) => void; + renderExtraFooter?: () => React.ReactNode; + onMouseEnter?: (e: React.MouseEvent) => void; + onMouseLeave?: (e: React.MouseEvent) => void; +} + +export interface WeekPickerProps extends PickerProps, SinglePickerProps { + // - currently no own props - +} + +export interface DatePickerDecorator extends React.ClassicComponentClass { + RangePicker: React.ClassicComponentClass; + MonthPicker: React.ClassicComponentClass; + WeekPicker: React.ClassicComponentClass; +} diff --git a/components/date-picker/style/index.less b/components/date-picker/style/index.less index 4550d4d0c2..61c0243dd9 100644 --- a/components/date-picker/style/index.less +++ b/components/date-picker/style/index.less @@ -6,6 +6,14 @@ @picker-prefix-cls: ~'@{ant-prefix}-picker'; @picker-text-height: 40px; +.picker-padding(@input-height, @font-size, @padding-horizontal) { + // font height probably 22.0001, So use floor better + @font-height: floor(@font-size * @line-height-base) + 2; + @padding-top: (@input-height - @font-height) / 2; + @padding-bottom: @input-height - @font-height - @padding-top; + padding: @padding-top @padding-horizontal @padding-bottom; +} + .@{picker-prefix-cls} { @vertical-fix-base: @input-height-base - ceil(@font-size-base * @line-height-base) - 2 * @input-padding-vertical-base - 2 * @border-width-base; @@ -16,9 +24,9 @@ @arrow-size: 10px; .reset-component; + .picker-padding(@input-height-base, @font-size-base, @input-padding-horizontal-base); display: inline-flex; - padding: @input-padding-vertical-base @input-padding-horizontal-base @input-padding-vertical-base + - @vertical-fix-base; + align-items: center; background: @picker-bg; border: @border-width-base @border-style-base @select-border-color; border-radius: @border-radius-base; @@ -75,8 +83,7 @@ // Size &-large { - padding: @input-padding-vertical-lg @input-padding-horizontal-lg @input-padding-vertical-lg + - @vertical-fix-lg; + .picker-padding(@input-height-lg, @font-size-lg, @input-padding-horizontal-lg); .@{picker-prefix-cls}-input > input { font-size: @font-size-lg; @@ -84,8 +91,7 @@ } &-small { - padding: @input-padding-vertical-sm @input-padding-horizontal-sm @input-padding-vertical-sm + - @vertical-fix-sm; + .picker-padding(@input-height-sm, @font-size-base, @input-padding-horizontal-sm); } &-suffix { diff --git a/components/descriptions/Col.tsx b/components/descriptions/Col.tsx index f147597dfc..73932a6ce6 100644 --- a/components/descriptions/Col.tsx +++ b/components/descriptions/Col.tsx @@ -14,7 +14,7 @@ const Col: React.SFC = props => { const { child, bordered, colon, type, layout } = props; const { prefixCls, label, className, children, span = 1 } = child.props; const labelProps: any = { - className: classNames(`${prefixCls}-item-label`, className, { + className: classNames(`${prefixCls}-item-label`, { [`${prefixCls}-item-colon`]: colon, [`${prefixCls}-item-no-label`]: !label, }), diff --git a/components/descriptions/__tests__/__snapshots__/index.test.js.snap b/components/descriptions/__tests__/__snapshots__/index.test.js.snap index ccbcd11d13..cb6ccf3e34 100644 --- a/components/descriptions/__tests__/__snapshots__/index.test.js.snap +++ b/components/descriptions/__tests__/__snapshots__/index.test.js.snap @@ -192,7 +192,7 @@ exports[`Descriptions Descriptions.Item support className 1`] = ` colSpan={1} > Product diff --git a/components/descriptions/index.en-US.md b/components/descriptions/index.en-US.md index 376da341dd..1da8de8a0c 100644 --- a/components/descriptions/index.en-US.md +++ b/components/descriptions/index.en-US.md @@ -1,7 +1,7 @@ --- category: Components type: Data Display -title: Description List +title: Descriptions cols: 1 --- diff --git a/components/dropdown/__tests__/__snapshots__/demo.test.js.snap b/components/dropdown/__tests__/__snapshots__/demo.test.js.snap index 08ccf8e1cf..6ef7656803 100644 --- a/components/dropdown/__tests__/__snapshots__/demo.test.js.snap +++ b/components/dropdown/__tests__/__snapshots__/demo.test.js.snap @@ -30,12 +30,12 @@ exports[`renders ./components/dropdown/demo/basic.md correctly 1`] = ` `; exports[`renders ./components/dropdown/demo/context-menu.md correctly 1`] = ` - - Right Click on Me - + Right Click on here + `; exports[`renders ./components/dropdown/demo/dropdown-button.md correctly 1`] = ` diff --git a/components/dropdown/demo/context-menu.md b/components/dropdown/demo/context-menu.md index a6621d53ee..03809d55c9 100644 --- a/components/dropdown/demo/context-menu.md +++ b/components/dropdown/demo/context-menu.md @@ -26,7 +26,17 @@ const menu = ( ReactDOM.render( - Right Click on Me +
+ Right Click on here +
, mountNode, ); diff --git a/components/dropdown/style/index.less b/components/dropdown/style/index.less index 4922ec7975..588e61d1ca 100644 --- a/components/dropdown/style/index.less +++ b/components/dropdown/style/index.less @@ -49,7 +49,7 @@ &-menu { position: relative; margin: 0; - padding: 4px 0; + padding: @dropdown-edge-child-vertical-padding 0; text-align: left; list-style-type: none; background-color: @dropdown-menu-bg; @@ -116,6 +116,18 @@ } } + &:first-child { + & when (@dropdown-edge-child-vertical-padding = 0) { + border-radius: @border-radius-base @border-radius-base 0 0; + } + } + + &:last-child { + & when (@dropdown-edge-child-vertical-padding = 0) { + border-radius: 0 0 @border-radius-base @border-radius-base; + } + } + &-selected, &-selected > a { color: @dropdown-selected-color; diff --git a/components/form/__tests__/__snapshots__/demo.test.js.snap b/components/form/__tests__/__snapshots__/demo.test.js.snap index 2e937796df..b4b4247f32 100644 --- a/components/form/__tests__/__snapshots__/demo.test.js.snap +++ b/components/form/__tests__/__snapshots__/demo.test.js.snap @@ -5109,6 +5109,235 @@ exports[`renders ./components/form/demo/validate-static.md correctly 1`] = ` +
+
+ +
+
+
+ + + + + + + + + +
+
+
+
+
+ +
+
+
+ + + + + + + + + + + + + +
+
+
+
+
+ +
+
+
+ + + + + + + + + + + + + +
+
+
`; diff --git a/components/form/demo/inline-login.md b/components/form/demo/inline-login.md index 5f71424f2e..293aa9ca5b 100644 --- a/components/form/demo/inline-login.md +++ b/components/form/demo/inline-login.md @@ -21,7 +21,7 @@ const HorizontalLoginForm = () => { const [form] = Form.useForm(); const [, forceUpdate] = React.useState(); - // To disabled submit button at the beginning. + // To disable submit button at the beginning. React.useEffect(() => { forceUpdate({}); }, []); diff --git a/components/form/demo/validate-static.md b/components/form/demo/validate-static.md index beabd6ef7b..f97ac2acb1 100644 --- a/components/form/demo/validate-static.md +++ b/components/form/demo/validate-static.md @@ -119,6 +119,18 @@ ReactDOM.render( + + + + + + + + + + + + , mountNode, ); diff --git a/components/icon/__tests__/logo.svg b/components/icon/__tests__/logo.svg new file mode 100644 index 0000000000..e69de29bb2 diff --git a/components/input/Search.tsx b/components/input/Search.tsx index a53c7ef3ec..9fd4f566fd 100644 --- a/components/input/Search.tsx +++ b/components/input/Search.tsx @@ -1,7 +1,6 @@ import * as React from 'react'; import classNames from 'classnames'; import { SearchOutlined, LoadingOutlined } from '@ant-design/icons'; - import Input, { InputProps } from './Input'; import Button from '../button'; import { ConfigConsumer, ConfigConsumerProps } from '../config-provider'; @@ -40,6 +39,12 @@ export default class Search extends React.Component { } }; + onMouseDown: React.MouseEventHandler = e => { + if (document.activeElement === this.input.input) { + e.preventDefault(); + } + }; + onSearch = (e: React.MouseEvent | React.KeyboardEvent) => { const { onSearch, loading, disabled } = this.props; if (loading || disabled) { @@ -48,7 +53,6 @@ export default class Search extends React.Component { if (onSearch) { onSearch(this.input.input.value, e); } - this.input.focus(); }; focus() { @@ -116,6 +120,7 @@ export default class Search extends React.Component { (enterButtonAsElement.type as typeof Button).__ANT_BUTTON === true; if (isAntdButton || enterButtonAsElement.type === 'button') { button = React.cloneElement(enterButtonAsElement, { + onMouseDown: this.onMouseDown, onClick: this.onSearch, key: 'enterButton', ...(isAntdButton @@ -133,6 +138,7 @@ export default class Search extends React.Component { size={size} disabled={disabled} key="enterButton" + onMouseDown={this.onMouseDown} onClick={this.onSearch} > {enterButton === true ? : enterButton} diff --git a/components/list/style/index.less b/components/list/style/index.less index 0833390edb..3687103516 100644 --- a/components/list/style/index.less +++ b/components/list/style/index.less @@ -15,6 +15,11 @@ &-pagination { margin-top: 24px; text-align: right; + + // https://github.com/ant-design/ant-design/issues/20037 + .@{ant-prefix}-pagination-options { + text-align: left; + } } &-more { diff --git a/components/select/style/index.less b/components/select/style/index.less index 2a9ca3284f..37a1fd4298 100644 --- a/components/select/style/index.less +++ b/components/select/style/index.less @@ -184,10 +184,11 @@ position: relative; display: block; min-height: 32px; - padding: 5px @control-padding-horizontal; + padding: @select-dropdown-vertical-padding @control-padding-horizontal; color: @text-color; font-weight: normal; - line-height: 22px; + font-size: @select-dropdown-font-size; + line-height: @select-dropdown-line-height; } &-item-empty { diff --git a/components/spin/index.en-US.md b/components/spin/index.en-US.md index 7a41a05b44..c500f16b80 100644 --- a/components/spin/index.en-US.md +++ b/components/spin/index.en-US.md @@ -15,7 +15,7 @@ When part of the page is waiting for asynchronous data or during a rendering pro | Property | Description | Type | Default Value | | --- | --- | --- | --- | | delay | specifies a delay in milliseconds for loading state (prevent flush) | number (milliseconds) | - | -| indicator | React node of the spinning indicator | ReactElement | - | +| indicator | React node of the spinning indicator | ReactNode | - | | size | size of Spin, options: `small`, `default` and `large` | string | `default` | | spinning | whether Spin is spinning | boolean | true | | tip | customize description content when Spin has children | string | - | @@ -23,4 +23,6 @@ When part of the page is waiting for asynchronous data or during a rendering pro ### Static Method -- `Spin.setDefaultIndicator(indicator: ReactElement)` As `indicator`, you can define the global default spin element +- `Spin.setDefaultIndicator(indicator: ReactNode)` + + You can define default spin element globally. \ No newline at end of file diff --git a/components/spin/index.zh-CN.md b/components/spin/index.zh-CN.md index 72d37c3da7..bd4a8f4a75 100644 --- a/components/spin/index.zh-CN.md +++ b/components/spin/index.zh-CN.md @@ -16,7 +16,7 @@ subtitle: 加载中 | 参数 | 说明 | 类型 | 默认值 | | ---------------- | -------------------------------------------- | ------------- | --------- | | delay | 延迟显示加载效果的时间(防止闪烁) | number (毫秒) | - | -| indicator | 加载指示符 | ReactElement | - | +| indicator | 加载指示符 | ReactNode | - | | size | 组件大小,可选值为 `small` `default` `large` | string | 'default' | | spinning | 是否为加载中状态 | boolean | true | | tip | 当作为包裹元素时,可以自定义描述文案 | string | - | @@ -24,4 +24,6 @@ subtitle: 加载中 ### 静态方法 -- `Spin.setDefaultIndicator(indicator: ReactElement)` 同上 `indicator`,你可以自定义全局默认元素 +- `Spin.setDefaultIndicator(indicator: ReactNode)` + + 你可以自定义全局默认 Spin 的元素。 diff --git a/components/steps/style/index.less b/components/steps/style/index.less index b60a32e59c..22b367d7da 100644 --- a/components/steps/style/index.less +++ b/components/steps/style/index.less @@ -26,7 +26,7 @@ @steps-dot-size: 8px; @steps-current-dot-size: 10px; @steps-desciption-max-width: 140px; -@steps-nav-content-max-width: @steps-desciption-max-width; +@steps-nav-content-max-width: auto; .@{steps-prefix-cls} { .reset-component; diff --git a/components/steps/style/label-placement.less b/components/steps/style/label-placement.less index 4ac04b4fa4..9d816e586e 100644 --- a/components/steps/style/label-placement.less +++ b/components/steps/style/label-placement.less @@ -2,19 +2,18 @@ .@{steps-prefix-cls}-item { overflow: visible; &-tail { - margin-left: 51px; + margin-left: 58px; padding: 3.5px 24px; } &-content { display: block; - // icon左边距离+一半icon宽度,是content一半的宽度,垂直对齐icon - width: (@steps-icon-size / 2 + 36px) * 2; + width: (@steps-icon-size / 2 + 42px) * 2; margin-top: 8px; text-align: center; } &-icon { display: inline-block; - margin-left: 36px; + margin-left: 42px; } &-title { padding-right: 0; @@ -22,6 +21,12 @@ display: none; } } + &-subtitle { + display: block; + margin-bottom: 4px; + margin-left: 0; + line-height: @line-height-base; + } } &.@{steps-prefix-cls}-small:not(.@{steps-prefix-cls}-dot) { .@{steps-prefix-cls}-item { diff --git a/components/style/themes/default.less b/components/style/themes/default.less index 4cca767e7c..4daab0b9eb 100644 --- a/components/style/themes/default.less +++ b/components/style/themes/default.less @@ -311,6 +311,7 @@ //Dropdown @dropdown-menu-bg: @component-background; @dropdown-vertical-padding: 5px; +@dropdown-edge-child-vertical-padding: 4px; @dropdown-font-size: @font-size-base; @dropdown-line-height: 22px; @@ -366,6 +367,9 @@ @select-dropdown-bg: @component-background; @select-item-selected-bg: @primary-1; @select-item-active-bg: @item-hover-bg; +@select-dropdown-vertical-padding: @dropdown-vertical-padding; +@select-dropdown-font-size: @dropdown-font-size; +@select-dropdown-line-height: @dropdown-line-height; @select-background: @component-background; @select-clear-background: @select-background; @select-selection-item-bg: @background-color-base; @@ -378,6 +382,13 @@ @cascader-menu-bg: @component-background; @cascader-menu-border-color-split: @border-color-split; +// Cascader +// ---- +@cascader-dropdown-vertical-padding: @dropdown-vertical-padding; +@cascader-dropdown-edge-child-vertical-padding: @dropdown-edge-child-vertical-padding; +@cascader-dropdown-font-size: @dropdown-font-size; +@cascader-dropdown-line-height: @dropdown-line-height; + // Anchor // --- @anchor-bg: @component-background; diff --git a/components/table/__tests__/Table.filter.test.js b/components/table/__tests__/Table.filter.test.js index 46bc1c6aeb..4bedd60370 100644 --- a/components/table/__tests__/Table.filter.test.js +++ b/components/table/__tests__/Table.filter.test.js @@ -3,6 +3,7 @@ import React from 'react'; import { mount } from 'enzyme'; import Table from '..'; import Input from '../../input'; +import Tooltip from '../../tooltip'; import Button from '../../button'; import ConfigProvider from '../../config-provider'; @@ -688,6 +689,40 @@ describe('Table.filter', () => { expect(wrapper.find('.customize-icon').render()).toMatchSnapshot(); }); + it('renders custom filter icon as string correctly', () => { + const filterIcon = () => 'string'; + const wrapper = mount( + createTable({ + columns: [ + { + ...column, + filterIcon, + }, + ], + }), + ); + expect(wrapper.render()).toMatchSnapshot(); + }); + + it('renders custom filter icon with right Tooltip title', () => { + const filterIcon = () => ( + + Tooltip + + ); + const wrapper = mount( + createTable({ + columns: [ + { + ...column, + filterIcon, + }, + ], + }), + ); + expect(wrapper.render()).toMatchSnapshot(); + }); + // https://github.com/ant-design/ant-design/issues/13028 it('reset dropdown filter correctly', () => { class Demo extends React.Component { diff --git a/components/table/__tests__/__snapshots__/Table.filter.test.js.snap b/components/table/__tests__/__snapshots__/Table.filter.test.js.snap index 8c016a6133..6d488b92ce 100644 --- a/components/table/__tests__/__snapshots__/Table.filter.test.js.snap +++ b/components/table/__tests__/__snapshots__/Table.filter.test.js.snap @@ -50,6 +50,108 @@ exports[`Table.filter renders custom content correctly 1`] = ` `; +exports[`Table.filter renders custom filter icon as string correctly 1`] = ` +
+
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + +
+
+ + Name + + + + string + + +
+
+ Jack +
+ Lucy +
+ Tom +
+ Jerry +
+
+
+
+
+
+
+`; + exports[`Table.filter renders custom filter icon correctly 1`] = ` `; +exports[`Table.filter renders custom filter icon with right Tooltip title 1`] = ` +
+
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + +
+
+ + Name + + + + + Tooltip + +
+
+
+
+ +
+
+
+ + +
+
+ Jack +
+ Lucy +
+ Tom +
+ Jerry +
+
+
+
+
+
+
+`; + exports[`Table.filter renders filter correctly 1`] = `
record.name.indexOf(value) === 0, diff --git a/components/table/interface.tsx b/components/table/interface.tsx index 4e4abe0765..d6e9b0d10d 100644 --- a/components/table/interface.tsx +++ b/components/table/interface.tsx @@ -96,7 +96,8 @@ export interface ColumnGroupType extends ColumnType { export type ColumnsType = ( | ColumnGroupType - | ColumnType)[]; + | ColumnType +)[]; export interface SelectionItem { key: string; diff --git a/components/tabs/style/index.less b/components/tabs/style/index.less index f716a5a04f..b9d735dc40 100644 --- a/components/tabs/style/index.less +++ b/components/tabs/style/index.less @@ -29,6 +29,7 @@ left: 0; z-index: 1; box-sizing: border-box; + width: 0; height: 2px; background-color: @tabs-ink-bar-color; transform-origin: 0 0; @@ -330,7 +331,7 @@ bottom: auto; left: auto; width: 2px; - height: auto; + height: 0; } .@{tab-prefix-cls}-tab-next { @@ -403,12 +404,12 @@ .@{tab-prefix-cls}-top .@{tab-prefix-cls}-ink-bar-animated, .@{tab-prefix-cls}-bottom .@{tab-prefix-cls}-ink-bar-animated { - transition: transform 0.3s @ease-in-out, width 0.3s @ease-in-out, left 0.3s @ease-in-out; + transition: transform 0.3s @ease-in-out, width 0.2s @ease-in-out, left 0.3s @ease-in-out; } .@{tab-prefix-cls}-left .@{tab-prefix-cls}-ink-bar-animated, .@{tab-prefix-cls}-right .@{tab-prefix-cls}-ink-bar-animated { - transition: transform 0.3s @ease-in-out, height 0.3s @ease-in-out, top 0.3s @ease-in-out; + transition: transform 0.3s @ease-in-out, height 0.2s @ease-in-out, top 0.3s @ease-in-out; } // No animation diff --git a/components/tag/__tests__/index.test.js b/components/tag/__tests__/index.test.js index f7aeb3cb98..8fbf06e6da 100644 --- a/components/tag/__tests__/index.test.js +++ b/components/tag/__tests__/index.test.js @@ -39,6 +39,16 @@ describe('Tag', () => { expect(wrapper.find('.ant-tag:not(.ant-tag-hidden)').length).toBe(1); }); + // https://github.com/ant-design/ant-design/issues/20344 + it('should not trigger onClick when click close icon', () => { + const onClose = jest.fn(); + const onClick = jest.fn(); + const wrapper = mount(); + wrapper.find('.anticon-close').simulate('click'); + expect(onClose).toHaveBeenCalled(); + expect(onClick).not.toHaveBeenCalled(); + }); + describe('visibility', () => { it('can be controlled by visible with visible as initial value', () => { const wrapper = mount(); diff --git a/components/tag/index.tsx b/components/tag/index.tsx index d76f3695a7..6a99d75d43 100644 --- a/components/tag/index.tsx +++ b/components/tag/index.tsx @@ -87,6 +87,7 @@ class Tag extends React.Component { } handleIconClick = (e: React.MouseEvent) => { + e.stopPropagation(); this.setVisible(false, e); }; diff --git a/components/transfer/index.tsx b/components/transfer/index.tsx index 427f035351..585a9b3683 100644 --- a/components/transfer/index.tsx +++ b/components/transfer/index.tsx @@ -25,7 +25,7 @@ type TransferRender = (item: TransferItem) => RenderResult; export interface TransferItem { key: string; - title: string; + title?: string; description?: string; disabled?: boolean; [name: string]: any; diff --git a/components/tree-select/index.en-US.md b/components/tree-select/index.en-US.md index 7c093df318..8fa4537af2 100644 --- a/components/tree-select/index.en-US.md +++ b/components/tree-select/index.en-US.md @@ -40,7 +40,7 @@ Tree selection control. | suffixIcon | The custom suffix icon | ReactNode | - | | | treeCheckable | Whether to show checkbox on the treeNodes | boolean | false | | | treeCheckStrictly | Whether to check nodes precisely (in the `checkable` mode), means parent and child nodes are not associated, and it will make `labelInValue` be true | boolean | false | | -| treeData | Data of the treeNodes, manual construction work is no longer needed if this property has been set(ensure the Uniqueness of each value) | array\<{ value, title, children, \[disabled, disableCheckbox, selectable] }> | \[] | | +| treeData | Data of the treeNodes, manual construction work is no longer needed if this property has been set(ensure the Uniqueness of each value) | array\<{ value, title, children, \[disabled, disableCheckbox, selectable, checkable] }> | \[] | | | treeDataSimpleMode | Enable simple mode of treeData. Changes the `treeData` schema to: \[{id:1, pId:0, value:'1', title:"test1",...},...] where pId is parent node's id). It is possible to replace the default `id` and `pId` keys by providing object to `treeDataSimpleMode` | false\|object\<{ id: string, pId: string, rootPId: string }> | false | | | treeDefaultExpandAll | Whether to expand all treeNodes by default | boolean | false | | | treeDefaultExpandedKeys | Default expanded treeNodes | string\[] | - | | @@ -67,6 +67,7 @@ Tree selection control. | Property | Description | Type | Default | Version | | --- | --- | --- | --- | --- | | selectable | can be selected | boolean | true | | +| checkable | When Tree is checkable, set TreeNode display Checkbox or not | boolean | - | | | disableCheckbox | Disables the checkbox of the treeNode | boolean | false | | | disabled | Disabled or not | boolean | false | | | isLeaf | Leaf node or not | boolean | false | | diff --git a/components/tree-select/index.zh-CN.md b/components/tree-select/index.zh-CN.md index a29cb7477c..88223cee75 100644 --- a/components/tree-select/index.zh-CN.md +++ b/components/tree-select/index.zh-CN.md @@ -41,7 +41,7 @@ title: TreeSelect | suffixIcon | 自定义的选择框后缀图标 | ReactNode | - | | | treeCheckable | 显示 checkbox | boolean | false | | | treeCheckStrictly | checkable 状态下节点选择完全受控(父子节点选中状态不再关联),会使得 `labelInValue` 强制为 true | boolean | false | | -| treeData | treeNodes 数据,如果设置则不需要手动构造 TreeNode 节点(value 在整个树范围内唯一) | array\<{value, title, children, \[disabled, disableCheckbox, selectable]}> | \[] | | +| treeData | treeNodes 数据,如果设置则不需要手动构造 TreeNode 节点(value 在整个树范围内唯一) | array\<{value, title, children, \[disabled, disableCheckbox, selectable, checkable]}> | \[] | | | treeDataSimpleMode | 使用简单格式的 treeData,具体设置参考可设置的类型 (此时 treeData 应变为这样的数据结构: \[{id:1, pId:0, value:'1', title:"test1",...},...], `pId` 是父节点的 id) | false\|object\<{ id: string, pId: string, rootPId: string }> | false | | | treeDefaultExpandAll | 默认展开所有树节点 | boolean | false | | | treeDefaultExpandedKeys | 默认展开的树节点 | string\[] | - | | @@ -68,6 +68,7 @@ title: TreeSelect | 参数 | 说明 | 类型 | 默认值 | 版本 | | --- | --- | --- | --- | --- | | selectable | 是否可选 | boolean | true | | +| checkable | 当树为 checkable 时,设置独立节点是否展示 Checkbox | boolean | - | | | disableCheckbox | 禁掉 checkbox | boolean | false | | | disabled | 是否禁用 | boolean | false | | | isLeaf | 是否是叶子节点 | boolean | false | | diff --git a/components/tree/__tests__/__snapshots__/demo.test.js.snap b/components/tree/__tests__/__snapshots__/demo.test.js.snap index 75ee6836bd..3be9963ae3 100644 --- a/components/tree/__tests__/__snapshots__/demo.test.js.snap +++ b/components/tree/__tests__/__snapshots__/demo.test.js.snap @@ -1770,360 +1770,391 @@ exports[`renders ./components/tree/demo/dynamic.md correctly 1`] = ` `; exports[`renders ./components/tree/demo/line.md correctly 1`] = ` -
+
- + showLine: + +
+
+ showIcon: +
-
-
+
+ +
+
+
- - + + - - - parent 1 - - -
-
- - +
-
-
-
-
-
diff --git a/components/tree/__tests__/__snapshots__/index.test.js.snap b/components/tree/__tests__/__snapshots__/index.test.js.snap new file mode 100644 index 0000000000..b2d2cdd869 --- /dev/null +++ b/components/tree/__tests__/__snapshots__/index.test.js.snap @@ -0,0 +1,118 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`Tree icon and switcherIcon of Tree with showLine should render correctly 1`] = ` +
+
+ +
+
+
+
+
+ + switcherIcon + + + + icon + + + --- + + +
+
+ + switcherIcon + + + + + --- + + +
+
+ + + + + + + + + --- + + +
+
+
+
+
+`; diff --git a/components/tree/__tests__/index.test.js b/components/tree/__tests__/index.test.js new file mode 100644 index 0000000000..5b0b067bed --- /dev/null +++ b/components/tree/__tests__/index.test.js @@ -0,0 +1,33 @@ +import React from 'react'; +import { mount } from 'enzyme'; +import Tree from '../index'; + +const { TreeNode } = Tree; + +describe('Tree', () => { + it('icon and switcherIcon of Tree with showLine should render correctly', () => { + const wrapper = mount( + + + + + + + + + + + + + + + + + + + + , + ); + expect(wrapper.render()).toMatchSnapshot(); + }); +}); diff --git a/components/tree/demo/line.md b/components/tree/demo/line.md index 033e81983a..75c3e8b415 100644 --- a/components/tree/demo/line.md +++ b/components/tree/demo/line.md @@ -2,54 +2,86 @@ order: 5 title: zh-CN: 连接线 - en-US: Tree With Line + en-US: Tree with line --- ## zh-CN -带连接线的树。 +节点之间带连接线的树,常用于文件目录结构展示。使用 `showLine` 开启,可以用 `switcherIcon` 修改默认图标。 ## en-US -Tree With Line +Tree with connected line between nodes, turn on by `showLine`, customize the preseted icon by `switcherIcon`. ```tsx -import { Tree } from 'antd'; +import { Tree, Switch } from 'antd'; +import { CarryOutOutlined, FormOutlined } from '@ant-design/icons'; const treeData = [ { title: 'parent 1', key: '0-0', + icon: , children: [ { title: 'parent 1-0', key: '0-0-0', + icon: , children: [ - { title: 'leaf', key: '0-0-0-0' }, - { title: 'leaf', key: '0-0-0-1' }, - { title: 'leaf', key: '0-0-0-2' }, + { title: 'leaf', key: '0-0-0-0', icon: }, + { title: 'leaf', key: '0-0-0-1', icon: }, + { title: 'leaf', key: '0-0-0-2', icon: }, ], }, { title: 'parent 1-1', key: '0-0-1', - children: [{ title: 'leaf', key: '0-0-1-0' }], + icon: , + children: [{ title: 'leaf', key: '0-0-1-0', icon: }], }, { title: 'parent 1-2', key: '0-0-2', - children: [{ title: 'leaf', key: '0-0-2-0' }, { title: 'leaf', key: '0-0-2-1' }], + icon: , + children: [ + { title: 'leaf', key: '0-0-2-0', icon: }, + { + title: 'leaf', + key: '0-0-2-1', + icon: , + switcherIcon: , + }, + ], }, ], }, ]; const Demo: React.FC<{}> = () => { + const [showLine, setShowLine] = React.useState(true); + const [showIcon, setShowIcon] = React.useState(false); + const onSelect = (selectedKeys, info) => { console.log('selected', selectedKeys, info); }; - return ; + return ( +
+
+ showLine: +
+
+ showIcon: +
+ +
+ ); }; ReactDOM.render(, mountNode); diff --git a/components/tree/index.en-US.md b/components/tree/index.en-US.md index 8595aa9ed5..0033ebc42e 100644 --- a/components/tree/index.en-US.md +++ b/components/tree/index.en-US.md @@ -38,7 +38,7 @@ Almost anything can be represented in a tree structure. Examples include directo | showIcon | Shows the icon before a TreeNode's title. There is no default style; you must set a custom style for it if set to `true` | boolean | false | | switcherIcon | customize collapse/expand icon of tree node | React.ReactElement | - | | showLine | Shows a connecting line | boolean | false | -| onCheck | Callback function for when the onCheck event occurs | function(checkedKeys, e:{checked: bool, checkedNodes, node, event}) | - | +| onCheck | Callback function for when the onCheck event occurs | function(checkedKeys, e:{checked: bool, checkedNodes, node, event, halfCheckedKeys}) | - | | onDragEnd | Callback function for when the onDragEnd event occurs | function({event, node}) | - | | onDragEnter | Callback function for when the onDragEnter event occurs | function({event, node, expandedKeys}) | - | | onDragLeave | Callback function for when the onDragLeave event occurs | function({event, node}) | - | diff --git a/components/tree/index.zh-CN.md b/components/tree/index.zh-CN.md index 77cce4c092..acb013cbc3 100644 --- a/components/tree/index.zh-CN.md +++ b/components/tree/index.zh-CN.md @@ -39,7 +39,7 @@ subtitle: 树形控件 | showIcon | 是否展示 TreeNode title 前的图标,没有默认样式,如设置为 true,需要自行定义图标相关样式 | boolean | false | | switcherIcon | 自定义树节点的展开/折叠图标 | React.ReactElement | - | | showLine | 是否展示连接线 | boolean | false | -| onCheck | 点击复选框触发 | function(checkedKeys, e:{checked: bool, checkedNodes, node, event}) | - | +| onCheck | 点击复选框触发 | function(checkedKeys, e:{checked: bool, checkedNodes, node, event, halfCheckedKeys}) | - | | onDragEnd | dragend 触发时调用 | function({event, node}) | - | | onDragEnter | dragenter 触发时调用 | function({event, node, expandedKeys}) | - | | onDragLeave | dragleave 触发时调用 | function({event, node}) | - | diff --git a/components/typography/Editable.tsx b/components/typography/Editable.tsx index 441c895b0a..6d743612eb 100644 --- a/components/typography/Editable.tsx +++ b/components/typography/Editable.tsx @@ -1,7 +1,7 @@ import * as React from 'react'; import KeyCode from 'rc-util/lib/KeyCode'; +import classNames from 'classnames'; import { EnterOutlined } from '@ant-design/icons'; - import TextArea from '../input/TextArea'; interface EditableProps { @@ -114,7 +114,7 @@ class Editable extends React.Component { const { prefixCls, 'aria-label': ariaLabel, className, style } = this.props; return ( -
+