mirror of
https://github.com/ant-design/ant-design.git
synced 2026-02-09 19:09:21 +08:00
Compare commits
154 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b6a617f2e9 | ||
|
|
1a790a5a9f | ||
|
|
2a411130bc | ||
|
|
bf22853f41 | ||
|
|
4101d182e0 | ||
|
|
14dbcb95ed | ||
|
|
14fa376dff | ||
|
|
6a3e6f55cf | ||
|
|
fa5491a390 | ||
|
|
4ad5985df7 | ||
|
|
bb720aaab9 | ||
|
|
8ab4aeb9c4 | ||
|
|
e444dc5e39 | ||
|
|
631596022e | ||
|
|
7ee2eca848 | ||
|
|
15c6d58796 | ||
|
|
2078354bc5 | ||
|
|
a95209cf55 | ||
|
|
26f35280a8 | ||
|
|
f4ae9294c0 | ||
|
|
572ae5ce14 | ||
|
|
0d0632b2f3 | ||
|
|
410fb50f44 | ||
|
|
a9f4a6cc85 | ||
|
|
163f2aae64 | ||
|
|
05d6d80e3d | ||
|
|
1f39cbf36a | ||
|
|
9aa914922d | ||
|
|
9ba7818b69 | ||
|
|
81adba222d | ||
|
|
22bfc68f33 | ||
|
|
10aaee0e27 | ||
|
|
fbad7efacb | ||
|
|
bbf3163cc2 | ||
|
|
069e9207a9 | ||
|
|
649d733048 | ||
|
|
7eb2792072 | ||
|
|
d0d69fbf13 | ||
|
|
61e4f8011a | ||
|
|
d7f9270a6f | ||
|
|
a7513bfac1 | ||
|
|
f0660836b7 | ||
|
|
d4a0cf8054 | ||
|
|
1cc7ebc03b | ||
|
|
d0906c6661 | ||
|
|
61502ef942 | ||
|
|
04b3aad451 | ||
|
|
2604623b7e | ||
|
|
0eb835772d | ||
|
|
c0e60f8097 | ||
|
|
05a522c343 | ||
|
|
ad721111a4 | ||
|
|
ee4f788ae0 | ||
|
|
f3f3c63c30 | ||
|
|
3b00cf8971 | ||
|
|
7e8295769a | ||
|
|
09fec16b6f | ||
|
|
e5030dfa64 | ||
|
|
63c0c2e38a | ||
|
|
1a26268bd5 | ||
|
|
265770b4e3 | ||
|
|
8157be2f4a | ||
|
|
b7411febce | ||
|
|
31e50e50b6 | ||
|
|
e1efa990ca | ||
|
|
8fdce7cb4f | ||
|
|
b41af97d1f | ||
|
|
88cacb6c35 | ||
|
|
92a07d1b9d | ||
|
|
9b64a778d0 | ||
|
|
4486c569f2 | ||
|
|
e1a5063daf | ||
|
|
e3446840fa | ||
|
|
08f5c27b0b | ||
|
|
b92779f821 | ||
|
|
92eeb7f8c9 | ||
|
|
2939aea4ec | ||
|
|
5f51d8dc43 | ||
|
|
d94e7bd7f0 | ||
|
|
5634881eda | ||
|
|
66f5e75cff | ||
|
|
82b721a432 | ||
|
|
f9b8bf7e4d | ||
|
|
5580791a70 | ||
|
|
833e076eb7 | ||
|
|
3612144c6d | ||
|
|
2a5479a524 | ||
|
|
0437d858f2 | ||
|
|
921361313a | ||
|
|
a5e2020908 | ||
|
|
9578083b92 | ||
|
|
0f01459d77 | ||
|
|
e8d8741ec5 | ||
|
|
a7f898e4b2 | ||
|
|
43537ed368 | ||
|
|
a9376ef1ca | ||
|
|
49719b20d8 | ||
|
|
1612ef6990 | ||
|
|
e6b3490a8e | ||
|
|
a402fdd8b3 | ||
|
|
d71834011c | ||
|
|
5336bd688f | ||
|
|
245e1cf3d0 | ||
|
|
cab162b562 | ||
|
|
779a35e4cc | ||
|
|
bf6e91be3a | ||
|
|
98d56b2dd0 | ||
|
|
2807d75937 | ||
|
|
ef3f10ab8e | ||
|
|
98685ae20e | ||
|
|
ce7c9438b8 | ||
|
|
266c8ad17c | ||
|
|
5e52247083 | ||
|
|
7fa8364caf | ||
|
|
bac892080d | ||
|
|
280f907297 | ||
|
|
da4062f9c1 | ||
|
|
53abf888cb | ||
|
|
c4698154b4 | ||
|
|
134e60fe2b | ||
|
|
502e7df2e5 | ||
|
|
c135572730 | ||
|
|
08b6011ed7 | ||
|
|
c6475ce4bf | ||
|
|
c5f84c7902 | ||
|
|
0377f18b23 | ||
|
|
52f0ac10a4 | ||
|
|
0baef252bb | ||
|
|
c526e175c7 | ||
|
|
f2e60209c9 | ||
|
|
d7b44bda07 | ||
|
|
0d2a6c4ed9 | ||
|
|
7915e58f1f | ||
|
|
70ea209857 | ||
|
|
a7107c6adf | ||
|
|
d5d348d2d1 | ||
|
|
c4480145b4 | ||
|
|
c3f70f57ac | ||
|
|
e400ef6d30 | ||
|
|
2d4d85bdbc | ||
|
|
b61f4c1ad3 | ||
|
|
31bce60530 | ||
|
|
f6f5fb3672 | ||
|
|
1abe1517d8 | ||
|
|
99cc5b9607 | ||
|
|
e7ba4fb3f0 | ||
|
|
b6ce947894 | ||
|
|
f6be27fd4e | ||
|
|
738eb28505 | ||
|
|
5ab1c4ce53 | ||
|
|
99e030cc4c | ||
|
|
c3df0bc688 | ||
|
|
51d1f27a76 | ||
|
|
2c5231f0ed |
@@ -61,6 +61,7 @@ if (process.env.RUN_ENV === 'DEMO') {
|
||||
'no-console': 0,
|
||||
'no-plusplus': 0,
|
||||
'eol-last': 0,
|
||||
'no-script-url': 0,
|
||||
'prefer-rest-params': 0,
|
||||
'react/no-multi-comp': 0,
|
||||
'react/prefer-stateless-function': 0,
|
||||
|
||||
4
.github/ISSUE_TEMPLATE.md
vendored
4
.github/ISSUE_TEMPLATE.md
vendored
@@ -1,7 +1,3 @@
|
||||
<!--
|
||||
两会期间,如果遇到官网无法访问,请使用代理或者访问国内镜像 http://ant-design.gitee.io
|
||||
-->
|
||||
|
||||
<!--
|
||||
IMPORTANT: Please use the following link to create a new issue:
|
||||
|
||||
|
||||
@@ -19,7 +19,6 @@ matrix:
|
||||
- env: REACT=15 TEST_TYPE=test:es
|
||||
- env: REACT=15 TEST_TYPE=test:dom
|
||||
- env: REACT=15 TEST_TYPE=test:node
|
||||
- env: REACT=16 TEST_TYPE=bisheng:build
|
||||
|
||||
before_script:
|
||||
- scripts/install-react.sh
|
||||
|
||||
208
AUTHORS.txt
208
AUTHORS.txt
@@ -1,18 +1,26 @@
|
||||
778758944 <778758944@qq.com>
|
||||
Aaron Planell López <aaronplanell@gmail.com>
|
||||
Adrian Dimitrov <dimitrov.adrian@gmail.com>
|
||||
Albert Zheng <lisong.zheng@gmail.com>
|
||||
Albert 理斯特 <shuaizhexu@gmail.com>
|
||||
Aleck Landgraf <aleck.landgraf@gmail.com>
|
||||
Alexander <labriko@yandex.ru>
|
||||
Alexander Suevalov <suevalov.work@gmail.com>
|
||||
Alexandre Kirszenberg <a.kirszenberg@gmail.com>
|
||||
Amorites <751809522@qq.com>
|
||||
Anas Tawfeek <anas.tawfeek@outlook.com>
|
||||
Andrew Murray <radarhere@gmail.com>
|
||||
Andrey G <plandem@gmail.com>
|
||||
Arnab Sen <arnabsen@gmail.com>
|
||||
Arthur Denner Oliveira Santos <arthurdenner7@gmail.com>
|
||||
Arvin Xu <arvinx@foxmail.com>
|
||||
BK Heleth <bon.hoo@hotmail.com>
|
||||
Babajide Fowotade <jide.b.tade@gmail.com>
|
||||
Bartek <bartek.kozera@gmail.com>
|
||||
Benjamin Kniffler <bkniffler@me.com>
|
||||
Benjy Cui <benjytrys@gmail.com>
|
||||
Bernie <bernie.wangbj@gmail.com>
|
||||
Bilal Sirazitdinov <bilalsir@yandex.ru>
|
||||
Bill Sheikh <bilawals22@gmail.com>
|
||||
Bo Chen <bochen2014@yahoo.com>
|
||||
Bozhao <yubz86@gmail.com>
|
||||
@@ -20,113 +28,187 @@ Brett Lamy <bel423@me.com>
|
||||
Brook Shi <iwxiaot@gmail.com>
|
||||
Bruce Mitchener <bruce.mitchener@gmail.com>
|
||||
Bruno Maia <bruno.mm.maia@gmail.com>
|
||||
Bryan Berger <bb@ga.co>
|
||||
C <4019980@qq.com>
|
||||
Cam Song <neosoyn@gmail.com>
|
||||
Camol <kwwnjujlc@sina.com>
|
||||
Canwen Xu <canwenxu@126.com>
|
||||
Catalin Miron <mironcatalin@gmail.com>
|
||||
Cee Cirno <i@cee.moe>
|
||||
Chang Wang <cheapsteak@gmail.com>
|
||||
Chikara Chan <chenhongtu@51xianqu.net>
|
||||
Chris Kelly <cjke.7777@gmail.com>
|
||||
ChrisFan <chris.fan.dev@gmail.com>
|
||||
Christopher Deutsch <cd@cdeutsch.com>
|
||||
Chuang Yu <cyu9960@gmail.com>
|
||||
Claudio Restifo <claudio.restifo@gmail.com>
|
||||
Cody Chan <int64ago@gmail.com>
|
||||
Colton Pierson <colton@coltonpierson.com>
|
||||
Confiks <confiks@scriptbase.org>
|
||||
Conway Anderson <hello@conwayanderson.com>
|
||||
Cordaro <elvis07@163.com>
|
||||
D & R <jdz321@qq.com>
|
||||
Damian Green <damian.green@microlease.com>
|
||||
Dan Minshew <ofenixculpa@gmail.com>
|
||||
Dane David <dndavid102@gmail.com>
|
||||
Danny Hoower Antonio Viasus Avila <danjavia@gmail.com>
|
||||
Daqi Song <dqaria@gmail.com>
|
||||
Darren Poon <dyhpoon@gmail.com>
|
||||
David Schneider <davschne@gmail.com>
|
||||
DengYun <tdzl2003@gmail.com>
|
||||
Dimitri Mitropoulos <dimitrimitropoulos@gmail.com>
|
||||
Dmitry Bolotin <bolotin.dmitriy@gmail.com>
|
||||
Dorian <dorian@doma.io>
|
||||
DosLin <doslino@gmail.com>
|
||||
EcmaProSrc.P/ka <asoiso@foxmail.com>
|
||||
Edd Hannay <accounts@edd.fm>
|
||||
Eddie Xie <oeddyo@gmail.com>
|
||||
Eden Wang <Eden.Wang@Akmii.com>
|
||||
Eden Wang <yociduo@vip.qq.com>
|
||||
Egor Yurtaev <yurtaev.egor@gmail.com>
|
||||
Eli White <github@eli-white.com>
|
||||
Emma <sima.zhang1990@gmail.com>
|
||||
Eric <84263800@qq.com>
|
||||
Erwann Mest <m+github@kud.io>
|
||||
Evgeny Kuznetsov <jackk@ya.ru>
|
||||
Eward Song <eward.song@gmail.com>
|
||||
Flynn <li.fulin@foxmail.com>
|
||||
For177 <mengqiang.q@gmail.com>
|
||||
Geoff Holden <geoff@brightloudnoise.com>
|
||||
George Gray <george@ummodesign.com>
|
||||
Graeme Yeates <gyeates@clearpath.ai>
|
||||
Graeme Yeates <yeatesgraeme@gmail.com>
|
||||
Gray Choi <gray.choi.1988@gmail.com>
|
||||
Guan Hao <raptium@gmail.com>
|
||||
Guan Yu Pan (Jacky) <jackypan1989@gmail.com>
|
||||
HJin.me <hjin.me@gmail.com>
|
||||
Hai Phan Nguyen <pnghai@gmail.com>
|
||||
Haibin Yu <haibin.yu@oceanwing.com>
|
||||
Hanai <ihanai1991@gmail.com>
|
||||
Haroen Viaene <fingebimus@me.com>
|
||||
Harshit Mehrotra <harshitmehrotra@hotmail.com>
|
||||
Henri Normak <henri.normak@gmail.com>
|
||||
Hubert Argasinski <argasinski.hubert@gmail.com>
|
||||
Hughen <446370503@163.com>
|
||||
Hugo LEHMANN <shogi31@gmail.com>
|
||||
Igor G <i.gaidai4uk@gmail.com>
|
||||
ImJoeHs <865439601@qq.com>
|
||||
Inclined.Z <zjq0717@163.com>
|
||||
Infinity <305870677@qq.com>
|
||||
Ivan Kravets <me@ikravets.com>
|
||||
Ivo Stratev <ivo.stratev.tues@gmail.com>
|
||||
JaePil Jung <jjp5023@gmail.com>
|
||||
James <james@schoolshape.com>
|
||||
Jeffrey Carl Faden <jeffreyatw@gmail.com>
|
||||
Jerry Bendy <jerry@icewingcc.com>
|
||||
Jesper We <jesper@journeyman.se>
|
||||
Jiabin Peng <png.inside@gmail.com>
|
||||
Jialei <jialeicui@126.com>
|
||||
Jieraaa <842533841@qq.com>
|
||||
Jing Ma <mjingm87@qq.com>
|
||||
Joe <qiaolibo@126.com>
|
||||
Joe Hsu <jhsu.x1@gmail.com>
|
||||
John Johnson III <john@johnjohnson.cc>
|
||||
John Nguyen <jtnguyen236@gmail.com>
|
||||
Jonatas Walker <jonataswalker@gmail.com>
|
||||
Jonny Buchanan <jonathan.buchanan@gmail.com>
|
||||
Jordan Hornblow <jordan@jch254.com>
|
||||
Josué <ujosuegt@outlook.com>
|
||||
Juan Rodrigo Venegas Boesch <jrvboesch@gmail.com>
|
||||
Junyu Zhan <irrigator@yeah.net>
|
||||
Kaien Liao <liaokaien@gmail.com>
|
||||
Kenaniah Cerny <kenaniah@gmail.com>
|
||||
Kenneth Truong <kenneth.e.truong@gmail.com>
|
||||
Kevin Ivan <info@kevinivan.com>
|
||||
KgTong <kgtong1992@gmail.com>
|
||||
Khalifa Lame <khalibloo@gmail.com>
|
||||
Kiho · Cham <monkindey@163.com>
|
||||
Kimmo Saari <kimmo.saari@revolt.fi>
|
||||
Kirill Stiopin <kirill.stiopin@hotmail.com>
|
||||
Knacktus <knacktus@gmail.com>
|
||||
Kyle Kelley <rgbkrk@gmail.com>
|
||||
Kyle Rosenberg <kyle.rosenberg@gmail.com>
|
||||
Larry Laski <larry.laski@gmail.com>
|
||||
LeeHarlan <709886167@qq.com>
|
||||
LeezQ <lizhenq2009@gmail.com>
|
||||
Leo <clinyong@gmail.com>
|
||||
Leon Shi <superRaytin@163.com>
|
||||
Leon Shi <superRaytin@gmail.com>
|
||||
Liu Yang <zation1@gmail.com>
|
||||
LongYinan <lynweklm@gmail.com>
|
||||
Lyndon001 <lld207@126.com>
|
||||
MG12 <wuzhao.mail@gmail.com>
|
||||
Ma Tianxiao <matx2215@outlook.com>
|
||||
Madis Väin <madisvain@gmail.com>
|
||||
Manjit Kumar <manjit1727@gmail.com>
|
||||
Manweill <mic.liangwenwei@foxmail.com>
|
||||
Marco Afonso <mafonso333@gmail.com>
|
||||
Marcus Bransbury <marcus.bransbury@gmail.com>
|
||||
Marius Ileana <visvadw@gmail.com>
|
||||
Mars Wong <marswong618@gmail.com>
|
||||
Marshall Chen <Juniors.fei@gmail.com>
|
||||
Martin Litvaj <kamahl19@gmail.com>
|
||||
Martin Novák <martinnovak@outlook.com>
|
||||
Mathew <khayaanimations@gmail.com>
|
||||
Maximilian Meyer <Maximilian.Meyer@br.de>
|
||||
Meck <yesmeck@gmail.com>
|
||||
MeiLin <postget.me@gmail.com>
|
||||
Meow-z <372086270@qq.com>
|
||||
Miaow <i@zfeng.net>
|
||||
Michalis Macheras <diodosier@gmail.com>
|
||||
Min <dicklwm@163.com>
|
||||
MinJeong Kim <min7859@gmail.com>
|
||||
Minqi Pan <pmq2001@gmail.com>
|
||||
Minsung Ryu <ryums0227@gmail.com>
|
||||
Mitchell Demler <mitchell.demler@harcourts.net>
|
||||
Mohamed Seada <mohamed.seada.1994@gmail.com>
|
||||
Mr.Tone <vector@malubei.com>
|
||||
MuYu <mr.muzea@gmail.com>
|
||||
Mário Gonçalves <mario.mc.goncalves@gmail.com>
|
||||
Nathan Griffin <nathan@gatherhere.com>
|
||||
Nathan Tavares Nascimento <nathan.tnascimento@gmail.com>
|
||||
Nathan Wells <nwwells@gmail.com>
|
||||
Neekey <ni184775761@gmail.com>
|
||||
Nekron <nekron.hyt@gmail.com>
|
||||
Neverland <chenjiahan@buaa.edu.cn>
|
||||
Nico <nicolas@freddelacompta.com>
|
||||
Nidhi Agarwal <nidhi.agarwal@zomato.com>
|
||||
Nimo <nimo.jser@gmail.com>
|
||||
Nishant Arora <na.nishantarora@gmail.com>
|
||||
Nokecy <Nokecy@163.com>
|
||||
OAwan <georgio.wan@gmail.com>
|
||||
Oleksandr Kovalchuk <me.olexandr.kovalchuk@gmail.com>
|
||||
OuYancey <ou.yancey@gmail.com>
|
||||
Panjie Setiawan Wicaksono <panjie@panjiesw.com>
|
||||
Patrick Gidich <patrick.gidich@simnova.com>
|
||||
Patryk <longer44@gmail.com>
|
||||
Peter <usstpeter@gmail.com>
|
||||
Peter Berg <atticusberg@gmail.com>
|
||||
Pierre <pierre@bazoge.com>
|
||||
Pierre Neter <pierreneter@gmail.com>
|
||||
Piper Chester <piperchester@gmail.com>
|
||||
Pixy Yuan <pixy.bupt@gmail.com>
|
||||
Pyiner <lijiuyang1992@gmail.com>
|
||||
Pyroboomka <qwaarty@mail.ru>
|
||||
Qiaosen Huang <joesonw@gmail.com>
|
||||
Qingrong Ke <keqingrong1992@gmail.com>
|
||||
Rafael Cosman <rafaelcosman@alumni.stanford.edu>
|
||||
Ramsés Moreno <ramses@cuatromedios.com>
|
||||
Randy <randypriv@gmail.com>
|
||||
RaoHai <surgesoft@gmail.com>
|
||||
Reed Sun <superreedsun@gmail.com>
|
||||
Rex <zhangzilong.zzl@163.com>
|
||||
Ricardo Raphael Joson <rrjoson08@gmail.com>
|
||||
Richard D. Worth <rdworth@gmail.com>
|
||||
Robert Wilkinson <wilkinson.robert.a@gmail.com>
|
||||
Rohan Malhotra <rohan.root@gmail.com>
|
||||
Rrrandom <emanonhere@gmail.com>
|
||||
SHEN Lin <shenlin192@gmail.com>
|
||||
Sakol Assawasagool <koobitor@gmail.com>
|
||||
Sam Chen <chenxsan@gmail.com>
|
||||
Sam Maxwell <sam@paybase.io>
|
||||
Sangle <whb97@163.com>
|
||||
Sanjay Kumar <kris.gooner@gmail.com>
|
||||
Sanjay Kumar <sk@tectusdreamlab.com>
|
||||
Sean Lin <sean@ejoy.com>
|
||||
Sean Sun <pinggodstudio@gmail.com>
|
||||
@@ -134,39 +216,74 @@ Sebastian Blade <blade254353074@hotmail.com>
|
||||
Sergio Crisostomo <sergiosbox@gmail.com>
|
||||
Shawn Sit <xueqingxiao@gmail.com>
|
||||
ShiTengFei <shitengfei@goyoo.com>
|
||||
Shubham Kanodia <shubhamsizzles@gmail.com>
|
||||
SimaQ <sima.zhang1990@gmail.com>
|
||||
Spencer <spjy@hawaii.edu>
|
||||
Stephen Esser <Stephen.Esser@gmail.com>
|
||||
Tao <magicdawn@qq.com>
|
||||
Tao Zhang <windse7en@gmail.com>
|
||||
Taylor Sabell <taylorsabell@gmail.com>
|
||||
Tengjiao Cai <caitengjiao1987@gmail.com>
|
||||
Terence <trence320@163.com>
|
||||
The Rock <zhoguoxin@126.com>
|
||||
Tino D <ginodeis@gmail.com>
|
||||
Tom Gao <tom@zoomsoft.cc>
|
||||
Trotyl Yu <trotyl@qq.com>
|
||||
Troy Thompson <troynt@gmail.com>
|
||||
Tyler <chaotyler@gmail.com>
|
||||
Ubaldo Quintana <blkdr@hotmail.com>
|
||||
Vadim Macagon <vadim.macagon@gmail.com>
|
||||
Valentin Vichnal <valentin@vichnal.com>
|
||||
Vemund Santi <veund@santi.no>
|
||||
Vemund Santi <vemund@santi.no>
|
||||
Vic <709147950@qq.com>
|
||||
Vincent Zhang <vxzhong@qq.com>
|
||||
ViviaRui <zr1450995198@163.com>
|
||||
Walter Barbagallo <turbometalskater@gmail.com>
|
||||
Wang Jun <amos.callmexyz@gmail.com>
|
||||
Warren Seymour <warren@fountainhead.tech>
|
||||
Wei Zhu <yesmeck@gmail.com>
|
||||
Wenchao Hu <zjuhwc@gmail.com>
|
||||
Will Chen <willchen90@gmail.com>
|
||||
WingGao <wing.gao@live.com>
|
||||
Wu Haotian <whtsky@gmail.com>
|
||||
XBTop1! <xbtop1@gmail.com>
|
||||
Xie Guanglei <xieguanglei@hotmail.com>
|
||||
XuMM_12 <owiatsq@sina.cn>
|
||||
Yang Bin <yangkghjh@gmail.com>
|
||||
Yasin Uslu <nepjua@gmail.com>
|
||||
Yiming <ymjrcc@qq.com>
|
||||
Yogesh <yogeshkumar180592@gmail.com>
|
||||
YuChao Liang <l.yuch@foxmail.com>
|
||||
Yunus EŞ <yunus@yunuses.com>
|
||||
Yury Kozyrev <urakozz@me.com>
|
||||
Yusuke Ito <novi.mad@gmail.com>
|
||||
Yuwei Ba <i@xiaoba.me>
|
||||
YuyingWu <wuyuying1128@gmail.com>
|
||||
Zack Craig <zack@zack6849.com>
|
||||
Zap <a124116186@qq.com>
|
||||
Zhang Zhi <fytriht@gmail.com>
|
||||
Zheeeng <hi@zheeeng.me>
|
||||
Ziluo <gyfzzu@gmail.com>
|
||||
afc163 <afc163@gmail.com>
|
||||
ahalimkara <ahalimkara@gmail.com>
|
||||
ascoders <576625322@qq.com>
|
||||
ashishg-qburst <ashishg@qburst.com>
|
||||
bang <sqibang@gmail.com>
|
||||
bang88 <sqibang@gmail.com>
|
||||
blankzust <450811238@qq.com>
|
||||
byuanama <byuan@ama.com.au>
|
||||
bzone <yarnbcoder@gmail.com>
|
||||
caoyi <caoyi0905@mail.hfut.edu.cn>
|
||||
cathayandy <wzm_andy@126.com>
|
||||
chaofeis <408067385@qq.com>
|
||||
chchen <cc272309126@gmail.com>
|
||||
chencheng (云谦) <sorrycc@gmail.com>
|
||||
chencheng <sorrycc@gmail.com>
|
||||
cjahv <cjahv@qq.com>
|
||||
clinyong <clinyong@gmail.com>
|
||||
corneyl <cornieljoosse@gmail.com>
|
||||
ddcat1115 <ddcat1115@gmail.com>
|
||||
delesseps <andrewlessels@gmail.com>
|
||||
denzw <denzw@21cn.com>
|
||||
detailyang <detailyang@gmail.com>
|
||||
devqin <devqin@gmail.com>
|
||||
@@ -181,40 +298,67 @@ feng zhi hao <fzhihao@outlook.com>
|
||||
fengmk2 <m@fengmk2.com>
|
||||
flashback313 <windmark2012@gmail.com>
|
||||
genie <genie88@163.com>
|
||||
gregahren <grega.hren@gmail.com>
|
||||
handycode <lihandi@gmail.com>
|
||||
hansnow <hansnow2012@gmail.com>
|
||||
haoxin <coderhaoxin@outlook.com>
|
||||
hardfist <yangjianzju@gmail.com>
|
||||
hauwa123 <hauwa.aminu@outlook.com>
|
||||
henryv0 <henryvo94@gmail.com>
|
||||
hi-caicai <hi@cai-cai.me>
|
||||
huzzbuzz <huzzbuzz@outlook.com>
|
||||
iamcastelli <sowed@cyberdude.com>
|
||||
imosapatryk <imosa.patryk@gmail.com>
|
||||
infeng <fzhihao@outlook.com>
|
||||
int2d <int2d@qq.com>
|
||||
ioldfish <fish.wangl@gmail.com>
|
||||
jasonslyvia <jasonslyvia@gmail.com>
|
||||
jasonxia23 <xia.jason23@gmail.com>
|
||||
jiang <155259966@qq.com>
|
||||
jim <wasd2144@hotmail.com>
|
||||
jinouwuque <ee2win@gmail.com>
|
||||
junjing.zhang <zhangjunjing@gmail.com>
|
||||
kacjay <45483388@qq.com>
|
||||
kagawagao <kingsongao1221@gmail.com>
|
||||
kaifei <150641329@qq.com>
|
||||
kasinooya <kasinooya@gmail.com>
|
||||
kayw <kayw@outlook.com>
|
||||
kdenz <ksnz93@gmail.com>
|
||||
kdepp <kdepp.cd@gmail.com>
|
||||
keng <keng@renderinghouse.com>
|
||||
keqingrong <keqingrong1992@gmail.com>
|
||||
ko <git@yaksok.net>
|
||||
konakona <lovekonakona@gmail.com>
|
||||
kossel <lis.yichao@gmail.com>
|
||||
kuang <p2227@hotmail.com>
|
||||
kun sam <kunsam624@icloud.com>
|
||||
leadream <857098475@qq.com>
|
||||
lehug <zcszuo5811@126.com>
|
||||
leon.shi <superRaytin@163.com>
|
||||
lgmcolin <gengmin.lgm@gmail.com>
|
||||
lgmcolin <lgmcolin@gmail.com>
|
||||
liangfei <njliangfei@gmail.com>
|
||||
liekkas <zjq0717@163.com>
|
||||
lihqi <455711093@qq.com>
|
||||
lixiaochou077 <qi.liqi07@gmail.com>
|
||||
lixiaoyang <lixiaoyang2345@gmail.com>
|
||||
lixiaoyang1992 <lixiaoyang2345@gmail.com>
|
||||
lizhaocai <lzc09008@gmail.com>
|
||||
lizhen <lizhen@youzan.com>
|
||||
loganpowell <loganp@tepper.cmu.edu>
|
||||
luyiming <luyimingchn@gmail.com>
|
||||
lvren <luren6049@qq.com>
|
||||
mArker <252133226@qq.com>
|
||||
memoryza <jincai.wang@foxmail.com>
|
||||
mgrdevport <mgrdevport@gmail.com>
|
||||
mitchell.demler <mitchell.demler@harcourts.net>
|
||||
mkermani144 <mkermani144@gmail.com>
|
||||
monkindey <monkindey@163.com>
|
||||
muzuiget <muzuiget@gmail.com>
|
||||
natergj <nater_nater@me.com>
|
||||
neekey <ni184775761@gmail.com>
|
||||
niko <644506165@qq.com>
|
||||
nikogu <644506165@qq.com>
|
||||
paranoidjk <hust2012jiangkai@gmail.com>
|
||||
parlop <parlop@gmail.com>
|
||||
pd4d10 <pd4d10@gmail.com>
|
||||
@@ -224,8 +368,11 @@ pizn <pizner@gmail.com>
|
||||
plandem <plandem@gmail.com>
|
||||
popomore <sakura9515@gmail.com>
|
||||
qubaoming <qubaoming@didichuxing.com>
|
||||
ravirambles <ravirambles@gmail.com>
|
||||
ryangun <ryangun@foxmail.com>
|
||||
ryanhoho <hswacoal@gmail.com>
|
||||
sadmark <zhoubin@laidian360.com>
|
||||
sallen450 <jqh101@sina.com>
|
||||
shelwin <wxfans@gmail.com>
|
||||
shenlin192@gmail.com <shenlin192@gmail.com>
|
||||
shlice <licesh@gmail.com>
|
||||
@@ -236,17 +383,26 @@ snadn <snadn@snadn.cn>
|
||||
sojournerc <cmeyer@zvelo.com>
|
||||
sorrycc <sorrycc@gmail.com>
|
||||
swindme <swindme@163.com>
|
||||
syssam <s.y.s.sam.sys@gmail.com>
|
||||
thegatheringstorm <tgs@tgs.blue>
|
||||
tianli.zhao <275287902@qq.com>
|
||||
tom <caolvchong@gmail.com>
|
||||
twobin <twobin@live.com>
|
||||
u3u <qwq@qwq.cat>
|
||||
ustccjw <317713370@qq.com>
|
||||
valleykid <valleykiddy@gmail.com>
|
||||
vgeyi <vgeyiz@126.com>
|
||||
wangtao0101 <yuecjn@gmail.com>
|
||||
wangxiaolei <fatelei@gmail.com>
|
||||
warmhug <hualei5280@gmail.com>
|
||||
whtang906 <whtang906@gmail.com>
|
||||
wizawu <wizawu@gmail.com>
|
||||
wonyun <wy393767068@163.com>
|
||||
xiaofan2406 <xiaofan2406@gmail.com>
|
||||
yangwukang <yangwukang@boco.com.cn>
|
||||
yeliex <yeliex@yeliex.com>
|
||||
yiminghe <yiminghe@gmail.com>
|
||||
yociduo <yociduo@vip.qq.com>
|
||||
yubozhao <yubz86@gmail.com>
|
||||
yuche <i@yuche.me>
|
||||
z <haig8@msn.com>
|
||||
@@ -255,26 +411,46 @@ zerob4wl <zerob4wl@gmail.com>
|
||||
zhangpc <zhangpc@tenxcloud.com>
|
||||
zhaocai <lzc09008@gmail.com>
|
||||
zhujun24 <zhujun87654321@gmail.com>
|
||||
zhuyue <fuping.dfp@antfin.com>
|
||||
zilong <jzlxiaohei@163.com>
|
||||
zinkey <yaya@uloveit.com.cn>
|
||||
zollero <corona7@163.com>
|
||||
zombiej <smith3816@gmail.com>
|
||||
zuiidea <zuiiidea@gmail.com>
|
||||
一喵呜 <hyb628@gmail.com>
|
||||
乔奕轩 <qiao_yixuan@163.com>
|
||||
低位 <zhujun87654321@gmail.com>
|
||||
偏右 <afc163@gmail.com>
|
||||
可乐 <zaxlct@foxmail.com>
|
||||
吕立青 <jimmy.jinglv@gmail.com>
|
||||
广彬-梁 <326741518@qq.com>
|
||||
柚子男 <yozman@sina.com>
|
||||
白羊座小葛 <abeyuhang@gmail.com>
|
||||
英布 <chaoren1641@gmail.com>
|
||||
蔡伦 <sliuqin@gmail.com>
|
||||
逸达 <dqaria@gmail.com>
|
||||
邦 <sqibang@gmail.com>
|
||||
闲耘™ <hotoo.cn@gmail.com>
|
||||
爱but的苍蝇 <354788473@qq.com>
|
||||
拷钉 <41830859@qq.com>
|
||||
竹尔 <Juelchiang@gmail.com>
|
||||
偏右 <afc163@gmail.com>
|
||||
英布 <chaoren1641@gmail.com>
|
||||
朮厃 <cn.ah.liu@gmail.com>
|
||||
诸岳 <dengfuping_develop@163.com>
|
||||
逸达 <dqaria@gmail.com>
|
||||
蔡伦 <sliuqin@gmail.com>
|
||||
陆离 <surgesoft@gmail.com>
|
||||
愚道 <tingzhao.ytz@antfin.com>
|
||||
陈帅 <wasd2144@hotmail.com>
|
||||
马斯特 <sd4399340@126.com>
|
||||
马金花儿 <o.o@mug.dog>
|
||||
松子 <window.pibarr@gmail.com>
|
||||
可乐 <zaxlct@foxmail.com>
|
||||
山客 <zeakhold@gmail.com>
|
||||
曾凯 <zengkai2009@foxmail.com>
|
||||
低位 <zhujun87654321@gmail.com>
|
||||
广彬-梁 <326741518@qq.com>
|
||||
徐坤龙 <272992168@qq.com>
|
||||
黄子毅 <576625322@qq.com>
|
||||
翁润雨 <593110501@qq.com>
|
||||
崔宏森 <948346354@qq.com>
|
||||
闲耘™ <hotoo.cn@gmail.com>
|
||||
一喵呜 <hyb628@gmail.com>
|
||||
吕立青 <jimmy.jinglv@gmail.com>
|
||||
隋鑫磊 <joshuasui@gmail.com>
|
||||
乔奕轩 <qiao_yixuan@163.com>
|
||||
马斯特 <sd4399340@126.com>
|
||||
王集鹄 <wjhu111@21cn.com>
|
||||
柚子男 <yozman@sina.com>
|
||||
愚指导 <yutingzhao1991@sina.com>
|
||||
愚指导-TZ <yutingzhao1991@sina.com>
|
||||
超能刚哥 <margox@foxmail.com>
|
||||
马金花儿 <o.o@mug.dog>
|
||||
रोहन मल्होत्रा <rohan.malhotra@adwyze.com>
|
||||
白羊座小葛 <abeyuhang@gmail.com>
|
||||
|
||||
@@ -14,13 +14,86 @@ timeline: true
|
||||
* Major version release is not included in this schedule for breaking change and new features.
|
||||
|
||||
---
|
||||
|
||||
## 3.4.4
|
||||
|
||||
`2018-04-28`
|
||||
|
||||
- 🐞 Fix that Upload file in`onChange({ file })` is not a File instance introduced in `3.4.2`. [#10293](https://github.com/ant-design/ant-design/issues/10293)
|
||||
- 🐞 Fix style lose bug when use tree shaking in webpack@4. [#10217](https://github.com/ant-design/ant-design/pull/10217) [@whtsky](https://github.com/whtsky)
|
||||
|
||||
## 3.4.3
|
||||
|
||||
`2018-04-23`
|
||||
|
||||
- 🐞 Fix style lose bug when use tree shaking in webpack@4. [#10197](https://github.com/ant-design/ant-design/pull/10197) [@Aladdin-ADD](https://github.com/Aladdin-ADD)
|
||||
- 🐞 Fix `Menu` item's clickable region in dark theme. [#10187](https://github.com/ant-design/ant-design/pull/10187) [@dgeibi ](https://github.com/dgeibi )
|
||||
|
||||
## 3.4.2
|
||||
|
||||
`2018-04-22`
|
||||
|
||||
- 💄 Deployed site by [netlify](http://netlify.com/) to avoid blocking by GFW.
|
||||
- 🐞 Fix TypeScript definitions of Menu, Tooltip, Card, Anchor, Avatar, Form, Tabs, Transfer, Tree, AutoComplete and etc.
|
||||
- 💄 Added `sideEffects` to `package.json` for better Tree-Shaking. [#10043](https://github.com/ant-design/ant-design/pull/10043) [@Aladdin-ADD](https://github.com/Aladdin-ADD)
|
||||
- List
|
||||
- 🐞 Fix extra border. [#10028](https://github.com/ant-design/ant-design/issues/10028)
|
||||
- 🐞 Fix extra prop warning of `locale`. [#10128](https://github.com/ant-design/ant-design/pull/10128) [@slonoed](https://github.com/slonoed)
|
||||
- 🐞 Fix wrong preview image of Upload list when file.url contains url params. [#10102](https://github.com/ant-design/ant-design/issues/10102)
|
||||
- 🐞 Fix Progress when percent is out of range. [0eb8357](https://github.com/ant-design/ant-design/commit/0eb835772dbaa7ed14babe03fc177821c5bd5ca5)
|
||||
- Menu
|
||||
- 🐞 Fix arrow style of disabled SubMenu. [#10113](https://github.com/ant-design/ant-design/issues/10113)
|
||||
- 🐞 Fix that menu width is wrong when `collapsedWidth` is assigned as px string like `40px`. [#10140](https://github.com/ant-design/ant-design/issues/10140)
|
||||
- 🐞 Fix that sometimes controlled input in Form cannot be edited. [#9790](https://github.com/ant-design/ant-design/issues/9790)
|
||||
- 🐞 Fix padding jumping issue of loading Card. [#10052](https://github.com/ant-design/ant-design/pull/10052) [@zheeeng](https://github.com/zheeeng)
|
||||
- 🐞 Fix that Avatar's fallback text don't scale as the text avatar does. [#10184](https://github.com/ant-design/ant-design/pull/10184)
|
||||
- 🐞 Fix Table `getCheckboxProps` cannot be updated as expected. [#10133](https://github.com/ant-design/ant-design/issues/10133)
|
||||
- 🐞 Fix CheckboxGroup `prefixCls` prop not passed to Checkbox. [#9950](https://github.com/ant-design/ant-design/issues/9950)
|
||||
|
||||
## 3.4.1
|
||||
|
||||
`2018-04-08`
|
||||
|
||||
- 🐞 Fix TypeScript type error caused by code error of Badge. [#9931](https://github.com/ant-design/ant-design/issues/9931)
|
||||
- 💄 Improve clicking region of Card `actions`. [#9882](https://github.com/ant-design/ant-design/issues/9882)
|
||||
- 🐞 Fix Divider style issue when used with float elements. [#9956](https://github.com/ant-design/ant-design/issues/9956)
|
||||
- 🐞 Fix style issue of Form in advanced-search mode. [#9907](https://github.com/ant-design/ant-design/issues/9907)
|
||||
- 🐞 Add `onHeaderRow` TypeScript type definitions for Table. [#9902](https://github.com/ant-design/ant-design/pull/9902) [@Nokecy](https://github.com/Nokecy)
|
||||
- 💄 Improve the customized-icon demo of Tree. [#9893](https://github.com/ant-design/ant-design/pull/9893)
|
||||
- 🐞 Fix image url display with non-image extention in Upload. [#9936](https://github.com/ant-design/ant-design/pull/9936)
|
||||
|
||||
## 3.4.0
|
||||
|
||||
`2018-04-01`
|
||||
|
||||
- Tree
|
||||
- 🛠 In this version, we refactored the underlying code of Tree to resolve some long living issues.
|
||||
- 🌟 Added `defaultExpandParent` for expanding parent at first render.
|
||||
- 🌟 Added `disabled` for disabling the whole tree.
|
||||
- 🌟 Added `TreeNode[icon]` to allow setting custom node icon.
|
||||
- 🌟 Improved the check logic for disabled TreeNode.
|
||||
- 🌟 Anchor added `getContainer` for setting the container of scroll content.
|
||||
- 🌟 Table added a new less variable `@table-expanded-row-bg`. [#9789](https://github.com/ant-design/ant-design/pull/9789)
|
||||
- 🐞 Fixed a less syntax error. [#9832](https://github.com/ant-design/ant-design/pull/9832) [@jojoLockLock](https://github.com/jojoLockLock)
|
||||
- 🐞 Fixed `moment.locale` invoking error in LocaleProvider. [#9853](https://github.com/ant-design/ant-design/pull/9853)
|
||||
- 🐞 Fixed issue resulting in `style` of WeekPicker not works. [#9848](https://github.com/ant-design/ant-design/issues/9848)
|
||||
- 🐞 Fixed type definition of Layout.Sider. [#9885](https://github.com/ant-design/ant-design/pull/9885) [@zachguo](https://github.com/zachguo)
|
||||
- 💄 Improved style of Modal for long contents. [#9592](https://github.com/ant-design/ant-design/pull/9592)
|
||||
- 🌟 Added new locale Slovenian.
|
||||
|
||||
## 3.3.3
|
||||
|
||||
`2018-03-25`
|
||||
|
||||
- Revert Upload `file` type change in previous version which causes breaking change.
|
||||
|
||||
## 3.3.2
|
||||
|
||||
`2018-03-24`
|
||||
|
||||
- 🐞 `Carousel`: Upgrade `react-slick` version to fix width calculation. [#3659](https://github.com/ant-design/ant-design/issues/3659)
|
||||
- 💄 `Rate`: Adjust `disabled` style. [#9747](https://github.com/ant-design/ant-design/issues/9747)
|
||||
- 💄 `Modal`: Adjust `confirm-modal` style to fix multiple line display issue. [#9374](https://github.com/ant-design/ant-design/issues/9374)
|
||||
- 💄 `Modal`: Adjust `confirm-modal` style to fix display issue when content use grid layout. [#9374](https://github.com/ant-design/ant-design/issues/9374)
|
||||
- 💄 `Menu`: Adjust style to fix mouse trigger event region. [#9666](https://github.com/ant-design/ant-design/pull/9666) [@dgeibi](https://github.com/dgeibi)
|
||||
- 🐞 `Upload`: Fix type of `file` on `beforeUpload` function. [#9775](https://github.com/ant-design/ant-design/issues/9775)
|
||||
- 🐞 `Button`: Fix `two-chinese-words` space not re-calculate when text changed. [4502ad8](https://github.com/ant-design/ant-design/commit/4502ad8376e536c450fa4f27d2a5855be5a153e7)
|
||||
@@ -127,7 +200,7 @@ timeline: true
|
||||
- 🐞 Fix issue resulting date panel being closed without animation when click on the preset range. [#6364](https://github.com/ant-design/ant-design/issues/6364)
|
||||
- 🐞 Fix issue resulting `onOk` is not being trigged, when click on the preset range. [#7747](https://github.com/ant-design/ant-design/issues/7747)
|
||||
- Select
|
||||
- 🌟 Improve `onChange`、`onDeselect`, they will receive selected `Option` as second paramteter.
|
||||
- 🌟 Improve `onChange`, `onDeselect`, they will receive selected `Option` as second paramteter.
|
||||
- 🐞 Fix issue resulting in `onSelect` is not trigged when using automatic tokenization. [#9094](https://github.com/ant-design/ant-design/issues/9094)
|
||||
- 🐞 Fix the missing scrollbar in Chrome.
|
||||
- 🌟 Improve Table's `rowSelection[getCheckboxProps]` prop, now the all the properties returned by `getCheckboxProps` will be passed to checkbox. [#9054](https://github.com/ant-design/ant-design/pull/9054) [@mgrdevport](https://github.com/ant-design/ant-design/pull/9054)
|
||||
@@ -392,7 +465,7 @@ We provide a [migration tool](https://github.com/ant-design/antd-migration-helpe
|
||||
- 🌟 `status` can use whith `children` now. [#8164](https://github.com/ant-design/ant-design/issues/8164)
|
||||
- Card
|
||||
- 🌟 Added new `inner` type. [Demo](https://ant.design/components/card/#components-card-demo-inner)。
|
||||
- 🌟 Added `cover`、`actions` and a new `Meta` component. [Demo](https://ant.design/components/card/#components-card-demo-meta)。
|
||||
- 🌟 Added `cover`, `actions` and a new `Meta` component. [Demo](https://ant.design/components/card/#components-card-demo-meta)。
|
||||
- DatePicker
|
||||
- 🌟 Added `mode` and `onPanelChange`,to allow controlling the panel mode. [Demo](https://ant.design/components/date-picker/#components-date-picker-demo-mode)。
|
||||
- 🌟 Added `WeekPicker` component. [Demo](https://ant.design/components/date-picker/#components-date-picker-demo-basic)
|
||||
@@ -428,7 +501,7 @@ We provide a [migration tool](https://github.com/ant-design/antd-migration-helpe
|
||||
- 🌟 Added `column[defaultSortOrder]` to allow setting default sort order. [#8111](https://github.com/ant-design/ant-design/pull/8111) [@megawac](https://github.com/megawac)
|
||||
- 🌟 Added `rowSelection[fixed]` to allow fixing the selection column.。
|
||||
- 🙅 Deprecated `getBodyWrapper`, please use `components` instead.
|
||||
- 🙅 Deprecated `onRowClick`,`onRowDoubleClick`、`onRowContextMenu`、`onRowMouseEnter`、`onRowMouseLeave`, please use `onRow` instead.
|
||||
- 🙅 Deprecated `onRowClick`,`onRowDoubleClick`, `onRowContextMenu`, `onRowMouseEnter`, `onRowMouseLeave`, please use `onRow` instead.
|
||||
```javascript
|
||||
<Table onRow={(record) => ({
|
||||
onClick: () => {},
|
||||
|
||||
@@ -14,13 +14,86 @@ timeline: true
|
||||
* 主版本号:含有破坏性更新和新特性,不在发布周期内。
|
||||
|
||||
---
|
||||
|
||||
## 3.4.4
|
||||
|
||||
`2018-04-28`
|
||||
|
||||
- 🐞 修复 3.4.2 中引入的 Upload 中 onChange 参数 `{ file }` file 不是 File 实例的问题。[#10293](https://github.com/ant-design/ant-design/issues/10293)
|
||||
- 🐞 修复 webpack@4 下使用 Tree Shaking 样式丢失的问题。[#10217](https://github.com/ant-design/ant-design/pull/10217) [@whtsky](https://github.com/whtsky)
|
||||
|
||||
## 3.4.3
|
||||
|
||||
`2018-04-23`
|
||||
|
||||
- 🐞 修复了 webpack@4 下使用 Tree Shaking 样式丢失的问题。[#10197](https://github.com/ant-design/ant-design/pull/10197) [@Aladdin-ADD](https://github.com/Aladdin-ADD)
|
||||
- 🐞 修复 `Menu` 组件在 `dark` 主题下点击区域的问题。[#10187](https://github.com/ant-design/ant-design/pull/10187) [@dgeibi](https://github.com/dgeibi)
|
||||
|
||||
## 3.4.2
|
||||
|
||||
`2018-04-22`
|
||||
|
||||
- 💄 部署网站到 [netlify](http://netlify.com/),解决网站被墙的问题。
|
||||
- 🐞 修复和调整 Menu、Tooltip、Card、Anchor、Avatar、Form、Tabs、Transfer、Tree、AutoComplete 等组件的 TypeScript 定义。
|
||||
- 💄 增加 `sideEffects` 配置以优化 Tree Shaking 效果。[#10043](https://github.com/ant-design/ant-design/pull/10043) [@Aladdin-ADD](https://github.com/Aladdin-ADD)
|
||||
- List
|
||||
- 🐞 修复多余边框问题。[#10028](https://github.com/ant-design/ant-design/issues/10028)
|
||||
- 🐞 修复 `locale` 属性被传递给 div 的警告。[#10128](https://github.com/ant-design/ant-design/pull/10128) [@slonoed](https://github.com/slonoed)
|
||||
- 🐞 修复 Upload 的文件 url 带有参数时,图片预览效果失效的问题。[#10102](https://github.com/ant-design/ant-design/issues/10102)
|
||||
- 🐞 修复 Progress 的百分比越界时的展现。[0eb8357](https://github.com/ant-design/ant-design/commit/0eb835772dbaa7ed14babe03fc177821c5bd5ca5)
|
||||
- Menu
|
||||
- 🐞 修复 SubMenu 的失效箭头样式。[#10113](https://github.com/ant-design/ant-design/issues/10113)
|
||||
- 🐞 修复 `collapsedWidth` 为像素字符串 `40px` 菜单宽度失效的问题。[#10140](https://github.com/ant-design/ant-design/issues/10140)
|
||||
- 🐞 修复一个某些情况下 Form 内使用受控组件时无法编辑的问题。[#9790](https://github.com/ant-design/ant-design/issues/9790)
|
||||
- 🐞 修复 Card 切换 loading 状态时的内边距跳动问题。[#10052](https://github.com/ant-design/ant-design/pull/10052) [@zheeeng](https://github.com/zheeeng)
|
||||
- 🐞 修复 Avatar 图片加载失败时的文字没有正确缩放的问题。[#10184](https://github.com/ant-design/ant-design/pull/10184)
|
||||
- 🐞 修复 Table 的 `getCheckboxProps` 无法动态更新的问题。[#10133](https://github.com/ant-design/ant-design/issues/10133)
|
||||
- 🐞 修复 CheckGroup 指定 `prefixCls` 没有传递给 Checkbox 的问题。[#9950](https://github.com/ant-design/ant-design/issues/9950)
|
||||
|
||||
## 3.4.1
|
||||
|
||||
`2018-04-08`
|
||||
|
||||
- 🐞 修复了 Badge 代码错误引起的 TypeScript 类型报错。[#9931](https://github.com/ant-design/ant-design/issues/9931)
|
||||
- 💄 优化了 Card `actions` 点击区域的范围。[#9882](https://github.com/ant-design/ant-design/issues/9882)
|
||||
- 🐞 修复了 Divider 与浮动元素一起使用时的样式问题。[#9956](https://github.com/ant-design/ant-design/issues/9956)
|
||||
- 🐞 修复了 Form 高级搜索模式下的样式问题。[#9907](https://github.com/ant-design/ant-design/issues/9907)
|
||||
- 🐞 补充了 Table 缺失的 `onHeaderRow` TypeScript 定义。[#9902](https://github.com/ant-design/ant-design/pull/9902) [@Nokecy](https://github.com/Nokecy)
|
||||
- 💄 优化了 Tree 自定义图标示例。[#9893](https://github.com/ant-design/ant-design/pull/9893)
|
||||
- 🐞 修复了 Upload 对无扩展名图片地址的预览展示问题。[#9936](https://github.com/ant-design/ant-design/pull/9936)
|
||||
|
||||
## 3.4.0
|
||||
|
||||
`2018-04-01`
|
||||
|
||||
- Tree
|
||||
- 🛠 在这个版本里,我们重构了 Tree 底层的代码,以解决一些存在了很久的问题。
|
||||
- 🌟 新增 `defaultExpandParent` 用于在第一次渲染时自动展开父节点。
|
||||
- 🌟 新增 `disabled` 用于禁用整棵树。
|
||||
- 🌟 TreeNode 新增 `icon` 用于设置自定义图标。
|
||||
- 🌟 优化了 TreeNode 设置 `disabled` 时的勾选逻辑。
|
||||
- 🌟 Anchor 新增 `getContainer` 用于指定内容滚动的容器。
|
||||
- 🌟 Table 新增 less 变量 `@table-expanded-row-bg`。[#9789](https://github.com/ant-design/ant-design/pull/9789)
|
||||
- 🐞 修复一处 less 语法错误。[#9832](https://github.com/ant-design/ant-design/pull/9832) [@jojoLockLock](https://github.com/jojoLockLock)
|
||||
- 🐞 修复 LocaleProvider 中 moment.locale 调用报错的问题。 [#9853](https://github.com/ant-design/ant-design/pull/9853)
|
||||
- 🐞 修复 WeekPicker 的 style 属性不生效的问题。[#9848](https://github.com/ant-design/ant-design/issues/9848)
|
||||
- 🐞 修复 Layout.Sider 的 TypeScript 定义。[#9885](https://github.com/ant-design/ant-design/pull/9885) [@zachguo](https://github.com/zachguo)
|
||||
- 💄 优化了 Modal 中超长内容的显示。[#9592](https://github.com/ant-design/ant-design/pull/9592)
|
||||
- 🌟 新增斯洛维尼亚语。
|
||||
|
||||
## 3.3.3
|
||||
|
||||
`2018-03-25`
|
||||
|
||||
- 回退上个版本 Upload 中 `file` 类型的修改。
|
||||
|
||||
## 3.3.2
|
||||
|
||||
`2018-03-24`
|
||||
|
||||
- 🐞 `Carousel`: 升级 `react-slick` 版本以修复宽度计算错误。 [#3659](https://github.com/ant-design/ant-design/issues/3659)
|
||||
- 💄 `Rate`: 调整 `disabled` 样式。 [#9747](https://github.com/ant-design/ant-design/issues/9747)
|
||||
- 💄 `Modal`: 调整 `confirm-modal` 样式以修复标题多行展示问题。 [#9374](https://github.com/ant-design/ant-design/issues/9374)
|
||||
- 💄 `Modal`: 调整 `confirm-modal` 样式以修复 content 内使用栅格会错位的问题。 [#9374](https://github.com/ant-design/ant-design/issues/9374)
|
||||
- 💄 `Menu`: 调整样式以修复鼠标事件范围。[#9666](https://github.com/ant-design/ant-design/pull/9666) [@dgeibi](https://github.com/dgeibi)
|
||||
- 🐞 `Upload`: 修复 `beforeUpload` 的 `file` 类型错误。 [#9775](https://github.com/ant-design/ant-design/issues/9775)
|
||||
- 🐞 `Button`: 修复文本改变时,空格插入没有重新计算 [4502ad8](https://github.com/ant-design/ant-design/commit/4502ad8376e536c450fa4f27d2a5855be5a153e7)
|
||||
|
||||
@@ -88,6 +88,7 @@ import 'antd/dist/antd.css'; // or 'antd/dist/antd.less'
|
||||
|
||||
```bash
|
||||
$ git clone git@github.com:ant-design/ant-design.git
|
||||
$ cd ant-design
|
||||
$ npm install
|
||||
$ npm start
|
||||
```
|
||||
|
||||
@@ -1,7 +1,15 @@
|
||||
import * as antd from '..';
|
||||
const warnSpy = jest.spyOn(console, 'warn').mockImplementation(() => {});
|
||||
const antd = require('..');
|
||||
|
||||
describe('antd', () => {
|
||||
it('exports modules correctly', () => {
|
||||
expect(Object.keys(antd)).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it('should hint when import all components', () => {
|
||||
expect(warnSpy).toBeCalledWith(
|
||||
'You are using a whole package of antd, please use https://www.npmjs.com/package/babel-plugin-import to reduce app bundle size.'
|
||||
);
|
||||
warnSpy.mockRestore();
|
||||
});
|
||||
});
|
||||
|
||||
3
components/_util/type.ts
Normal file
3
components/_util/type.ts
Normal file
@@ -0,0 +1,3 @@
|
||||
export type Diff<T extends string, U extends string> = ({ [P in T]: P } &
|
||||
{ [P in U]: never } & { [x: string]: never })[T];
|
||||
export type Omit<T, K extends keyof T> = Pick<T, Diff<keyof T, K>>;
|
||||
@@ -18,16 +18,16 @@ import { Alert } from 'antd';
|
||||
|
||||
class App extends React.Component {
|
||||
state = {
|
||||
visiable: true,
|
||||
visible: true,
|
||||
}
|
||||
handleClose = () => {
|
||||
this.setState({ visiable: false });
|
||||
this.setState({ visible: false });
|
||||
}
|
||||
render() {
|
||||
return (
|
||||
<div>
|
||||
{
|
||||
this.state.visiable ? (
|
||||
this.state.visible ? (
|
||||
<Alert
|
||||
message="Alert Message Text"
|
||||
type="success"
|
||||
|
||||
@@ -8,11 +8,11 @@ import AnchorLink from './AnchorLink';
|
||||
import getScroll from '../_util/getScroll';
|
||||
import getRequestAnimationFrame from '../_util/getRequestAnimationFrame';
|
||||
|
||||
function getDefaultTarget() {
|
||||
function getDefaultContainer() {
|
||||
return window;
|
||||
}
|
||||
|
||||
function getOffsetTop(element: HTMLElement): number {
|
||||
function getOffsetTop(element: HTMLElement, container: AnchorContainer): number {
|
||||
if (!element) {
|
||||
return 0;
|
||||
}
|
||||
@@ -24,9 +24,11 @@ function getOffsetTop(element: HTMLElement): number {
|
||||
const rect = element.getBoundingClientRect();
|
||||
|
||||
if (rect.width || rect.height) {
|
||||
const doc = element.ownerDocument;
|
||||
const docElem = doc.documentElement;
|
||||
return rect.top - docElem.clientTop;
|
||||
if (container === window) {
|
||||
container = element.ownerDocument.documentElement;
|
||||
return rect.top - container.clientTop;
|
||||
}
|
||||
return rect.top - (container as HTMLElement).getBoundingClientRect().top;
|
||||
}
|
||||
|
||||
return rect.top;
|
||||
@@ -43,21 +45,27 @@ function easeInOutCubic(t: number, b: number, c: number, d: number) {
|
||||
|
||||
const reqAnimFrame = getRequestAnimationFrame();
|
||||
const sharpMatcherRegx = /#([^#]+)$/;
|
||||
function scrollTo(href: string, offsetTop = 0, target: () => Window | HTMLElement, callback = () => { }) {
|
||||
const scrollTop = getScroll(target(), true);
|
||||
function scrollTo(href: string, offsetTop = 0, getContainer: () => AnchorContainer, callback = () => { }) {
|
||||
const container = getContainer();
|
||||
const scrollTop = getScroll(container, true);
|
||||
const sharpLinkMatch = sharpMatcherRegx.exec(href);
|
||||
if (!sharpLinkMatch) { return; }
|
||||
const targetElement = document.getElementById(sharpLinkMatch[1]);
|
||||
if (!targetElement) {
|
||||
return;
|
||||
}
|
||||
const eleOffsetTop = getOffsetTop(targetElement);
|
||||
const eleOffsetTop = getOffsetTop(targetElement, container);
|
||||
const targetScrollTop = scrollTop + eleOffsetTop - offsetTop;
|
||||
const startTime = Date.now();
|
||||
const frameFunc = () => {
|
||||
const timestamp = Date.now();
|
||||
const time = timestamp - startTime;
|
||||
window.scrollTo(window.pageXOffset, easeInOutCubic(time, scrollTop, targetScrollTop, 450));
|
||||
const nextScrollTop = easeInOutCubic(time, scrollTop, targetScrollTop, 450);
|
||||
if (container === window) {
|
||||
window.scrollTo(window.pageXOffset, nextScrollTop);
|
||||
} else {
|
||||
(container as HTMLElement).scrollTop = nextScrollTop;
|
||||
}
|
||||
if (time < 450) {
|
||||
reqAnimFrame(frameFunc);
|
||||
} else {
|
||||
@@ -73,6 +81,8 @@ type Section = {
|
||||
top: number;
|
||||
};
|
||||
|
||||
export type AnchorContainer = HTMLElement | Window;
|
||||
|
||||
export interface AnchorProps {
|
||||
prefixCls?: string;
|
||||
className?: string;
|
||||
@@ -82,7 +92,14 @@ export interface AnchorProps {
|
||||
bounds?: number;
|
||||
affix?: boolean;
|
||||
showInkInFixed?: boolean;
|
||||
target?: () => HTMLElement | Window;
|
||||
getContainer?: () => AnchorContainer;
|
||||
}
|
||||
|
||||
export interface AnchorDefaultProps extends AnchorProps {
|
||||
prefixCls: string;
|
||||
affix: boolean;
|
||||
showInkInFixed: boolean;
|
||||
getContainer: () => AnchorContainer;
|
||||
}
|
||||
|
||||
export default class Anchor extends React.Component<AnchorProps, any> {
|
||||
@@ -92,6 +109,7 @@ export default class Anchor extends React.Component<AnchorProps, any> {
|
||||
prefixCls: 'ant-anchor',
|
||||
affix: true,
|
||||
showInkInFixed: false,
|
||||
getContainer: getDefaultContainer,
|
||||
};
|
||||
|
||||
static childContextTypes = {
|
||||
@@ -133,8 +151,8 @@ export default class Anchor extends React.Component<AnchorProps, any> {
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
const getTarget = this.props.target || getDefaultTarget;
|
||||
this.scrollEvent = addEventListener(getTarget(), 'scroll', this.handleScroll);
|
||||
const { getContainer } = this.props as AnchorDefaultProps;
|
||||
this.scrollEvent = addEventListener(getContainer(), 'scroll', this.handleScroll);
|
||||
this.handleScroll();
|
||||
}
|
||||
|
||||
@@ -159,10 +177,10 @@ export default class Anchor extends React.Component<AnchorProps, any> {
|
||||
}
|
||||
|
||||
handleScrollTo = (link: string) => {
|
||||
const { offsetTop, target = getDefaultTarget } = this.props;
|
||||
const { offsetTop, getContainer } = this.props as AnchorDefaultProps;
|
||||
this.animating = true;
|
||||
this.setState({ activeLink: link });
|
||||
scrollTo(link, offsetTop, target, () => {
|
||||
scrollTo(link, offsetTop, getContainer, () => {
|
||||
this.animating = false;
|
||||
});
|
||||
}
|
||||
@@ -174,16 +192,20 @@ export default class Anchor extends React.Component<AnchorProps, any> {
|
||||
}
|
||||
|
||||
const linkSections: Array<Section> = [];
|
||||
const { getContainer } = this.props as AnchorDefaultProps;
|
||||
const container = getContainer();
|
||||
this.links.forEach(link => {
|
||||
const sharpLinkMatch = sharpMatcherRegx.exec(link.toString());
|
||||
if (!sharpLinkMatch) { return; }
|
||||
const target = document.getElementById(sharpLinkMatch[1]);
|
||||
if (target && getOffsetTop(target) < offsetTop + bounds) {
|
||||
const top = getOffsetTop(target);
|
||||
linkSections.push({
|
||||
link,
|
||||
top,
|
||||
});
|
||||
if (target) {
|
||||
const top = getOffsetTop(target, container);
|
||||
if (top < offsetTop + bounds) {
|
||||
linkSections.push({
|
||||
link,
|
||||
top,
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -199,7 +221,8 @@ export default class Anchor extends React.Component<AnchorProps, any> {
|
||||
return;
|
||||
}
|
||||
const { prefixCls } = this.props;
|
||||
const linkNode = ReactDOM.findDOMNode(this as any).getElementsByClassName(`${prefixCls}-link-title-active`)[0];
|
||||
const anchorNode = ReactDOM.findDOMNode(this) as Element;
|
||||
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`;
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@ 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(px) |
|
||||
| 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 |
|
||||
|
||||
@@ -20,6 +20,7 @@ title: Anchor
|
||||
| --- | --- | --- | --- |
|
||||
| affix | 固定模式 | boolean | true |
|
||||
| bounds | 锚点区域边界 | number | 5(px) |
|
||||
| getContainer | 指定滚动的容器 | () => HTMLElement | () => window |
|
||||
| offsetBottom | 距离窗口底部达到指定偏移量后触发 | number | |
|
||||
| offsetTop | 距离窗口顶部达到指定偏移量后触发 | number | |
|
||||
| showInkInFixed | 固定模式是否显示小圆点 | boolean | false |
|
||||
|
||||
@@ -21,7 +21,7 @@ export type ValidInputElement =
|
||||
export interface AutoCompleteProps extends AbstractSelectProps {
|
||||
value?: SelectValue;
|
||||
defaultValue?: SelectValue;
|
||||
dataSource: DataSourceItemType[];
|
||||
dataSource?: DataSourceItemType[];
|
||||
optionLabelProp?: string;
|
||||
onChange?: (value: SelectValue) => void;
|
||||
onSelect?: (value: SelectValue, option: Object) => any;
|
||||
|
||||
@@ -8,4 +8,22 @@ describe('Avatar Render', () => {
|
||||
const children = wrapper.find('.ant-avatar-string');
|
||||
expect(children.length).toBe(1);
|
||||
});
|
||||
|
||||
it('should render fallback string correctly', () => {
|
||||
const div = global.document.createElement('div');
|
||||
global.document.body.appendChild(div);
|
||||
|
||||
const wrapper = mount(<Avatar src="http://error.url">Fallback</Avatar>, { attachTo: div });
|
||||
wrapper.instance().setScale = jest.fn(() => wrapper.instance().setState({ scale: 0.5 }));
|
||||
wrapper.setState({ isImgExist: false });
|
||||
|
||||
const children = wrapper.find('.ant-avatar-string');
|
||||
expect(children.length).toBe(1);
|
||||
expect(children.text()).toBe('Fallback');
|
||||
expect(wrapper.instance().setScale).toBeCalled();
|
||||
expect(div.querySelector('.ant-avatar-string').style.transform).toBe('scale(0.5)');
|
||||
|
||||
wrapper.detach();
|
||||
global.document.body.removeChild(div);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -46,7 +46,8 @@ export default class Avatar extends React.Component<AvatarProps, AvatarState> {
|
||||
|
||||
componentDidUpdate(prevProps: AvatarProps, prevState: AvatarState) {
|
||||
if (prevProps.children !== this.props.children
|
||||
|| (prevState.scale !== this.state.scale && this.state.scale === 1)) {
|
||||
|| (prevState.scale !== this.state.scale && this.state.scale === 1)
|
||||
|| (prevState.isImgExist !== this.state.isImgExist)) {
|
||||
this.setScale();
|
||||
}
|
||||
}
|
||||
@@ -55,7 +56,8 @@ export default class Avatar extends React.Component<AvatarProps, AvatarState> {
|
||||
const childrenNode = this.avatarChildren;
|
||||
if (childrenNode) {
|
||||
const childrenWidth = childrenNode.offsetWidth;
|
||||
const avatarWidth = ReactDOM.findDOMNode(this).getBoundingClientRect().width;
|
||||
const avatarNode = ReactDOM.findDOMNode(this) as Element;
|
||||
const avatarWidth = avatarNode.getBoundingClientRect().width;
|
||||
// add 4px gap for each side to get better performance
|
||||
if (avatarWidth - 8 < childrenWidth) {
|
||||
this.setState({
|
||||
|
||||
@@ -106,7 +106,7 @@ export default class ScrollNumber extends Component<ScrollNumberProps, ScrollNum
|
||||
return createElement('span', {
|
||||
className: `${this.props.prefixCls}-only`,
|
||||
style: {
|
||||
transition: removeTransition && 'none',
|
||||
transition: removeTransition ? 'none' : undefined,
|
||||
msTransform: `translateY(${-position * 100}%)`,
|
||||
WebkitTransform: `translateY(${-position * 100}%)`,
|
||||
transform: `translateY(${-position * 100}%)`,
|
||||
|
||||
@@ -212,7 +212,7 @@ exports[`renders ./components/button/demo/disabled.md correctly 1`] = `
|
||||
</button>
|
||||
<br />
|
||||
<button
|
||||
class="ant-btn"
|
||||
class="ant-btn ant-btn-background-ghost"
|
||||
type="button"
|
||||
>
|
||||
<span>
|
||||
@@ -220,7 +220,7 @@ exports[`renders ./components/button/demo/disabled.md correctly 1`] = `
|
||||
</span>
|
||||
</button>
|
||||
<button
|
||||
class="ant-btn"
|
||||
class="ant-btn ant-btn-background-ghost"
|
||||
disabled=""
|
||||
type="button"
|
||||
>
|
||||
|
||||
@@ -34,7 +34,7 @@ function insertSpace(child: React.ReactChild, needInserted: boolean) {
|
||||
return child;
|
||||
}
|
||||
|
||||
export type ButtonType = 'primary' | 'ghost' | 'dashed' | 'danger';
|
||||
export type ButtonType = 'default' | 'primary' | 'ghost' | 'dashed' | 'danger';
|
||||
export type ButtonShape = 'circle' | 'circle-outline';
|
||||
export type ButtonSize = 'small' | 'default' | 'large';
|
||||
|
||||
|
||||
@@ -24,8 +24,8 @@ ReactDOM.render(
|
||||
<Button>Default</Button>
|
||||
<Button disabled>Default(disabled)</Button>
|
||||
<br />
|
||||
<Button>Ghost</Button>
|
||||
<Button disabled>Ghost(disabled)</Button>
|
||||
<Button ghost>Ghost</Button>
|
||||
<Button ghost disabled>Ghost(disabled)</Button>
|
||||
<br />
|
||||
<Button type="dashed">Dashed</Button>
|
||||
<Button type="dashed" disabled>Dashed(disabled)</Button>
|
||||
|
||||
2
components/calendar/locale/sl_SI.tsx
Normal file
2
components/calendar/locale/sl_SI.tsx
Normal file
@@ -0,0 +1,2 @@
|
||||
import sl_SI from '../../date-picker/locale/sl_SI';
|
||||
export default sl_SI;
|
||||
@@ -371,79 +371,175 @@ exports[`renders ./components/card/demo/inner.md correctly 1`] = `
|
||||
`;
|
||||
|
||||
exports[`renders ./components/card/demo/loading.md correctly 1`] = `
|
||||
<div
|
||||
class="ant-card ant-card-loading ant-card-bordered"
|
||||
style="width:34%"
|
||||
>
|
||||
<div>
|
||||
<div
|
||||
class="ant-card-head"
|
||||
class="ant-card ant-card-loading ant-card-bordered"
|
||||
>
|
||||
<div
|
||||
class="ant-card-head-wrapper"
|
||||
class="ant-card-head"
|
||||
>
|
||||
<div
|
||||
class="ant-card-head-title"
|
||||
class="ant-card-head-wrapper"
|
||||
>
|
||||
Card title
|
||||
<div
|
||||
class="ant-card-head-title"
|
||||
>
|
||||
Card title
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
class="ant-card-body"
|
||||
>
|
||||
<div
|
||||
class="ant-card-loading-content"
|
||||
>
|
||||
<div
|
||||
class="ant-row"
|
||||
style="margin-left:-4px;margin-right:-4px"
|
||||
>
|
||||
<div
|
||||
class="ant-col-22"
|
||||
style="padding-left:4px;padding-right:4px"
|
||||
>
|
||||
<div
|
||||
class="ant-card-loading-block"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
class="ant-row"
|
||||
style="margin-left:-4px;margin-right:-4px"
|
||||
>
|
||||
<div
|
||||
class="ant-col-8"
|
||||
style="padding-left:4px;padding-right:4px"
|
||||
>
|
||||
<div
|
||||
class="ant-card-loading-block"
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
class="ant-col-15"
|
||||
style="padding-left:4px;padding-right:4px"
|
||||
>
|
||||
<div
|
||||
class="ant-card-loading-block"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
class="ant-row"
|
||||
style="margin-left:-4px;margin-right:-4px"
|
||||
>
|
||||
<div
|
||||
class="ant-col-6"
|
||||
style="padding-left:4px;padding-right:4px"
|
||||
>
|
||||
<div
|
||||
class="ant-card-loading-block"
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
class="ant-col-18"
|
||||
style="padding-left:4px;padding-right:4px"
|
||||
>
|
||||
<div
|
||||
class="ant-card-loading-block"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
class="ant-row"
|
||||
style="margin-left:-4px;margin-right:-4px"
|
||||
>
|
||||
<div
|
||||
class="ant-col-13"
|
||||
style="padding-left:4px;padding-right:4px"
|
||||
>
|
||||
<div
|
||||
class="ant-card-loading-block"
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
class="ant-col-9"
|
||||
style="padding-left:4px;padding-right:4px"
|
||||
>
|
||||
<div
|
||||
class="ant-card-loading-block"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
class="ant-row"
|
||||
style="margin-left:-4px;margin-right:-4px"
|
||||
>
|
||||
<div
|
||||
class="ant-col-4"
|
||||
style="padding-left:4px;padding-right:4px"
|
||||
>
|
||||
<div
|
||||
class="ant-card-loading-block"
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
class="ant-col-3"
|
||||
style="padding-left:4px;padding-right:4px"
|
||||
>
|
||||
<div
|
||||
class="ant-card-loading-block"
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
class="ant-col-16"
|
||||
style="padding-left:4px;padding-right:4px"
|
||||
>
|
||||
<div
|
||||
class="ant-card-loading-block"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
class="ant-row"
|
||||
style="margin-left:-4px;margin-right:-4px"
|
||||
>
|
||||
<div
|
||||
class="ant-col-8"
|
||||
style="padding-left:4px;padding-right:4px"
|
||||
>
|
||||
<div
|
||||
class="ant-card-loading-block"
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
class="ant-col-6"
|
||||
style="padding-left:4px;padding-right:4px"
|
||||
>
|
||||
<div
|
||||
class="ant-card-loading-block"
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
class="ant-col-8"
|
||||
style="padding-left:4px;padding-right:4px"
|
||||
>
|
||||
<div
|
||||
class="ant-card-loading-block"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
class="ant-card-body"
|
||||
<button
|
||||
class="ant-btn"
|
||||
style="margin-top:16px"
|
||||
type="button"
|
||||
>
|
||||
<div
|
||||
class="ant-card-loading-content"
|
||||
>
|
||||
<p
|
||||
class="ant-card-loading-block"
|
||||
style="width:94%"
|
||||
/>
|
||||
<p>
|
||||
<span
|
||||
class="ant-card-loading-block"
|
||||
style="width:28%"
|
||||
/>
|
||||
<span
|
||||
class="ant-card-loading-block"
|
||||
style="width:62%"
|
||||
/>
|
||||
</p>
|
||||
<p>
|
||||
<span
|
||||
class="ant-card-loading-block"
|
||||
style="width:22%"
|
||||
/>
|
||||
<span
|
||||
class="ant-card-loading-block"
|
||||
style="width:66%"
|
||||
/>
|
||||
</p>
|
||||
<p>
|
||||
<span
|
||||
class="ant-card-loading-block"
|
||||
style="width:56%"
|
||||
/>
|
||||
<span
|
||||
class="ant-card-loading-block"
|
||||
style="width:39%"
|
||||
/>
|
||||
</p>
|
||||
<p>
|
||||
<span
|
||||
class="ant-card-loading-block"
|
||||
style="width:21%"
|
||||
/>
|
||||
<span
|
||||
class="ant-card-loading-block"
|
||||
style="width:15%"
|
||||
/>
|
||||
<span
|
||||
class="ant-card-loading-block"
|
||||
style="width:40%"
|
||||
/>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<span>
|
||||
Toggle loading
|
||||
</span>
|
||||
</button>
|
||||
</div>
|
||||
`;
|
||||
|
||||
|
||||
@@ -14,11 +14,30 @@ title:
|
||||
Shows a loading indicator while the contents of the card is being fetched.
|
||||
|
||||
````jsx
|
||||
import { Card } from 'antd';
|
||||
import { Card, Button } from 'antd';
|
||||
|
||||
class LoadingCard extends React.Component {
|
||||
state = {
|
||||
loading: true,
|
||||
}
|
||||
|
||||
handleClick = () => {
|
||||
this.setState({ loading: !this.state.loading });
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
<div>
|
||||
<Card loading={this.state.loading} title="Card title">
|
||||
Whatever content
|
||||
</Card>
|
||||
<Button onClick={this.handleClick} style={{ marginTop: 16 }}>Toggle loading</Button>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
ReactDOM.render(
|
||||
<Card loading title="Card title" style={{ width: '34%' }}>
|
||||
Whatever content
|
||||
</Card>
|
||||
<LoadingCard />
|
||||
, mountNode);
|
||||
````
|
||||
|
||||
@@ -5,8 +5,11 @@ import omit from 'omit.js';
|
||||
import Grid from './Grid';
|
||||
import Meta from './Meta';
|
||||
import Tabs from '../tabs';
|
||||
import Row from '../row';
|
||||
import Col from '../col';
|
||||
import { throttleByAnimationFrameDecorator } from '../_util/throttleByAnimationFrame';
|
||||
import warning from '../_util/warning';
|
||||
import { Omit } from '../_util/type';
|
||||
|
||||
export { CardGridProps } from './Grid';
|
||||
export { CardMetaProps } from './Meta';
|
||||
@@ -18,7 +21,7 @@ export interface CardTabListType {
|
||||
tab: React.ReactNode;
|
||||
}
|
||||
|
||||
export interface CardProps {
|
||||
export interface CardProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'title'> {
|
||||
prefixCls?: string;
|
||||
title?: React.ReactNode;
|
||||
extra?: React.ReactNode;
|
||||
@@ -40,14 +43,20 @@ export interface CardProps {
|
||||
defaultActiveTabKey?: string;
|
||||
}
|
||||
|
||||
export default class Card extends React.Component<CardProps, {}> {
|
||||
export interface CardState {
|
||||
widerPadding: boolean;
|
||||
}
|
||||
|
||||
export default class Card extends React.Component<CardProps, CardState> {
|
||||
static Grid: typeof Grid = Grid;
|
||||
static Meta: typeof Meta = Meta;
|
||||
resizeEvent: any;
|
||||
updateWiderPaddingCalled: boolean;
|
||||
|
||||
state = {
|
||||
widerPadding: false,
|
||||
};
|
||||
|
||||
private resizeEvent: any;
|
||||
private updateWiderPaddingCalled: boolean = false;
|
||||
private container: HTMLDivElement;
|
||||
componentDidMount() {
|
||||
this.updateWiderPadding();
|
||||
@@ -56,9 +65,9 @@ export default class Card extends React.Component<CardProps, {}> {
|
||||
if ('noHovering' in this.props) {
|
||||
warning(
|
||||
!this.props.noHovering,
|
||||
'`noHovering` of Card is deperated, you can remove it safely or use `hoverable` instead.',
|
||||
'`noHovering` of Card is deprecated, you can remove it safely or use `hoverable` instead.',
|
||||
);
|
||||
warning(!!this.props.noHovering, '`noHovering={false}` of Card is deperated, use `hoverable` instead.');
|
||||
warning(!!this.props.noHovering, '`noHovering={false}` of Card is deprecated, use `hoverable` instead.');
|
||||
}
|
||||
}
|
||||
componentWillUnmount() {
|
||||
@@ -72,14 +81,14 @@ export default class Card extends React.Component<CardProps, {}> {
|
||||
if (!this.container) {
|
||||
return;
|
||||
}
|
||||
// 936 is a magic card width pixer number indicated by designer
|
||||
const WIDTH_BOUDARY_PX = 936;
|
||||
if (this.container.offsetWidth >= WIDTH_BOUDARY_PX && !this.state.widerPadding) {
|
||||
// 936 is a magic card width pixel number indicated by designer
|
||||
const WIDTH_BOUNDARY_PX = 936;
|
||||
if (this.container.offsetWidth >= WIDTH_BOUNDARY_PX && !this.state.widerPadding) {
|
||||
this.setState({ widerPadding: true }, () => {
|
||||
this.updateWiderPaddingCalled = true; // first render without css transition
|
||||
});
|
||||
}
|
||||
if (this.container.offsetWidth < WIDTH_BOUDARY_PX && this.state.widerPadding) {
|
||||
if (this.container.offsetWidth < WIDTH_BOUNDARY_PX && this.state.widerPadding) {
|
||||
this.setState({ widerPadding: false }, () => {
|
||||
this.updateWiderPaddingCalled = true; // first render without css transition
|
||||
});
|
||||
@@ -141,24 +150,57 @@ export default class Card extends React.Component<CardProps, {}> {
|
||||
|
||||
const loadingBlock = (
|
||||
<div className={`${prefixCls}-loading-content`}>
|
||||
<p className={`${prefixCls}-loading-block`} style={{ width: '94%' }} />
|
||||
<p>
|
||||
<span className={`${prefixCls}-loading-block`} style={{ width: '28%' }} />
|
||||
<span className={`${prefixCls}-loading-block`} style={{ width: '62%' }} />
|
||||
</p>
|
||||
<p>
|
||||
<span className={`${prefixCls}-loading-block`} style={{ width: '22%' }} />
|
||||
<span className={`${prefixCls}-loading-block`} style={{ width: '66%' }} />
|
||||
</p>
|
||||
<p>
|
||||
<span className={`${prefixCls}-loading-block`} style={{ width: '56%' }} />
|
||||
<span className={`${prefixCls}-loading-block`} style={{ width: '39%' }} />
|
||||
</p>
|
||||
<p>
|
||||
<span className={`${prefixCls}-loading-block`} style={{ width: '21%' }} />
|
||||
<span className={`${prefixCls}-loading-block`} style={{ width: '15%' }} />
|
||||
<span className={`${prefixCls}-loading-block`} style={{ width: '40%' }} />
|
||||
</p>
|
||||
<Row gutter={8}>
|
||||
<Col span={22}>
|
||||
<div className={`${prefixCls}-loading-block`} />
|
||||
</Col>
|
||||
</Row>
|
||||
<Row gutter={8}>
|
||||
<Col span={8}>
|
||||
<div className={`${prefixCls}-loading-block`} />
|
||||
</Col>
|
||||
<Col span={15}>
|
||||
<div className={`${prefixCls}-loading-block`} />
|
||||
</Col>
|
||||
</Row>
|
||||
<Row gutter={8}>
|
||||
<Col span={6}>
|
||||
<div className={`${prefixCls}-loading-block`} />
|
||||
</Col>
|
||||
<Col span={18}>
|
||||
<div className={`${prefixCls}-loading-block`} />
|
||||
</Col>
|
||||
</Row>
|
||||
<Row gutter={8}>
|
||||
<Col span={13}>
|
||||
<div className={`${prefixCls}-loading-block`} />
|
||||
</Col>
|
||||
<Col span={9}>
|
||||
<div className={`${prefixCls}-loading-block`} />
|
||||
</Col>
|
||||
</Row>
|
||||
<Row gutter={8}>
|
||||
<Col span={4}>
|
||||
<div className={`${prefixCls}-loading-block`} />
|
||||
</Col>
|
||||
<Col span={3}>
|
||||
<div className={`${prefixCls}-loading-block`} />
|
||||
</Col>
|
||||
<Col span={16}>
|
||||
<div className={`${prefixCls}-loading-block`} />
|
||||
</Col>
|
||||
</Row>
|
||||
<Row gutter={8}>
|
||||
<Col span={8}>
|
||||
<div className={`${prefixCls}-loading-block`} />
|
||||
</Col>
|
||||
<Col span={6}>
|
||||
<div className={`${prefixCls}-loading-block`} />
|
||||
</Col>
|
||||
<Col span={8}>
|
||||
<div className={`${prefixCls}-loading-block`} />
|
||||
</Col>
|
||||
</Row>
|
||||
</div>
|
||||
);
|
||||
|
||||
|
||||
@@ -72,7 +72,7 @@
|
||||
.clearfix;
|
||||
}
|
||||
|
||||
&-contain-grid &-body {
|
||||
&-contain-grid:not(&-loading) {
|
||||
margin: -1px 0 0 -1px;
|
||||
padding: 0;
|
||||
}
|
||||
@@ -135,10 +135,16 @@
|
||||
|
||||
& > .anticon {
|
||||
font-size: 16px;
|
||||
line-height: 22px;
|
||||
display: block;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
a {
|
||||
color: @text-color-secondary;
|
||||
line-height: 22px;
|
||||
display: inline-block;
|
||||
width: 100%;
|
||||
|
||||
&:hover {
|
||||
color: @primary-color;
|
||||
@@ -165,10 +171,6 @@
|
||||
transition: padding .3s;
|
||||
}
|
||||
|
||||
&-padding-transition &-extra {
|
||||
transition: right .3s;
|
||||
}
|
||||
|
||||
&-type-inner &-head {
|
||||
padding: 0 @card-padding-base;
|
||||
background: @background-color-light;
|
||||
@@ -219,20 +221,17 @@
|
||||
|
||||
&-loading &-body {
|
||||
user-select: none;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
&-loading-content {
|
||||
padding: @card-padding-base;
|
||||
p {
|
||||
margin: 0;
|
||||
}
|
||||
}
|
||||
|
||||
&-loading-block {
|
||||
display: inline-block;
|
||||
margin: 5px 2% 0 0;
|
||||
height: 14px;
|
||||
margin: 4px 0;
|
||||
border-radius: @border-radius-sm;
|
||||
background: linear-gradient(90deg, rgba(207, 216, 220, .2), rgba(207, 216, 220, .4), rgba(207, 216, 220, .2));
|
||||
animation: card-loading 1.4s ease infinite;
|
||||
|
||||
@@ -5,7 +5,7 @@ exports[`renders ./components/carousel/demo/autoplay.md correctly 1`] = `
|
||||
class="ant-carousel"
|
||||
>
|
||||
<div
|
||||
class="slick-initialized slick-slider"
|
||||
class="slick-slider slick-initialized"
|
||||
dir="ltr"
|
||||
>
|
||||
<div
|
||||
@@ -13,94 +13,205 @@ exports[`renders ./components/carousel/demo/autoplay.md correctly 1`] = `
|
||||
>
|
||||
<div
|
||||
class="slick-track"
|
||||
style="width:900%;left:-100%"
|
||||
>
|
||||
<div
|
||||
aria-hidden="true"
|
||||
class="slick-slide slick-cloned"
|
||||
data-index="-1"
|
||||
style="width:11.11111111111111%"
|
||||
tabindex="-1"
|
||||
>
|
||||
<h3>
|
||||
4
|
||||
</h3>
|
||||
<div>
|
||||
<div
|
||||
style="width:100%;display:inline-block"
|
||||
tabindex="-1"
|
||||
>
|
||||
<h3>
|
||||
4
|
||||
</h3>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
class="slick-slide slick-active slick-cloned slick-current"
|
||||
aria-hidden="false"
|
||||
class="slick-slide slick-active slick-current"
|
||||
data-index="0"
|
||||
style="outline:none"
|
||||
style="outline:none;width:11.11111111111111%"
|
||||
tabindex="-1"
|
||||
>
|
||||
<h3>
|
||||
1
|
||||
</h3>
|
||||
<div>
|
||||
<div
|
||||
style="width:100%;display:inline-block"
|
||||
tabindex="-1"
|
||||
>
|
||||
<h3>
|
||||
1
|
||||
</h3>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
class="slick-slide slick-cloned"
|
||||
aria-hidden="true"
|
||||
class="slick-slide"
|
||||
data-index="1"
|
||||
style="outline:none"
|
||||
style="outline:none;width:11.11111111111111%"
|
||||
tabindex="-1"
|
||||
>
|
||||
<h3>
|
||||
2
|
||||
</h3>
|
||||
<div>
|
||||
<div
|
||||
style="width:100%;display:inline-block"
|
||||
tabindex="-1"
|
||||
>
|
||||
<h3>
|
||||
2
|
||||
</h3>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
class="slick-slide slick-cloned"
|
||||
aria-hidden="true"
|
||||
class="slick-slide"
|
||||
data-index="2"
|
||||
style="outline:none"
|
||||
style="outline:none;width:11.11111111111111%"
|
||||
tabindex="-1"
|
||||
>
|
||||
<h3>
|
||||
3
|
||||
</h3>
|
||||
<div>
|
||||
<div
|
||||
style="width:100%;display:inline-block"
|
||||
tabindex="-1"
|
||||
>
|
||||
<h3>
|
||||
3
|
||||
</h3>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
class="slick-slide slick-cloned"
|
||||
aria-hidden="true"
|
||||
class="slick-slide"
|
||||
data-index="3"
|
||||
style="outline:none"
|
||||
style="outline:none;width:11.11111111111111%"
|
||||
tabindex="-1"
|
||||
>
|
||||
<h3>
|
||||
4
|
||||
</h3>
|
||||
<div>
|
||||
<div
|
||||
style="width:100%;display:inline-block"
|
||||
tabindex="-1"
|
||||
>
|
||||
<h3>
|
||||
4
|
||||
</h3>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
aria-hidden="true"
|
||||
class="slick-slide slick-cloned"
|
||||
data-index="4"
|
||||
style="width:11.11111111111111%"
|
||||
tabindex="-1"
|
||||
>
|
||||
<h3>
|
||||
1
|
||||
</h3>
|
||||
<div>
|
||||
<div
|
||||
style="width:100%;display:inline-block"
|
||||
tabindex="-1"
|
||||
>
|
||||
<h3>
|
||||
1
|
||||
</h3>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
aria-hidden="true"
|
||||
class="slick-slide slick-cloned"
|
||||
data-index="5"
|
||||
style="width:11.11111111111111%"
|
||||
tabindex="-1"
|
||||
>
|
||||
<h3>
|
||||
2
|
||||
</h3>
|
||||
<div>
|
||||
<div
|
||||
style="width:100%;display:inline-block"
|
||||
tabindex="-1"
|
||||
>
|
||||
<h3>
|
||||
2
|
||||
</h3>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
aria-hidden="true"
|
||||
class="slick-slide slick-cloned"
|
||||
data-index="6"
|
||||
style="width:11.11111111111111%"
|
||||
tabindex="-1"
|
||||
>
|
||||
<h3>
|
||||
3
|
||||
</h3>
|
||||
<div>
|
||||
<div
|
||||
style="width:100%;display:inline-block"
|
||||
tabindex="-1"
|
||||
>
|
||||
<h3>
|
||||
3
|
||||
</h3>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
aria-hidden="true"
|
||||
class="slick-slide slick-cloned"
|
||||
data-index="7"
|
||||
style="width:11.11111111111111%"
|
||||
tabindex="-1"
|
||||
>
|
||||
<h3>
|
||||
4
|
||||
</h3>
|
||||
<div>
|
||||
<div
|
||||
style="width:100%;display:inline-block"
|
||||
tabindex="-1"
|
||||
>
|
||||
<h3>
|
||||
4
|
||||
</h3>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<ul
|
||||
class="slick-dots"
|
||||
style="display:block"
|
||||
>
|
||||
<li
|
||||
class="slick-active"
|
||||
>
|
||||
<button>
|
||||
1
|
||||
</button>
|
||||
</li>
|
||||
<li
|
||||
class=""
|
||||
>
|
||||
<button>
|
||||
2
|
||||
</button>
|
||||
</li>
|
||||
<li
|
||||
class=""
|
||||
>
|
||||
<button>
|
||||
3
|
||||
</button>
|
||||
</li>
|
||||
<li
|
||||
class=""
|
||||
>
|
||||
<button>
|
||||
4
|
||||
</button>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
@@ -110,7 +221,7 @@ exports[`renders ./components/carousel/demo/basic.md correctly 1`] = `
|
||||
class="ant-carousel"
|
||||
>
|
||||
<div
|
||||
class="slick-initialized slick-slider"
|
||||
class="slick-slider slick-initialized"
|
||||
dir="ltr"
|
||||
>
|
||||
<div
|
||||
@@ -118,94 +229,205 @@ exports[`renders ./components/carousel/demo/basic.md correctly 1`] = `
|
||||
>
|
||||
<div
|
||||
class="slick-track"
|
||||
style="width:900%;left:-100%"
|
||||
>
|
||||
<div
|
||||
aria-hidden="true"
|
||||
class="slick-slide slick-cloned"
|
||||
data-index="-1"
|
||||
style="width:11.11111111111111%"
|
||||
tabindex="-1"
|
||||
>
|
||||
<h3>
|
||||
4
|
||||
</h3>
|
||||
<div>
|
||||
<div
|
||||
style="width:100%;display:inline-block"
|
||||
tabindex="-1"
|
||||
>
|
||||
<h3>
|
||||
4
|
||||
</h3>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
class="slick-slide slick-active slick-cloned slick-current"
|
||||
aria-hidden="false"
|
||||
class="slick-slide slick-active slick-current"
|
||||
data-index="0"
|
||||
style="outline:none"
|
||||
style="outline:none;width:11.11111111111111%"
|
||||
tabindex="-1"
|
||||
>
|
||||
<h3>
|
||||
1
|
||||
</h3>
|
||||
<div>
|
||||
<div
|
||||
style="width:100%;display:inline-block"
|
||||
tabindex="-1"
|
||||
>
|
||||
<h3>
|
||||
1
|
||||
</h3>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
class="slick-slide slick-cloned"
|
||||
aria-hidden="true"
|
||||
class="slick-slide"
|
||||
data-index="1"
|
||||
style="outline:none"
|
||||
style="outline:none;width:11.11111111111111%"
|
||||
tabindex="-1"
|
||||
>
|
||||
<h3>
|
||||
2
|
||||
</h3>
|
||||
<div>
|
||||
<div
|
||||
style="width:100%;display:inline-block"
|
||||
tabindex="-1"
|
||||
>
|
||||
<h3>
|
||||
2
|
||||
</h3>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
class="slick-slide slick-cloned"
|
||||
aria-hidden="true"
|
||||
class="slick-slide"
|
||||
data-index="2"
|
||||
style="outline:none"
|
||||
style="outline:none;width:11.11111111111111%"
|
||||
tabindex="-1"
|
||||
>
|
||||
<h3>
|
||||
3
|
||||
</h3>
|
||||
<div>
|
||||
<div
|
||||
style="width:100%;display:inline-block"
|
||||
tabindex="-1"
|
||||
>
|
||||
<h3>
|
||||
3
|
||||
</h3>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
class="slick-slide slick-cloned"
|
||||
aria-hidden="true"
|
||||
class="slick-slide"
|
||||
data-index="3"
|
||||
style="outline:none"
|
||||
style="outline:none;width:11.11111111111111%"
|
||||
tabindex="-1"
|
||||
>
|
||||
<h3>
|
||||
4
|
||||
</h3>
|
||||
<div>
|
||||
<div
|
||||
style="width:100%;display:inline-block"
|
||||
tabindex="-1"
|
||||
>
|
||||
<h3>
|
||||
4
|
||||
</h3>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
aria-hidden="true"
|
||||
class="slick-slide slick-cloned"
|
||||
data-index="4"
|
||||
style="width:11.11111111111111%"
|
||||
tabindex="-1"
|
||||
>
|
||||
<h3>
|
||||
1
|
||||
</h3>
|
||||
<div>
|
||||
<div
|
||||
style="width:100%;display:inline-block"
|
||||
tabindex="-1"
|
||||
>
|
||||
<h3>
|
||||
1
|
||||
</h3>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
aria-hidden="true"
|
||||
class="slick-slide slick-cloned"
|
||||
data-index="5"
|
||||
style="width:11.11111111111111%"
|
||||
tabindex="-1"
|
||||
>
|
||||
<h3>
|
||||
2
|
||||
</h3>
|
||||
<div>
|
||||
<div
|
||||
style="width:100%;display:inline-block"
|
||||
tabindex="-1"
|
||||
>
|
||||
<h3>
|
||||
2
|
||||
</h3>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
aria-hidden="true"
|
||||
class="slick-slide slick-cloned"
|
||||
data-index="6"
|
||||
style="width:11.11111111111111%"
|
||||
tabindex="-1"
|
||||
>
|
||||
<h3>
|
||||
3
|
||||
</h3>
|
||||
<div>
|
||||
<div
|
||||
style="width:100%;display:inline-block"
|
||||
tabindex="-1"
|
||||
>
|
||||
<h3>
|
||||
3
|
||||
</h3>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
aria-hidden="true"
|
||||
class="slick-slide slick-cloned"
|
||||
data-index="7"
|
||||
style="width:11.11111111111111%"
|
||||
tabindex="-1"
|
||||
>
|
||||
<h3>
|
||||
4
|
||||
</h3>
|
||||
<div>
|
||||
<div
|
||||
style="width:100%;display:inline-block"
|
||||
tabindex="-1"
|
||||
>
|
||||
<h3>
|
||||
4
|
||||
</h3>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<ul
|
||||
class="slick-dots"
|
||||
style="display:block"
|
||||
>
|
||||
<li
|
||||
class="slick-active"
|
||||
>
|
||||
<button>
|
||||
1
|
||||
</button>
|
||||
</li>
|
||||
<li
|
||||
class=""
|
||||
>
|
||||
<button>
|
||||
2
|
||||
</button>
|
||||
</li>
|
||||
<li
|
||||
class=""
|
||||
>
|
||||
<button>
|
||||
3
|
||||
</button>
|
||||
</li>
|
||||
<li
|
||||
class=""
|
||||
>
|
||||
<button>
|
||||
4
|
||||
</button>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
@@ -215,7 +437,7 @@ exports[`renders ./components/carousel/demo/fade.md correctly 1`] = `
|
||||
class="ant-carousel"
|
||||
>
|
||||
<div
|
||||
class="slick-initialized slick-slider"
|
||||
class="slick-slider slick-initialized"
|
||||
dir="ltr"
|
||||
>
|
||||
<div
|
||||
@@ -223,49 +445,115 @@ exports[`renders ./components/carousel/demo/fade.md correctly 1`] = `
|
||||
>
|
||||
<div
|
||||
class="slick-track"
|
||||
style="width:900%;left:-100%"
|
||||
>
|
||||
<div
|
||||
class="slick-slide slick-active slick-cloned slick-current"
|
||||
aria-hidden="false"
|
||||
class="slick-slide slick-active slick-current"
|
||||
data-index="0"
|
||||
style="outline:none;position:relative;left:0;opacity:1;transition:opacity 500ms ease, visibility 500ms ease;-webkit-transition:opacity 500ms ease, visibility 500ms ease"
|
||||
style="outline:none;width:11.11111111111111%;position:relative;left:0;opacity:1;transition:opacity 500ms ease, visibility 500ms ease;-webkit-transition:opacity 500ms ease, visibility 500ms ease"
|
||||
tabindex="-1"
|
||||
>
|
||||
<h3>
|
||||
1
|
||||
</h3>
|
||||
<div>
|
||||
<div
|
||||
style="width:100%;display:inline-block"
|
||||
tabindex="-1"
|
||||
>
|
||||
<h3>
|
||||
1
|
||||
</h3>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
class="slick-slide slick-cloned"
|
||||
aria-hidden="true"
|
||||
class="slick-slide"
|
||||
data-index="1"
|
||||
style="outline:none;position:relative;left:0;opacity:0;transition:opacity 500ms ease, visibility 500ms ease;-webkit-transition:opacity 500ms ease, visibility 500ms ease"
|
||||
style="outline:none;width:11.11111111111111%;position:relative;left:-11px;opacity:0;transition:opacity 500ms ease, visibility 500ms ease;-webkit-transition:opacity 500ms ease, visibility 500ms ease"
|
||||
tabindex="-1"
|
||||
>
|
||||
<h3>
|
||||
2
|
||||
</h3>
|
||||
<div>
|
||||
<div
|
||||
style="width:100%;display:inline-block"
|
||||
tabindex="-1"
|
||||
>
|
||||
<h3>
|
||||
2
|
||||
</h3>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
class="slick-slide slick-cloned"
|
||||
aria-hidden="true"
|
||||
class="slick-slide"
|
||||
data-index="2"
|
||||
style="outline:none;position:relative;left:0;opacity:0;transition:opacity 500ms ease, visibility 500ms ease;-webkit-transition:opacity 500ms ease, visibility 500ms ease"
|
||||
style="outline:none;width:11.11111111111111%;position:relative;left:-22px;opacity:0;transition:opacity 500ms ease, visibility 500ms ease;-webkit-transition:opacity 500ms ease, visibility 500ms ease"
|
||||
tabindex="-1"
|
||||
>
|
||||
<h3>
|
||||
3
|
||||
</h3>
|
||||
<div>
|
||||
<div
|
||||
style="width:100%;display:inline-block"
|
||||
tabindex="-1"
|
||||
>
|
||||
<h3>
|
||||
3
|
||||
</h3>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
class="slick-slide slick-cloned"
|
||||
aria-hidden="true"
|
||||
class="slick-slide"
|
||||
data-index="3"
|
||||
style="outline:none;position:relative;left:0;opacity:0;transition:opacity 500ms ease, visibility 500ms ease;-webkit-transition:opacity 500ms ease, visibility 500ms ease"
|
||||
style="outline:none;width:11.11111111111111%;position:relative;left:-33px;opacity:0;transition:opacity 500ms ease, visibility 500ms ease;-webkit-transition:opacity 500ms ease, visibility 500ms ease"
|
||||
tabindex="-1"
|
||||
>
|
||||
<h3>
|
||||
4
|
||||
</h3>
|
||||
<div>
|
||||
<div
|
||||
style="width:100%;display:inline-block"
|
||||
tabindex="-1"
|
||||
>
|
||||
<h3>
|
||||
4
|
||||
</h3>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<ul
|
||||
class="slick-dots"
|
||||
style="display:block"
|
||||
>
|
||||
<li
|
||||
class="slick-active"
|
||||
>
|
||||
<button>
|
||||
1
|
||||
</button>
|
||||
</li>
|
||||
<li
|
||||
class=""
|
||||
>
|
||||
<button>
|
||||
2
|
||||
</button>
|
||||
</li>
|
||||
<li
|
||||
class=""
|
||||
>
|
||||
<button>
|
||||
3
|
||||
</button>
|
||||
</li>
|
||||
<li
|
||||
class=""
|
||||
>
|
||||
<button>
|
||||
4
|
||||
</button>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
@@ -275,7 +563,7 @@ exports[`renders ./components/carousel/demo/vertical.md correctly 1`] = `
|
||||
class="ant-carousel ant-carousel-vertical"
|
||||
>
|
||||
<div
|
||||
class="slick-initialized slick-slider slick-vertical"
|
||||
class="slick-slider slick-vertical slick-initialized"
|
||||
dir="ltr"
|
||||
>
|
||||
<div
|
||||
@@ -283,94 +571,205 @@ exports[`renders ./components/carousel/demo/vertical.md correctly 1`] = `
|
||||
>
|
||||
<div
|
||||
class="slick-track"
|
||||
style="width:900%;left:-100%"
|
||||
>
|
||||
<div
|
||||
aria-hidden="true"
|
||||
class="slick-slide slick-cloned"
|
||||
data-index="-1"
|
||||
style="width:11.11111111111111%"
|
||||
tabindex="-1"
|
||||
>
|
||||
<h3>
|
||||
4
|
||||
</h3>
|
||||
<div>
|
||||
<div
|
||||
style="width:100%;display:inline-block"
|
||||
tabindex="-1"
|
||||
>
|
||||
<h3>
|
||||
4
|
||||
</h3>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
class="slick-slide slick-active slick-cloned slick-current"
|
||||
aria-hidden="false"
|
||||
class="slick-slide slick-active slick-current"
|
||||
data-index="0"
|
||||
style="outline:none"
|
||||
style="outline:none;width:11.11111111111111%"
|
||||
tabindex="-1"
|
||||
>
|
||||
<h3>
|
||||
1
|
||||
</h3>
|
||||
<div>
|
||||
<div
|
||||
style="width:100%;display:inline-block"
|
||||
tabindex="-1"
|
||||
>
|
||||
<h3>
|
||||
1
|
||||
</h3>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
class="slick-slide slick-cloned"
|
||||
aria-hidden="true"
|
||||
class="slick-slide"
|
||||
data-index="1"
|
||||
style="outline:none"
|
||||
style="outline:none;width:11.11111111111111%"
|
||||
tabindex="-1"
|
||||
>
|
||||
<h3>
|
||||
2
|
||||
</h3>
|
||||
<div>
|
||||
<div
|
||||
style="width:100%;display:inline-block"
|
||||
tabindex="-1"
|
||||
>
|
||||
<h3>
|
||||
2
|
||||
</h3>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
class="slick-slide slick-cloned"
|
||||
aria-hidden="true"
|
||||
class="slick-slide"
|
||||
data-index="2"
|
||||
style="outline:none"
|
||||
style="outline:none;width:11.11111111111111%"
|
||||
tabindex="-1"
|
||||
>
|
||||
<h3>
|
||||
3
|
||||
</h3>
|
||||
<div>
|
||||
<div
|
||||
style="width:100%;display:inline-block"
|
||||
tabindex="-1"
|
||||
>
|
||||
<h3>
|
||||
3
|
||||
</h3>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
class="slick-slide slick-cloned"
|
||||
aria-hidden="true"
|
||||
class="slick-slide"
|
||||
data-index="3"
|
||||
style="outline:none"
|
||||
style="outline:none;width:11.11111111111111%"
|
||||
tabindex="-1"
|
||||
>
|
||||
<h3>
|
||||
4
|
||||
</h3>
|
||||
<div>
|
||||
<div
|
||||
style="width:100%;display:inline-block"
|
||||
tabindex="-1"
|
||||
>
|
||||
<h3>
|
||||
4
|
||||
</h3>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
aria-hidden="true"
|
||||
class="slick-slide slick-cloned"
|
||||
data-index="4"
|
||||
style="width:11.11111111111111%"
|
||||
tabindex="-1"
|
||||
>
|
||||
<h3>
|
||||
1
|
||||
</h3>
|
||||
<div>
|
||||
<div
|
||||
style="width:100%;display:inline-block"
|
||||
tabindex="-1"
|
||||
>
|
||||
<h3>
|
||||
1
|
||||
</h3>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
aria-hidden="true"
|
||||
class="slick-slide slick-cloned"
|
||||
data-index="5"
|
||||
style="width:11.11111111111111%"
|
||||
tabindex="-1"
|
||||
>
|
||||
<h3>
|
||||
2
|
||||
</h3>
|
||||
<div>
|
||||
<div
|
||||
style="width:100%;display:inline-block"
|
||||
tabindex="-1"
|
||||
>
|
||||
<h3>
|
||||
2
|
||||
</h3>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
aria-hidden="true"
|
||||
class="slick-slide slick-cloned"
|
||||
data-index="6"
|
||||
style="width:11.11111111111111%"
|
||||
tabindex="-1"
|
||||
>
|
||||
<h3>
|
||||
3
|
||||
</h3>
|
||||
<div>
|
||||
<div
|
||||
style="width:100%;display:inline-block"
|
||||
tabindex="-1"
|
||||
>
|
||||
<h3>
|
||||
3
|
||||
</h3>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
aria-hidden="true"
|
||||
class="slick-slide slick-cloned"
|
||||
data-index="7"
|
||||
style="width:11.11111111111111%"
|
||||
tabindex="-1"
|
||||
>
|
||||
<h3>
|
||||
4
|
||||
</h3>
|
||||
<div>
|
||||
<div
|
||||
style="width:100%;display:inline-block"
|
||||
tabindex="-1"
|
||||
>
|
||||
<h3>
|
||||
4
|
||||
</h3>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<ul
|
||||
class="slick-dots"
|
||||
style="display:block"
|
||||
>
|
||||
<li
|
||||
class="slick-active"
|
||||
>
|
||||
<button>
|
||||
1
|
||||
</button>
|
||||
</li>
|
||||
<li
|
||||
class=""
|
||||
>
|
||||
<button>
|
||||
2
|
||||
</button>
|
||||
</li>
|
||||
<li
|
||||
class=""
|
||||
>
|
||||
<button>
|
||||
3
|
||||
</button>
|
||||
</li>
|
||||
<li
|
||||
class=""
|
||||
>
|
||||
<button>
|
||||
4
|
||||
</button>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
|
||||
@@ -41,7 +41,7 @@ export interface CheckboxGroupContext {
|
||||
export default class CheckboxGroup extends React.Component<CheckboxGroupProps, CheckboxGroupState> {
|
||||
static defaultProps = {
|
||||
options: [],
|
||||
prefixCls: 'ant-checkbox-group',
|
||||
prefixCls: 'ant-checkbox',
|
||||
};
|
||||
|
||||
static propTypes = {
|
||||
@@ -115,23 +115,25 @@ export default class CheckboxGroup extends React.Component<CheckboxGroupProps, C
|
||||
render() {
|
||||
const { props, state } = this;
|
||||
const { prefixCls, className, style, options } = props;
|
||||
const groupPrefixCls = `${prefixCls}-group`;
|
||||
let children = props.children;
|
||||
if (options && options.length > 0) {
|
||||
children = this.getOptions().map(option => (
|
||||
<Checkbox
|
||||
prefixCls={prefixCls}
|
||||
key={option.value}
|
||||
disabled={'disabled' in option ? option.disabled : props.disabled}
|
||||
value={option.value}
|
||||
checked={state.value.indexOf(option.value) !== -1}
|
||||
onChange={() => this.toggleOption(option)}
|
||||
className={`${prefixCls}-item`}
|
||||
className={`${groupPrefixCls}-item`}
|
||||
>
|
||||
{option.label}
|
||||
</Checkbox>
|
||||
));
|
||||
}
|
||||
|
||||
const classString = classNames(prefixCls, className);
|
||||
const classString = classNames(groupPrefixCls, className);
|
||||
return (
|
||||
<div className={classString} style={style}>
|
||||
{children}
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`CheckboxGroup passes prefixCls down to checkbox 1`] = `
|
||||
<div
|
||||
class="my-checkbox-group"
|
||||
>
|
||||
<label
|
||||
class="my-checkbox-group-item my-checkbox-wrapper"
|
||||
>
|
||||
<span
|
||||
class="my-checkbox"
|
||||
>
|
||||
<input
|
||||
class="my-checkbox-input"
|
||||
type="checkbox"
|
||||
value="Apple"
|
||||
/>
|
||||
<span
|
||||
class="my-checkbox-inner"
|
||||
/>
|
||||
</span>
|
||||
<span>
|
||||
Apple
|
||||
</span>
|
||||
</label>
|
||||
<label
|
||||
class="my-checkbox-group-item my-checkbox-wrapper"
|
||||
>
|
||||
<span
|
||||
class="my-checkbox"
|
||||
>
|
||||
<input
|
||||
class="my-checkbox-input"
|
||||
type="checkbox"
|
||||
value="Orange"
|
||||
/>
|
||||
<span
|
||||
class="my-checkbox-inner"
|
||||
/>
|
||||
</span>
|
||||
<span>
|
||||
Orange
|
||||
</span>
|
||||
</label>
|
||||
</div>
|
||||
`;
|
||||
@@ -1,5 +1,5 @@
|
||||
import React from 'react';
|
||||
import { mount } from 'enzyme';
|
||||
import { mount, render } from 'enzyme';
|
||||
import Checkbox from '../index';
|
||||
|
||||
describe('CheckboxGroup', () => {
|
||||
@@ -51,4 +51,17 @@ describe('CheckboxGroup', () => {
|
||||
groupWrapper.find('.ant-checkbox-input').at(1).simulate('change');
|
||||
expect(onChangeGroup).toBeCalledWith(['Apple']);
|
||||
});
|
||||
|
||||
it('passes prefixCls down to checkbox', () => {
|
||||
const options = [
|
||||
{ label: 'Apple', value: 'Apple' },
|
||||
{ label: 'Orange', value: 'Orange' },
|
||||
];
|
||||
|
||||
const wrapper = render(
|
||||
<Checkbox.Group prefixCls="my-checkbox" options={options} />
|
||||
);
|
||||
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -40,8 +40,8 @@ export default class WeekPicker extends React.Component<any, any> {
|
||||
const selectedValue = this.state.value;
|
||||
const { prefixCls } = this.props;
|
||||
if (selectedValue &&
|
||||
current.year() === selectedValue.year() &&
|
||||
current.week() === selectedValue.week()) {
|
||||
current.year() === selectedValue.year() &&
|
||||
current.week() === selectedValue.week()) {
|
||||
return (
|
||||
<div className={`${prefixCls}-selected-day`}>
|
||||
<div className={`${prefixCls}-date`}>
|
||||
@@ -51,7 +51,7 @@ export default class WeekPicker extends React.Component<any, any> {
|
||||
);
|
||||
}
|
||||
return (
|
||||
<div className={`${prefixCls}-calendar-date`}>
|
||||
<div className={`${prefixCls}-date`}>
|
||||
{current.date()}
|
||||
</div>
|
||||
);
|
||||
@@ -84,6 +84,7 @@ export default class WeekPicker extends React.Component<any, any> {
|
||||
const {
|
||||
prefixCls, className, disabled, pickerClass, popupStyle,
|
||||
pickerInputClass, format, allowClear, locale, localeCode, disabledDate,
|
||||
style, onFocus, onBlur,
|
||||
} = this.props;
|
||||
|
||||
const pickerValue = this.state.value;
|
||||
@@ -123,8 +124,9 @@ export default class WeekPicker extends React.Component<any, any> {
|
||||
value={(value && value.format(format)) || ''}
|
||||
placeholder={placeholder}
|
||||
className={pickerInputClass}
|
||||
onFocus={this.props.onFocus}
|
||||
onBlur={this.props.onBlur}
|
||||
onFocus={onFocus}
|
||||
onBlur={onBlur}
|
||||
style={style}
|
||||
/>
|
||||
{clearIcon}
|
||||
<span className={`${prefixCls}-picker-icon`} />
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import React from 'react';
|
||||
import { mount } from 'enzyme';
|
||||
import DatePicker from '..';
|
||||
import focusTest from '../../../tests/shared/focusTest';
|
||||
|
||||
@@ -5,4 +7,11 @@ const { WeekPicker } = DatePicker;
|
||||
|
||||
describe('WeekPicker', () => {
|
||||
focusTest(WeekPicker);
|
||||
|
||||
it('should support style prop', () => {
|
||||
const wrapper = mount(
|
||||
<WeekPicker style={{ width: 400 }} />
|
||||
);
|
||||
expect(wrapper.render()).toMatchSnapshot();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`WeekPicker should support style prop 1`] = `
|
||||
<span
|
||||
class="ant-calendar-picker"
|
||||
>
|
||||
<span>
|
||||
<input
|
||||
class="ant-calendar-picker-input ant-input"
|
||||
placeholder="Select date"
|
||||
readonly=""
|
||||
style="width: 400px;"
|
||||
value=""
|
||||
/>
|
||||
<span
|
||||
class="ant-calendar-picker-icon"
|
||||
/>
|
||||
</span>
|
||||
</span>
|
||||
`;
|
||||
@@ -443,7 +443,7 @@ exports[`MonthPicker and WeekPicker render WeekPicker 1`] = `
|
||||
title="1999年12月27日"
|
||||
>
|
||||
<div
|
||||
class="ant-calendar-calendar-date"
|
||||
class="ant-calendar-date"
|
||||
>
|
||||
27
|
||||
</div>
|
||||
@@ -454,7 +454,7 @@ exports[`MonthPicker and WeekPicker render WeekPicker 1`] = `
|
||||
title="1999年12月28日"
|
||||
>
|
||||
<div
|
||||
class="ant-calendar-calendar-date"
|
||||
class="ant-calendar-date"
|
||||
>
|
||||
28
|
||||
</div>
|
||||
@@ -465,7 +465,7 @@ exports[`MonthPicker and WeekPicker render WeekPicker 1`] = `
|
||||
title="1999年12月29日"
|
||||
>
|
||||
<div
|
||||
class="ant-calendar-calendar-date"
|
||||
class="ant-calendar-date"
|
||||
>
|
||||
29
|
||||
</div>
|
||||
@@ -476,7 +476,7 @@ exports[`MonthPicker and WeekPicker render WeekPicker 1`] = `
|
||||
title="1999年12月30日"
|
||||
>
|
||||
<div
|
||||
class="ant-calendar-calendar-date"
|
||||
class="ant-calendar-date"
|
||||
>
|
||||
30
|
||||
</div>
|
||||
@@ -487,7 +487,7 @@ exports[`MonthPicker and WeekPicker render WeekPicker 1`] = `
|
||||
title="1999年12月31日"
|
||||
>
|
||||
<div
|
||||
class="ant-calendar-calendar-date"
|
||||
class="ant-calendar-date"
|
||||
>
|
||||
31
|
||||
</div>
|
||||
@@ -539,7 +539,7 @@ exports[`MonthPicker and WeekPicker render WeekPicker 1`] = `
|
||||
title="2000年1月3日"
|
||||
>
|
||||
<div
|
||||
class="ant-calendar-calendar-date"
|
||||
class="ant-calendar-date"
|
||||
>
|
||||
3
|
||||
</div>
|
||||
@@ -550,7 +550,7 @@ exports[`MonthPicker and WeekPicker render WeekPicker 1`] = `
|
||||
title="2000年1月4日"
|
||||
>
|
||||
<div
|
||||
class="ant-calendar-calendar-date"
|
||||
class="ant-calendar-date"
|
||||
>
|
||||
4
|
||||
</div>
|
||||
@@ -561,7 +561,7 @@ exports[`MonthPicker and WeekPicker render WeekPicker 1`] = `
|
||||
title="2000年1月5日"
|
||||
>
|
||||
<div
|
||||
class="ant-calendar-calendar-date"
|
||||
class="ant-calendar-date"
|
||||
>
|
||||
5
|
||||
</div>
|
||||
@@ -572,7 +572,7 @@ exports[`MonthPicker and WeekPicker render WeekPicker 1`] = `
|
||||
title="2000年1月6日"
|
||||
>
|
||||
<div
|
||||
class="ant-calendar-calendar-date"
|
||||
class="ant-calendar-date"
|
||||
>
|
||||
6
|
||||
</div>
|
||||
@@ -583,7 +583,7 @@ exports[`MonthPicker and WeekPicker render WeekPicker 1`] = `
|
||||
title="2000年1月7日"
|
||||
>
|
||||
<div
|
||||
class="ant-calendar-calendar-date"
|
||||
class="ant-calendar-date"
|
||||
>
|
||||
7
|
||||
</div>
|
||||
@@ -594,7 +594,7 @@ exports[`MonthPicker and WeekPicker render WeekPicker 1`] = `
|
||||
title="2000年1月8日"
|
||||
>
|
||||
<div
|
||||
class="ant-calendar-calendar-date"
|
||||
class="ant-calendar-date"
|
||||
>
|
||||
8
|
||||
</div>
|
||||
@@ -605,7 +605,7 @@ exports[`MonthPicker and WeekPicker render WeekPicker 1`] = `
|
||||
title="2000年1月9日"
|
||||
>
|
||||
<div
|
||||
class="ant-calendar-calendar-date"
|
||||
class="ant-calendar-date"
|
||||
>
|
||||
9
|
||||
</div>
|
||||
@@ -627,7 +627,7 @@ exports[`MonthPicker and WeekPicker render WeekPicker 1`] = `
|
||||
title="2000年1月10日"
|
||||
>
|
||||
<div
|
||||
class="ant-calendar-calendar-date"
|
||||
class="ant-calendar-date"
|
||||
>
|
||||
10
|
||||
</div>
|
||||
@@ -638,7 +638,7 @@ exports[`MonthPicker and WeekPicker render WeekPicker 1`] = `
|
||||
title="2000年1月11日"
|
||||
>
|
||||
<div
|
||||
class="ant-calendar-calendar-date"
|
||||
class="ant-calendar-date"
|
||||
>
|
||||
11
|
||||
</div>
|
||||
@@ -649,7 +649,7 @@ exports[`MonthPicker and WeekPicker render WeekPicker 1`] = `
|
||||
title="2000年1月12日"
|
||||
>
|
||||
<div
|
||||
class="ant-calendar-calendar-date"
|
||||
class="ant-calendar-date"
|
||||
>
|
||||
12
|
||||
</div>
|
||||
@@ -660,7 +660,7 @@ exports[`MonthPicker and WeekPicker render WeekPicker 1`] = `
|
||||
title="2000年1月13日"
|
||||
>
|
||||
<div
|
||||
class="ant-calendar-calendar-date"
|
||||
class="ant-calendar-date"
|
||||
>
|
||||
13
|
||||
</div>
|
||||
@@ -671,7 +671,7 @@ exports[`MonthPicker and WeekPicker render WeekPicker 1`] = `
|
||||
title="2000年1月14日"
|
||||
>
|
||||
<div
|
||||
class="ant-calendar-calendar-date"
|
||||
class="ant-calendar-date"
|
||||
>
|
||||
14
|
||||
</div>
|
||||
@@ -682,7 +682,7 @@ exports[`MonthPicker and WeekPicker render WeekPicker 1`] = `
|
||||
title="2000年1月15日"
|
||||
>
|
||||
<div
|
||||
class="ant-calendar-calendar-date"
|
||||
class="ant-calendar-date"
|
||||
>
|
||||
15
|
||||
</div>
|
||||
@@ -693,7 +693,7 @@ exports[`MonthPicker and WeekPicker render WeekPicker 1`] = `
|
||||
title="2000年1月16日"
|
||||
>
|
||||
<div
|
||||
class="ant-calendar-calendar-date"
|
||||
class="ant-calendar-date"
|
||||
>
|
||||
16
|
||||
</div>
|
||||
@@ -715,7 +715,7 @@ exports[`MonthPicker and WeekPicker render WeekPicker 1`] = `
|
||||
title="2000年1月17日"
|
||||
>
|
||||
<div
|
||||
class="ant-calendar-calendar-date"
|
||||
class="ant-calendar-date"
|
||||
>
|
||||
17
|
||||
</div>
|
||||
@@ -726,7 +726,7 @@ exports[`MonthPicker and WeekPicker render WeekPicker 1`] = `
|
||||
title="2000年1月18日"
|
||||
>
|
||||
<div
|
||||
class="ant-calendar-calendar-date"
|
||||
class="ant-calendar-date"
|
||||
>
|
||||
18
|
||||
</div>
|
||||
@@ -737,7 +737,7 @@ exports[`MonthPicker and WeekPicker render WeekPicker 1`] = `
|
||||
title="2000年1月19日"
|
||||
>
|
||||
<div
|
||||
class="ant-calendar-calendar-date"
|
||||
class="ant-calendar-date"
|
||||
>
|
||||
19
|
||||
</div>
|
||||
@@ -748,7 +748,7 @@ exports[`MonthPicker and WeekPicker render WeekPicker 1`] = `
|
||||
title="2000年1月20日"
|
||||
>
|
||||
<div
|
||||
class="ant-calendar-calendar-date"
|
||||
class="ant-calendar-date"
|
||||
>
|
||||
20
|
||||
</div>
|
||||
@@ -759,7 +759,7 @@ exports[`MonthPicker and WeekPicker render WeekPicker 1`] = `
|
||||
title="2000年1月21日"
|
||||
>
|
||||
<div
|
||||
class="ant-calendar-calendar-date"
|
||||
class="ant-calendar-date"
|
||||
>
|
||||
21
|
||||
</div>
|
||||
@@ -770,7 +770,7 @@ exports[`MonthPicker and WeekPicker render WeekPicker 1`] = `
|
||||
title="2000年1月22日"
|
||||
>
|
||||
<div
|
||||
class="ant-calendar-calendar-date"
|
||||
class="ant-calendar-date"
|
||||
>
|
||||
22
|
||||
</div>
|
||||
@@ -781,7 +781,7 @@ exports[`MonthPicker and WeekPicker render WeekPicker 1`] = `
|
||||
title="2000年1月23日"
|
||||
>
|
||||
<div
|
||||
class="ant-calendar-calendar-date"
|
||||
class="ant-calendar-date"
|
||||
>
|
||||
23
|
||||
</div>
|
||||
@@ -803,7 +803,7 @@ exports[`MonthPicker and WeekPicker render WeekPicker 1`] = `
|
||||
title="2000年1月24日"
|
||||
>
|
||||
<div
|
||||
class="ant-calendar-calendar-date"
|
||||
class="ant-calendar-date"
|
||||
>
|
||||
24
|
||||
</div>
|
||||
@@ -814,7 +814,7 @@ exports[`MonthPicker and WeekPicker render WeekPicker 1`] = `
|
||||
title="2000年1月25日"
|
||||
>
|
||||
<div
|
||||
class="ant-calendar-calendar-date"
|
||||
class="ant-calendar-date"
|
||||
>
|
||||
25
|
||||
</div>
|
||||
@@ -825,7 +825,7 @@ exports[`MonthPicker and WeekPicker render WeekPicker 1`] = `
|
||||
title="2000年1月26日"
|
||||
>
|
||||
<div
|
||||
class="ant-calendar-calendar-date"
|
||||
class="ant-calendar-date"
|
||||
>
|
||||
26
|
||||
</div>
|
||||
@@ -836,7 +836,7 @@ exports[`MonthPicker and WeekPicker render WeekPicker 1`] = `
|
||||
title="2000年1月27日"
|
||||
>
|
||||
<div
|
||||
class="ant-calendar-calendar-date"
|
||||
class="ant-calendar-date"
|
||||
>
|
||||
27
|
||||
</div>
|
||||
@@ -847,7 +847,7 @@ exports[`MonthPicker and WeekPicker render WeekPicker 1`] = `
|
||||
title="2000年1月28日"
|
||||
>
|
||||
<div
|
||||
class="ant-calendar-calendar-date"
|
||||
class="ant-calendar-date"
|
||||
>
|
||||
28
|
||||
</div>
|
||||
@@ -858,7 +858,7 @@ exports[`MonthPicker and WeekPicker render WeekPicker 1`] = `
|
||||
title="2000年1月29日"
|
||||
>
|
||||
<div
|
||||
class="ant-calendar-calendar-date"
|
||||
class="ant-calendar-date"
|
||||
>
|
||||
29
|
||||
</div>
|
||||
@@ -869,7 +869,7 @@ exports[`MonthPicker and WeekPicker render WeekPicker 1`] = `
|
||||
title="2000年1月30日"
|
||||
>
|
||||
<div
|
||||
class="ant-calendar-calendar-date"
|
||||
class="ant-calendar-date"
|
||||
>
|
||||
30
|
||||
</div>
|
||||
@@ -891,7 +891,7 @@ exports[`MonthPicker and WeekPicker render WeekPicker 1`] = `
|
||||
title="2000年1月31日"
|
||||
>
|
||||
<div
|
||||
class="ant-calendar-calendar-date"
|
||||
class="ant-calendar-date"
|
||||
>
|
||||
31
|
||||
</div>
|
||||
@@ -902,7 +902,7 @@ exports[`MonthPicker and WeekPicker render WeekPicker 1`] = `
|
||||
title="2000年2月1日"
|
||||
>
|
||||
<div
|
||||
class="ant-calendar-calendar-date"
|
||||
class="ant-calendar-date"
|
||||
>
|
||||
1
|
||||
</div>
|
||||
@@ -913,7 +913,7 @@ exports[`MonthPicker and WeekPicker render WeekPicker 1`] = `
|
||||
title="2000年2月2日"
|
||||
>
|
||||
<div
|
||||
class="ant-calendar-calendar-date"
|
||||
class="ant-calendar-date"
|
||||
>
|
||||
2
|
||||
</div>
|
||||
@@ -924,7 +924,7 @@ exports[`MonthPicker and WeekPicker render WeekPicker 1`] = `
|
||||
title="2000年2月3日"
|
||||
>
|
||||
<div
|
||||
class="ant-calendar-calendar-date"
|
||||
class="ant-calendar-date"
|
||||
>
|
||||
3
|
||||
</div>
|
||||
@@ -935,7 +935,7 @@ exports[`MonthPicker and WeekPicker render WeekPicker 1`] = `
|
||||
title="2000年2月4日"
|
||||
>
|
||||
<div
|
||||
class="ant-calendar-calendar-date"
|
||||
class="ant-calendar-date"
|
||||
>
|
||||
4
|
||||
</div>
|
||||
@@ -946,7 +946,7 @@ exports[`MonthPicker and WeekPicker render WeekPicker 1`] = `
|
||||
title="2000年2月5日"
|
||||
>
|
||||
<div
|
||||
class="ant-calendar-calendar-date"
|
||||
class="ant-calendar-date"
|
||||
>
|
||||
5
|
||||
</div>
|
||||
@@ -957,7 +957,7 @@ exports[`MonthPicker and WeekPicker render WeekPicker 1`] = `
|
||||
title="2000年2月6日"
|
||||
>
|
||||
<div
|
||||
class="ant-calendar-calendar-date"
|
||||
class="ant-calendar-date"
|
||||
>
|
||||
6
|
||||
</div>
|
||||
|
||||
43
components/date-picker/locale/sl_SI.tsx
Normal file
43
components/date-picker/locale/sl_SI.tsx
Normal file
@@ -0,0 +1,43 @@
|
||||
import TimePickerLocale from '../../time-picker/locale/sl_SI';
|
||||
|
||||
// Merge into a locale object
|
||||
const locale = {
|
||||
lang: {
|
||||
placeholder: 'Izberite datum',
|
||||
rangePlaceholder: ['Začetni datum', 'Končni datum'],
|
||||
today: 'Danes',
|
||||
now: 'Trenutno',
|
||||
backToToday: 'Nazaj na trenutni datum',
|
||||
ok: 'Ok',
|
||||
clear: 'Počisti',
|
||||
month: 'Mesec',
|
||||
year: 'Leto',
|
||||
timeSelect: 'Izberi čas',
|
||||
dateSelect: 'Izberi datum',
|
||||
monthSelect: 'Izberite mesec',
|
||||
yearSelect: 'Izberite leto',
|
||||
decadeSelect: 'Izberite desetletje',
|
||||
yearFormat: 'YYYY',
|
||||
dateFormat: 'D.M.YYYY',
|
||||
dayFormat: 'D',
|
||||
dateTimeFormat: 'D.M.YYYY HH:mm:ss',
|
||||
monthFormat: 'MMMM',
|
||||
monthBeforeYear: true,
|
||||
previousMonth: 'Prejšnji mesec (PageUp)',
|
||||
nextMonth: 'Naslednji mesec (PageDown)',
|
||||
previousYear: 'Lansko leto (Control + left)',
|
||||
nextYear: 'Naslednje leto (Control + right)',
|
||||
previousDecade: 'Prejšnje desetletje',
|
||||
nextDecade: 'Naslednje desetletje',
|
||||
previousCentury: 'Zadnje stoletje',
|
||||
nextCentury: 'Naslednje stoletje',
|
||||
},
|
||||
timePickerLocale: {
|
||||
...TimePickerLocale,
|
||||
},
|
||||
};
|
||||
|
||||
// All settings at:
|
||||
// https://github.com/ant-design/ant-design/blob/master/components/date-picker/locale/example.json
|
||||
|
||||
export default locale;
|
||||
@@ -29,13 +29,18 @@ exports[`renders ./components/divider/demo/horizontal.md correctly 1`] = `
|
||||
<p>
|
||||
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed nonne merninisti licere mihi ista probare, quae sunt a te dicta? Refert tamen, quo modo.
|
||||
</p>
|
||||
</div>
|
||||
`;
|
||||
|
||||
exports[`renders ./components/divider/demo/orientation.md correctly 1`] = `
|
||||
<div>
|
||||
<div
|
||||
class="ant-divider ant-divider-horizontal ant-divider-with-text-left"
|
||||
>
|
||||
<span
|
||||
class="ant-divider-inner-text"
|
||||
>
|
||||
With Text
|
||||
Left Text
|
||||
</span>
|
||||
</div>
|
||||
<p>
|
||||
@@ -47,7 +52,7 @@ exports[`renders ./components/divider/demo/horizontal.md correctly 1`] = `
|
||||
<span
|
||||
class="ant-divider-inner-text"
|
||||
>
|
||||
With Text
|
||||
Right Text
|
||||
</span>
|
||||
</div>
|
||||
<p>
|
||||
|
||||
@@ -25,10 +25,6 @@ ReactDOM.render(
|
||||
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed nonne merninisti licere mihi ista probare, quae sunt a te dicta? Refert tamen, quo modo.</p>
|
||||
<Divider dashed />
|
||||
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed nonne merninisti licere mihi ista probare, quae sunt a te dicta? Refert tamen, quo modo.</p>
|
||||
<Divider orientation="left">With Text</Divider>
|
||||
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed nonne merninisti licere mihi ista probare, quae sunt a te dicta? Refert tamen, quo modo.</p>
|
||||
<Divider orientation="right">With Text</Divider>
|
||||
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed nonne merninisti licere mihi ista probare, quae sunt a te dicta? Refert tamen, quo modo.</p>
|
||||
</div>
|
||||
, mountNode);
|
||||
````
|
||||
|
||||
27
components/divider/demo/orientation.md
Normal file
27
components/divider/demo/orientation.md
Normal file
@@ -0,0 +1,27 @@
|
||||
---
|
||||
order: 2
|
||||
title:
|
||||
zh-CN: 标题位置
|
||||
en-US: Orientation of title
|
||||
---
|
||||
|
||||
## zh-CN
|
||||
|
||||
修改分割线标题的位置。
|
||||
|
||||
## en-US
|
||||
|
||||
Set orientation of divider to left or right.
|
||||
|
||||
````jsx
|
||||
import { Divider } from 'antd';
|
||||
|
||||
ReactDOM.render(
|
||||
<div>
|
||||
<Divider orientation="left">Left Text</Divider>
|
||||
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed nonne merninisti licere mihi ista probare, quae sunt a te dicta? Refert tamen, quo modo.</p>
|
||||
<Divider orientation="right">Right Text</Divider>
|
||||
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed nonne merninisti licere mihi ista probare, quae sunt a te dicta? Refert tamen, quo modo.</p>
|
||||
</div>
|
||||
, mountNode);
|
||||
````
|
||||
@@ -20,4 +20,4 @@ A divider line separates different content.
|
||||
| -------- | ----------- | ---- | ------- |
|
||||
| dashed | whether line is dashed | Boolean | false |
|
||||
| type | direction type of divider | enum: `horizontal` `vertical` | `horizontal` |
|
||||
| orientation | this is optional, if not set it will have the text in the center | enum: `left` `right` | `center` |
|
||||
| orientation | position of title inside divider | enum: `left` `right` `center` | `center` |
|
||||
|
||||
@@ -18,3 +18,4 @@ subtitle: 分割线
|
||||
| --- | --- | --- | --- |
|
||||
| dashed | 是否虚线 | Boolean | false |
|
||||
| type | 水平还是垂直类型 | enum: `horizontal` `vertical` | `horizontal` |
|
||||
| orientation | 分割线标题的位置 | enum: `left` `right` | `center` |
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
height: 1px;
|
||||
width: 100%;
|
||||
margin: 24px 0;
|
||||
clear: both;
|
||||
}
|
||||
&-horizontal&-with-text {
|
||||
display: table;
|
||||
|
||||
@@ -3,11 +3,11 @@ import PropTypes from 'prop-types';
|
||||
import classNames from 'classnames';
|
||||
import createDOMForm from 'rc-form/lib/createDOMForm';
|
||||
import createFormField from 'rc-form/lib/createFormField';
|
||||
import PureRenderMixin from 'rc-util/lib/PureRenderMixin';
|
||||
import omit from 'omit.js';
|
||||
import warning from '../_util/warning';
|
||||
import FormItem from './FormItem';
|
||||
import { FIELD_META_PROP, FIELD_DATA_PROP } from './constants';
|
||||
import { Omit } from '../_util/type';
|
||||
|
||||
export interface FormCreateOption<T> {
|
||||
onFieldsChange?: (props: T, fields: Array<any>) => void;
|
||||
@@ -16,8 +16,10 @@ export interface FormCreateOption<T> {
|
||||
withRef?: boolean;
|
||||
}
|
||||
|
||||
export type FormLayout = 'horizontal' | 'inline' | 'vertical';
|
||||
|
||||
export interface FormProps {
|
||||
layout?: 'horizontal' | 'inline' | 'vertical';
|
||||
layout?: FormLayout;
|
||||
form?: WrappedFormUtils;
|
||||
onSubmit?: React.FormEventHandler<any>;
|
||||
style?: React.CSSProperties;
|
||||
@@ -113,10 +115,6 @@ export interface FormComponentProps {
|
||||
form: WrappedFormUtils;
|
||||
}
|
||||
|
||||
export type Diff<T extends string, U extends string> =
|
||||
({ [P in T]: P } & { [P in U]: never } & { [x: string]: never })[T];
|
||||
export type Omit<T, K extends keyof T> = Pick<T, Diff<keyof T, K>>;
|
||||
|
||||
export interface ComponentDecorator {
|
||||
<P extends FormComponentProps>(
|
||||
component: React.ComponentClass<P> | React.SFC<P>,
|
||||
@@ -126,7 +124,7 @@ export interface ComponentDecorator {
|
||||
export default class Form extends React.Component<FormProps, any> {
|
||||
static defaultProps = {
|
||||
prefixCls: 'ant-form',
|
||||
layout: 'horizontal',
|
||||
layout: 'horizontal' as FormLayout,
|
||||
hideRequiredMark: false,
|
||||
onSubmit(e: React.FormEvent<HTMLFormElement>) {
|
||||
e.preventDefault();
|
||||
@@ -164,10 +162,6 @@ export default class Form extends React.Component<FormProps, any> {
|
||||
warning(!props.form, 'It is unnecessary to pass `form` to `Form` after antd@1.7.0.');
|
||||
}
|
||||
|
||||
shouldComponentUpdate(...args: any[]) {
|
||||
return PureRenderMixin.shouldComponentUpdate.apply(this, args);
|
||||
}
|
||||
|
||||
getChildContext() {
|
||||
const { layout } = this.props;
|
||||
return {
|
||||
|
||||
@@ -3,7 +3,6 @@ import * as ReactDOM from 'react-dom';
|
||||
import PropTypes from 'prop-types';
|
||||
import classNames from 'classnames';
|
||||
import Animate from 'rc-animate';
|
||||
import PureRenderMixin from 'rc-util/lib/PureRenderMixin';
|
||||
import Row from '../grid/row';
|
||||
import Col, { ColProps } from '../grid/col';
|
||||
import warning from '../_util/warning';
|
||||
@@ -66,10 +65,6 @@ export default class FormItem extends React.Component<FormItemProps, any> {
|
||||
);
|
||||
}
|
||||
|
||||
shouldComponentUpdate(...args: any[]) {
|
||||
return PureRenderMixin.shouldComponentUpdate.apply(this, args);
|
||||
}
|
||||
|
||||
getHelpMsg() {
|
||||
const props = this.props;
|
||||
const onlyControl = this.getOnlyControl();
|
||||
@@ -248,7 +243,8 @@ export default class FormItem extends React.Component<FormItemProps, any> {
|
||||
if (typeof label === 'string') {
|
||||
e.preventDefault();
|
||||
}
|
||||
const control = ReactDOM.findDOMNode(this).querySelector(`[id="${id}"]`) as HTMLElement;
|
||||
const formItemNode = ReactDOM.findDOMNode(this) as Element;
|
||||
const control = formItemNode.querySelector(`[id="${id}"]`) as HTMLElement;
|
||||
if (control && control.focus) {
|
||||
control.focus();
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ exports[`renders ./components/form/demo/advanced-search.md correctly 1`] = `
|
||||
class="ant-form-item-label"
|
||||
>
|
||||
<label
|
||||
class=""
|
||||
class="ant-form-item-required"
|
||||
for="field-0"
|
||||
title="Field 0"
|
||||
>
|
||||
@@ -61,7 +61,7 @@ exports[`renders ./components/form/demo/advanced-search.md correctly 1`] = `
|
||||
class="ant-form-item-label"
|
||||
>
|
||||
<label
|
||||
class=""
|
||||
class="ant-form-item-required"
|
||||
for="field-1"
|
||||
title="Field 1"
|
||||
>
|
||||
@@ -102,7 +102,7 @@ exports[`renders ./components/form/demo/advanced-search.md correctly 1`] = `
|
||||
class="ant-form-item-label"
|
||||
>
|
||||
<label
|
||||
class=""
|
||||
class="ant-form-item-required"
|
||||
for="field-2"
|
||||
title="Field 2"
|
||||
>
|
||||
@@ -143,7 +143,7 @@ exports[`renders ./components/form/demo/advanced-search.md correctly 1`] = `
|
||||
class="ant-form-item-label"
|
||||
>
|
||||
<label
|
||||
class=""
|
||||
class="ant-form-item-required"
|
||||
for="field-3"
|
||||
title="Field 3"
|
||||
>
|
||||
@@ -184,7 +184,7 @@ exports[`renders ./components/form/demo/advanced-search.md correctly 1`] = `
|
||||
class="ant-form-item-label"
|
||||
>
|
||||
<label
|
||||
class=""
|
||||
class="ant-form-item-required"
|
||||
for="field-4"
|
||||
title="Field 4"
|
||||
>
|
||||
@@ -225,7 +225,7 @@ exports[`renders ./components/form/demo/advanced-search.md correctly 1`] = `
|
||||
class="ant-form-item-label"
|
||||
>
|
||||
<label
|
||||
class=""
|
||||
class="ant-form-item-required"
|
||||
for="field-5"
|
||||
title="Field 5"
|
||||
>
|
||||
@@ -266,7 +266,7 @@ exports[`renders ./components/form/demo/advanced-search.md correctly 1`] = `
|
||||
class="ant-form-item-label"
|
||||
>
|
||||
<label
|
||||
class=""
|
||||
class="ant-form-item-required"
|
||||
for="field-6"
|
||||
title="Field 6"
|
||||
>
|
||||
@@ -307,7 +307,7 @@ exports[`renders ./components/form/demo/advanced-search.md correctly 1`] = `
|
||||
class="ant-form-item-label"
|
||||
>
|
||||
<label
|
||||
class=""
|
||||
class="ant-form-item-required"
|
||||
for="field-7"
|
||||
title="Field 7"
|
||||
>
|
||||
@@ -348,7 +348,7 @@ exports[`renders ./components/form/demo/advanced-search.md correctly 1`] = `
|
||||
class="ant-form-item-label"
|
||||
>
|
||||
<label
|
||||
class=""
|
||||
class="ant-form-item-required"
|
||||
for="field-8"
|
||||
title="Field 8"
|
||||
>
|
||||
@@ -389,7 +389,7 @@ exports[`renders ./components/form/demo/advanced-search.md correctly 1`] = `
|
||||
class="ant-form-item-label"
|
||||
>
|
||||
<label
|
||||
class=""
|
||||
class="ant-form-item-required"
|
||||
for="field-9"
|
||||
title="Field 9"
|
||||
>
|
||||
|
||||
@@ -52,7 +52,12 @@ class AdvancedSearchForm extends React.Component {
|
||||
children.push(
|
||||
<Col span={8} key={i} style={{ display: i < count ? 'block' : 'none' }}>
|
||||
<FormItem label={`Field ${i}`}>
|
||||
{getFieldDecorator(`field-${i}`)(
|
||||
{getFieldDecorator(`field-${i}`, {
|
||||
rules: [{
|
||||
required: true,
|
||||
message: 'Input something!',
|
||||
}],
|
||||
})(
|
||||
<Input placeholder="placeholder" />
|
||||
)}
|
||||
</FormItem>
|
||||
|
||||
@@ -28,7 +28,7 @@ class PriceInput extends React.Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
|
||||
const value = this.props.value || {};
|
||||
const value = props.value || {};
|
||||
this.state = {
|
||||
number: value.number || 0,
|
||||
currency: value.currency || 'rmb',
|
||||
|
||||
@@ -11,7 +11,7 @@ title:
|
||||
|
||||
## en-US
|
||||
|
||||
When user visit a page with a list of items, and want to create a new item. The page can popup a form in Modal, then let user fills in the form to create an item.
|
||||
When user visit a page with a list of items, and want to create a new item. The page can popup a form in Modal, then let user fill in the form to create an item.
|
||||
|
||||
````jsx
|
||||
import { Button, Modal, Form, Input, Radio } from 'antd';
|
||||
|
||||
@@ -58,9 +58,9 @@ class Demo extends React.Component {
|
||||
},
|
||||
};
|
||||
handleFormChange = (changedFields) => {
|
||||
this.setState({
|
||||
fields: { ...this.state.fields, ...changedFields },
|
||||
});
|
||||
this.setState(({ fields }) => ({
|
||||
fields: { ...fields, ...changedFields },
|
||||
}));
|
||||
}
|
||||
render() {
|
||||
const fields = this.state.fields;
|
||||
|
||||
@@ -554,7 +554,11 @@ form {
|
||||
|
||||
.@{ant-prefix}-advanced-search-form {
|
||||
.@{form-prefix-cls}-item {
|
||||
margin-bottom: 24px;
|
||||
margin-bottom: @form-item-margin-bottom;
|
||||
|
||||
&-with-help {
|
||||
margin-bottom: @form-item-margin-bottom - @font-size-base * @line-height-base - @form-help-margin-top;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -7,11 +7,11 @@ title:
|
||||
|
||||
## zh-CN
|
||||
|
||||
参照 Bootstrap 的 [响应式设计](http://getbootstrap.com/css/#grid-media-queries),预设五个响应尺寸:`xs` `sm` `md` `lg` `xl` `xxl`。
|
||||
参照 Bootstrap 的 [响应式设计](http://getbootstrap.com/css/#grid-media-queries),预设六个响应尺寸:`xs` `sm` `md` `lg` `xl` `xxl`。
|
||||
|
||||
## en-US
|
||||
|
||||
Referring to the Bootstrap [responsive design] (http://getbootstrap.com/css/#grid-media-queries), here preset five dimensions: `xs` `sm` `md` `lg` `xl`.
|
||||
Referring to the Bootstrap [responsive design] (http://getbootstrap.com/css/#grid-media-queries), here preset six dimensions: `xs` `sm` `md` `lg` `xl`.
|
||||
|
||||
````jsx
|
||||
import { Row, Col } from 'antd';
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
// this file is not used if use https://github.com/ant-design/babel-plugin-import
|
||||
const ENV = process.env.NODE_ENV;
|
||||
if (ENV !== 'production' &&
|
||||
ENV !== 'test' &&
|
||||
typeof console !== 'undefined' &&
|
||||
console.warn &&
|
||||
typeof window !== 'undefined') {
|
||||
|
||||
@@ -44,13 +44,13 @@ export interface SiderProps extends React.HTMLAttributes<HTMLDivElement> {
|
||||
breakpoint?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'xxl';
|
||||
}
|
||||
|
||||
export interface SliderState {
|
||||
export interface SiderState {
|
||||
collapsed?: boolean;
|
||||
below: boolean;
|
||||
belowShow?: boolean;
|
||||
}
|
||||
|
||||
export interface SliderContext {
|
||||
export interface SiderContext {
|
||||
siderCollapsed: boolean;
|
||||
}
|
||||
|
||||
@@ -62,7 +62,7 @@ const generateId = (() => {
|
||||
};
|
||||
})();
|
||||
|
||||
export default class Sider extends React.Component<SiderProps, SliderState> {
|
||||
export default class Sider extends React.Component<SiderProps, SiderState> {
|
||||
static __ANT_LAYOUT_SIDER: any = true;
|
||||
|
||||
static defaultProps = {
|
||||
@@ -201,12 +201,15 @@ export default class Sider extends React.Component<SiderProps, SliderState> {
|
||||
</div>
|
||||
) : null
|
||||
);
|
||||
// For collapsedWidth="40px"
|
||||
// https://github.com/ant-design/ant-design/issues/10140
|
||||
const siderWidthNumber = (siderWidth || 0).toString().replace(/px$/, '');
|
||||
const divStyle = {
|
||||
...style,
|
||||
flex: `0 0 ${siderWidth}px`,
|
||||
maxWidth: `${siderWidth}px`, // Fix width transition bug in IE11
|
||||
minWidth: `${siderWidth}px`, // https://github.com/ant-design/ant-design/issues/6349
|
||||
width: `${siderWidth}px`,
|
||||
flex: `0 0 ${siderWidthNumber}px`,
|
||||
maxWidth: `${siderWidthNumber}px`, // Fix width transition bug in IE11
|
||||
minWidth: `${siderWidthNumber}px`, // https://github.com/ant-design/ant-design/issues/6349
|
||||
width: `${siderWidthNumber}px`,
|
||||
};
|
||||
const siderCls = classNames(className, prefixCls, {
|
||||
[`${prefixCls}-collapsed`]: !!this.state.collapsed,
|
||||
|
||||
@@ -97,7 +97,7 @@
|
||||
height: @layout-zero-trigger-height;
|
||||
line-height: @layout-zero-trigger-height;
|
||||
background: @layout-sider-background;
|
||||
color: #fff;
|
||||
color: @layout-trigger-color;
|
||||
font-size: @layout-zero-trigger-width / 2;
|
||||
border-radius: 0 @border-radius-base @border-radius-base 0;
|
||||
cursor: pointer;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -4,18 +4,16 @@ exports[`List renders empty list 1`] = `
|
||||
<div
|
||||
class="ant-list ant-list-split"
|
||||
>
|
||||
<div>
|
||||
<div
|
||||
class="ant-spin-nested-loading"
|
||||
>
|
||||
<div
|
||||
class="ant-spin-nested-loading"
|
||||
class="ant-spin-container"
|
||||
>
|
||||
<div
|
||||
class="ant-spin-container"
|
||||
class="ant-list-empty-text"
|
||||
>
|
||||
<div
|
||||
class="ant-list-empty-text"
|
||||
>
|
||||
No data
|
||||
</div>
|
||||
No data
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
18
components/list/__tests__/index.test.js
Normal file
18
components/list/__tests__/index.test.js
Normal file
@@ -0,0 +1,18 @@
|
||||
import React from 'react';
|
||||
import { mount } from 'enzyme';
|
||||
import List from '..';
|
||||
|
||||
const ListItem = List.Item;
|
||||
|
||||
describe('List', () => {
|
||||
it('locale not passed to internal div', async () => {
|
||||
const locale = { emptyText: 'Custom text' };
|
||||
const renderItem = item => <ListItem>{item}</ListItem>;
|
||||
const dataSource = [];
|
||||
|
||||
const wrapper = mount(
|
||||
<List renderItem={renderItem} dataSource={dataSource} locale={locale} />
|
||||
);
|
||||
expect(wrapper.find('div').first().props().locale).toBe(undefined);
|
||||
});
|
||||
});
|
||||
@@ -1,7 +1,7 @@
|
||||
---
|
||||
order: 1
|
||||
title:
|
||||
zh-CN: 基础列表
|
||||
zh-CN: 基础列表
|
||||
en-US: Basic list
|
||||
---
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
---
|
||||
order: 4
|
||||
title:
|
||||
zh-CN: 栅格列表
|
||||
zh-CN: 栅格列表
|
||||
en-US: Grid
|
||||
---
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ class InfiniteListExample extends React.Component {
|
||||
},
|
||||
});
|
||||
}
|
||||
componentWillMount() {
|
||||
componentDidMount() {
|
||||
this.getData((res) => {
|
||||
this.setState({
|
||||
data: res.results,
|
||||
@@ -89,7 +89,11 @@ class InfiniteListExample extends React.Component {
|
||||
</List.Item>
|
||||
)}
|
||||
>
|
||||
{this.state.loading && this.state.hasMore && <Spin className="demo-loading" />}
|
||||
{this.state.loading && this.state.hasMore && (
|
||||
<div className="demo-loading-container">
|
||||
<Spin />
|
||||
</div>
|
||||
)}
|
||||
</List>
|
||||
</InfiniteScroll>
|
||||
</div>
|
||||
@@ -108,9 +112,10 @@ ReactDOM.render(<InfiniteListExample />, mountNode);
|
||||
padding: 8px 24px;
|
||||
height: 300px;
|
||||
}
|
||||
.demo-loading {
|
||||
.demo-loading-container {
|
||||
position: absolute;
|
||||
bottom: -40px;
|
||||
left: 50%;
|
||||
bottom: 40px;
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
}
|
||||
````
|
||||
|
||||
@@ -46,7 +46,7 @@ class VirtualizedExample extends React.Component {
|
||||
},
|
||||
});
|
||||
}
|
||||
componentWillMount() {
|
||||
componentDidMount() {
|
||||
this.getData((res) => {
|
||||
this.setState({
|
||||
data: res.results,
|
||||
@@ -129,7 +129,7 @@ class VirtualizedExample extends React.Component {
|
||||
<List>
|
||||
{
|
||||
data.length > 0 && (
|
||||
<WindowScroller scrollElement={null}>
|
||||
<WindowScroller>
|
||||
{infiniteLoader}
|
||||
</WindowScroller>
|
||||
)
|
||||
|
||||
@@ -47,6 +47,7 @@ ReactDOM.render(
|
||||
size="large"
|
||||
pagination={pagination}
|
||||
dataSource={listData}
|
||||
footer={<div><b>ant design</b> footer part</div>}
|
||||
renderItem={item => (
|
||||
<List.Item
|
||||
key={item.title}
|
||||
|
||||
@@ -23,6 +23,7 @@ A list can be used to display content related to a single subject. The content c
|
||||
| header | List header renderer | string\|ReactNode | - |
|
||||
| itemLayout | The layout of list, default is `horizontal`, If a vertical list is desired, set the itemLayout property to `vertical` | string | - |
|
||||
| loading | Shows a loading indicator while the contents of the list are being fetched | boolean\|[object](https://ant.design/components/spin-cn/#API) ([more](https://github.com/ant-design/ant-design/issues/8659)) | false |
|
||||
| locale | i18n text including empty text | object | emptyText: 'No Data' <br> |
|
||||
| loadMore | Shows a load more content | string\|ReactNode | - |
|
||||
| pagination | Pagination [config](https://ant.design/components/pagination/), hide it by setting it to false | boolean \| object | false |
|
||||
| split | Toggles rendering of the split under the list item | boolean | true |
|
||||
|
||||
@@ -101,7 +101,7 @@ export default class List extends React.Component<ListProps> {
|
||||
return renderItem(item, index);
|
||||
}
|
||||
|
||||
isSomethingAfterLastTtem() {
|
||||
isSomethingAfterLastItem() {
|
||||
const { loadMore, pagination, footer } = this.props;
|
||||
return !!(loadMore || pagination || footer);
|
||||
}
|
||||
@@ -129,6 +129,7 @@ export default class List extends React.Component<ListProps> {
|
||||
header,
|
||||
footer,
|
||||
loading,
|
||||
locale,
|
||||
...rest,
|
||||
} = this.props;
|
||||
|
||||
@@ -160,17 +161,17 @@ export default class List extends React.Component<ListProps> {
|
||||
[`${prefixCls}-bordered`]: bordered,
|
||||
[`${prefixCls}-loading`]: isLoading,
|
||||
[`${prefixCls}-grid`]: grid,
|
||||
[`${prefixCls}-something-after-last-item`]: this.isSomethingAfterLastTtem(),
|
||||
[`${prefixCls}-something-after-last-item`]: this.isSomethingAfterLastItem(),
|
||||
});
|
||||
|
||||
const paginationContent = (
|
||||
const paginationContent = pagination ? (
|
||||
<div className={`${prefixCls}-pagination`}>
|
||||
<Pagination {...pagination} />
|
||||
</div>
|
||||
);
|
||||
) : null;
|
||||
|
||||
let childrenContent;
|
||||
childrenContent = isLoading && (<div style={{ minHeight: 53 }} />);
|
||||
childrenContent = isLoading && <div style={{ minHeight: 53 }} />;
|
||||
if (dataSource.length > 0) {
|
||||
const items = dataSource.map((item: any, index: number) => this.renderItem(item, index));
|
||||
const childrenList = React.Children.map(items, (child: any, index) => React.cloneElement(child, {
|
||||
@@ -192,20 +193,15 @@ export default class List extends React.Component<ListProps> {
|
||||
);
|
||||
}
|
||||
|
||||
const content = (
|
||||
<div>
|
||||
<Spin {...loadingProp}>{childrenContent}</Spin>
|
||||
{loadMore}
|
||||
{(!loadMore && pagination) ? paginationContent : null}
|
||||
</div>
|
||||
);
|
||||
|
||||
return (
|
||||
<div className={classString} {...rest}>
|
||||
{header && <div className={`${prefixCls}-header`}>{header}</div>}
|
||||
{content}
|
||||
{children}
|
||||
<Spin {...loadingProp}>
|
||||
{childrenContent}
|
||||
{children}
|
||||
</Spin>
|
||||
{footer && <div className={`${prefixCls}-footer`}>{footer}</div>}
|
||||
{loadMore || paginationContent}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -24,6 +24,7 @@ cols: 1
|
||||
| header | 列表头部 | string\|ReactNode | - |
|
||||
| itemLayout | 设置 `List.Item` 布局, 设置成 `vertical` 则竖直样式显示, 默认横排 | string | - |
|
||||
| loading | 当卡片内容还在加载中时,可以用 `loading` 展示一个占位 | boolean\|[object](https://ant.design/components/spin-cn/#API) ([更多](https://github.com/ant-design/ant-design/issues/8659)) | false |
|
||||
| locale | 默认文案设置,目前包括空数据文案 | object | emptyText: '暂无数据' |
|
||||
| loadMore | 加载更多 | string\|ReactNode | - |
|
||||
| pagination | 对应的 `pagination` 配置, 设置 `false` 不显示 | boolean\|object | false |
|
||||
| size | list 的尺寸 | `default` \| `middle` \| `small` | `default` |
|
||||
|
||||
@@ -137,7 +137,7 @@
|
||||
min-height: 32px;
|
||||
}
|
||||
|
||||
&-something-after-last-item &-item:last-child {
|
||||
&-something-after-last-item .@{ant-prefix}-spin-container > &-item:last-child {
|
||||
border-bottom: 1px solid @border-color-split;
|
||||
}
|
||||
|
||||
@@ -196,7 +196,7 @@
|
||||
border-bottom: none;
|
||||
padding-top: 0;
|
||||
padding-bottom: 0;
|
||||
margin-bottom: 20px;
|
||||
margin-bottom: 16px;
|
||||
&-content {
|
||||
display: block;
|
||||
}
|
||||
|
||||
@@ -1553,7 +1553,7 @@ exports[`renders ./components/locale-provider/demo/basic.md correctly 1`] = `
|
||||
<li
|
||||
aria-disabled="true"
|
||||
class="ant-pagination-disabled ant-pagination-prev"
|
||||
title="Previous Page"
|
||||
title="上一页"
|
||||
>
|
||||
<a
|
||||
class="ant-pagination-item-link"
|
||||
@@ -1608,7 +1608,7 @@ exports[`renders ./components/locale-provider/demo/basic.md correctly 1`] = `
|
||||
aria-disabled="false"
|
||||
class=" ant-pagination-next"
|
||||
tabindex="0"
|
||||
title="Next Page"
|
||||
title="下一页"
|
||||
>
|
||||
<a
|
||||
class="ant-pagination-item-link"
|
||||
@@ -1635,9 +1635,9 @@ exports[`renders ./components/locale-provider/demo/basic.md correctly 1`] = `
|
||||
<div
|
||||
class="ant-select-selection-selected-value"
|
||||
style="display:block;opacity:1"
|
||||
title="10 / page"
|
||||
title="10 条/页"
|
||||
>
|
||||
10 / page
|
||||
10 条/页
|
||||
</div>
|
||||
</div>
|
||||
<span
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -35,13 +35,14 @@ import faIR from '../fa_IR';
|
||||
import elGR from '../el_GR';
|
||||
import nbNO from '../nb_NO';
|
||||
import srRS from '../sr_RS';
|
||||
import slSI from '../sl_SI';
|
||||
import isIS from '../is_IS';
|
||||
import arEG from '../ar_EG';
|
||||
import ukUA from '../uk_UA';
|
||||
import zhCN from '../zh_CN';
|
||||
import kuIQ from '../ku_IQ';
|
||||
|
||||
const locales = [enUS, ptBR, ptPT, ruRU, esES, svSE, frBE, deDE, nlNL, caES, csCZ, koKR, etEE, skSK, jaJP, trTR, zhTW, fiFI, plPL, bgBG, enGB, frFR, nlBE, itIT, viVN, thTH, faIR, elGR, nbNO, srRS, isIS, arEG, ukUA, zhCN, kuIQ];
|
||||
const locales = [enUS, ptBR, ptPT, ruRU, esES, svSE, frBE, deDE, nlNL, caES, csCZ, koKR, etEE, skSK, jaJP, trTR, zhTW, fiFI, plPL, bgBG, enGB, frFR, nlBE, itIT, viVN, thTH, faIR, elGR, nbNO, srRS, slSI, isIS, arEG, ukUA, zhCN, kuIQ];
|
||||
|
||||
const { Option } = Select;
|
||||
const { RangePicker } = DatePicker;
|
||||
|
||||
@@ -125,8 +125,8 @@ class App extends React.Component {
|
||||
<div>
|
||||
<div className="change-locale">
|
||||
<span style={{ marginRight: 16 }}>Change locale of components: </span>
|
||||
<Radio.Group defaultValue={null} onChange={this.changeLocale}>
|
||||
<Radio.Button key="en" value={null}>English</Radio.Button>
|
||||
<Radio.Group defaultValue={undefined} onChange={this.changeLocale}>
|
||||
<Radio.Button key="en" value={undefined}>English</Radio.Button>
|
||||
<Radio.Button key="cn" value={zhCN}>中文</Radio.Button>
|
||||
</Radio.Group>
|
||||
</div>
|
||||
|
||||
@@ -15,7 +15,7 @@ Wrap your app with `LocaleProvider`, and apply the corresponding language packag
|
||||
|
||||
````jsx
|
||||
import { Pagination, LocaleProvider } from 'antd';
|
||||
import enUS from 'antd/lib/locale-provider/en_US';
|
||||
import zhCN from 'antd/lib/locale-provider/zh_CN';
|
||||
|
||||
const App = () => (
|
||||
<div>
|
||||
@@ -24,7 +24,7 @@ const App = () => (
|
||||
);
|
||||
|
||||
ReactDOM.render(
|
||||
<LocaleProvider locale={enUS}>
|
||||
<LocaleProvider locale={zhCN}>
|
||||
<App />
|
||||
</LocaleProvider>
|
||||
, mountNode);
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import * as React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import * as moment from 'moment';
|
||||
import interopDefault from '../_util/interopDefault';
|
||||
import { ModalLocale, changeConfirmLocale } from '../modal/locale';
|
||||
|
||||
export interface Locale {
|
||||
@@ -24,9 +25,9 @@ export interface LocaleProviderProps {
|
||||
|
||||
function setMomentLocale(locale: Locale) {
|
||||
if (locale && locale.locale) {
|
||||
moment.locale(locale.locale);
|
||||
interopDefault(moment).locale(locale.locale);
|
||||
} else {
|
||||
moment.locale('en');
|
||||
interopDefault(moment).locale('en');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -43,6 +44,12 @@ export default class LocaleProvider extends React.Component<LocaleProviderProps,
|
||||
antLocale: PropTypes.object,
|
||||
};
|
||||
|
||||
constructor(props: LocaleProviderProps) {
|
||||
super(props);
|
||||
setMomentLocale(props.locale);
|
||||
changeConfirmLocale(props.locale && props.locale.Modal);
|
||||
}
|
||||
|
||||
getChildContext() {
|
||||
return {
|
||||
antLocale: {
|
||||
@@ -52,11 +59,6 @@ export default class LocaleProvider extends React.Component<LocaleProviderProps,
|
||||
};
|
||||
}
|
||||
|
||||
componentWillMount() {
|
||||
setMomentLocale(this.props.locale);
|
||||
this.componentDidUpdate();
|
||||
}
|
||||
|
||||
componentWillReceiveProps(nextProps: LocaleProviderProps) {
|
||||
const { locale } = this.props;
|
||||
const nextLocale = nextProps.locale;
|
||||
|
||||
44
components/locale-provider/sl_SI.tsx
Normal file
44
components/locale-provider/sl_SI.tsx
Normal file
@@ -0,0 +1,44 @@
|
||||
import Pagination from 'rc-pagination/lib/locale/sl_SI';
|
||||
import DatePicker from '../date-picker/locale/sl_SI';
|
||||
import TimePicker from '../time-picker/locale/sl_SI';
|
||||
import Calendar from '../calendar/locale/sl_SI';
|
||||
|
||||
export default {
|
||||
locale: 'sl',
|
||||
Pagination,
|
||||
DatePicker,
|
||||
TimePicker,
|
||||
Calendar,
|
||||
Table: {
|
||||
filterTitle: 'Filter',
|
||||
filterConfirm: 'Filtriraj',
|
||||
filterReset: 'Pobriši filter',
|
||||
emptyText: 'Ni podatkov',
|
||||
selectAll: 'Izberi vse na trenutni strani',
|
||||
selectInvert: 'Obrni izbor na trenutni strani',
|
||||
},
|
||||
Modal: {
|
||||
okText: 'V redu',
|
||||
cancelText: 'Prekliči',
|
||||
justOkText: 'V redu',
|
||||
},
|
||||
Popconfirm: {
|
||||
okText: 'v redu',
|
||||
cancelText: 'Prekliči',
|
||||
},
|
||||
Transfer: {
|
||||
notFoundContent: 'Ni rezultatov iskanja',
|
||||
searchPlaceholder: 'Išči tukaj',
|
||||
itemUnit: 'Objekt',
|
||||
itemsUnit: 'Objektov',
|
||||
},
|
||||
Select: {
|
||||
notFoundContent: 'Ni bilo mogoče najti',
|
||||
},
|
||||
Upload: {
|
||||
uploading: 'Nalaganje...',
|
||||
removeFile: 'Odstrani datoteko',
|
||||
uploadError: 'Napaka pri nalaganju',
|
||||
previewFile: 'Predogled datoteke',
|
||||
},
|
||||
};
|
||||
@@ -7,7 +7,7 @@ import animation from '../_util/openAnimation';
|
||||
import warning from '../_util/warning';
|
||||
import SubMenu from './SubMenu';
|
||||
import Item from './MenuItem';
|
||||
import { SliderContext } from '../layout/Sider';
|
||||
import { SiderContext } from '../layout/Sider';
|
||||
|
||||
export interface SelectParam {
|
||||
key: string;
|
||||
@@ -26,9 +26,11 @@ export interface ClickParam {
|
||||
|
||||
export type MenuMode = 'vertical' | 'vertical-left' | 'vertical-right' | 'horizontal' | 'inline';
|
||||
|
||||
export type MenuTheme = 'light' | 'dark';
|
||||
|
||||
export interface MenuProps {
|
||||
id?: string;
|
||||
theme?: 'light' | 'dark';
|
||||
theme?: MenuTheme;
|
||||
mode?: MenuMode;
|
||||
selectable?: boolean;
|
||||
selectedKeys?: Array<string>;
|
||||
@@ -49,6 +51,7 @@ export interface MenuProps {
|
||||
inlineCollapsed?: boolean;
|
||||
subMenuCloseDelay?: number;
|
||||
subMenuOpenDelay?: number;
|
||||
getPopupContainer?: (triggerNode: Element) => HTMLElement;
|
||||
}
|
||||
|
||||
export interface MenuState {
|
||||
@@ -63,7 +66,7 @@ export default class Menu extends React.Component<MenuProps, MenuState> {
|
||||
static defaultProps = {
|
||||
prefixCls: 'ant-menu',
|
||||
className: '',
|
||||
theme: 'light', // or dark
|
||||
theme: 'light' as MenuTheme, // or dark
|
||||
};
|
||||
static childContextTypes = {
|
||||
inlineCollapsed: PropTypes.bool,
|
||||
@@ -107,7 +110,7 @@ export default class Menu extends React.Component<MenuProps, MenuState> {
|
||||
antdMenuTheme: this.props.theme,
|
||||
};
|
||||
}
|
||||
componentWillReceiveProps(nextProps: MenuProps, nextContext: SliderContext) {
|
||||
componentWillReceiveProps(nextProps: MenuProps, nextContext: SiderContext) {
|
||||
const { prefixCls } = this.props;
|
||||
if (this.props.mode === 'inline' &&
|
||||
nextProps.mode !== 'inline') {
|
||||
@@ -119,8 +122,9 @@ export default class Menu extends React.Component<MenuProps, MenuState> {
|
||||
}
|
||||
if ((nextProps.inlineCollapsed && !this.props.inlineCollapsed) ||
|
||||
(nextContext.siderCollapsed && !this.context.siderCollapsed)) {
|
||||
const menuNode = findDOMNode(this) as Element;
|
||||
this.switchModeFromInline =
|
||||
!!this.state.openKeys.length && !!findDOMNode(this).querySelectorAll(`.${prefixCls}-submenu-open`).length;
|
||||
!!this.state.openKeys.length && !!menuNode.querySelectorAll(`.${prefixCls}-submenu-open`).length;
|
||||
this.inlineOpenKeys = this.state.openKeys;
|
||||
this.setState({ openKeys: [] });
|
||||
}
|
||||
|
||||
@@ -33,6 +33,10 @@
|
||||
border-bottom: 0;
|
||||
}
|
||||
|
||||
&-dark&-horizontal > &-item > a:before {
|
||||
bottom: 0;
|
||||
}
|
||||
|
||||
&-dark &-item,
|
||||
&-dark &-item-group-title,
|
||||
&-dark &-item > a {
|
||||
@@ -113,6 +117,12 @@
|
||||
}
|
||||
> .@{menu-prefix-cls}-submenu-title {
|
||||
color: @disabled-color-dark !important;
|
||||
> .@{menu-prefix-cls}-submenu-arrow {
|
||||
&:before,
|
||||
&:after {
|
||||
background: @disabled-color-dark !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -277,16 +277,16 @@
|
||||
border-bottom: 2px solid @menu-highlight-color;
|
||||
color: @menu-highlight-color;
|
||||
}
|
||||
}
|
||||
|
||||
> a {
|
||||
display: block;
|
||||
color: @menu-item-color;
|
||||
&:hover {
|
||||
color: @menu-highlight-color;
|
||||
}
|
||||
&:before {
|
||||
bottom: -2px;
|
||||
}
|
||||
> .@{menu-prefix-cls}-item > a {
|
||||
display: block;
|
||||
color: @menu-item-color;
|
||||
&:hover {
|
||||
color: @menu-highlight-color;
|
||||
}
|
||||
&:before {
|
||||
bottom: -2px;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -455,6 +455,12 @@
|
||||
> .@{menu-prefix-cls}-submenu-title {
|
||||
color: @disabled-color !important;
|
||||
cursor: not-allowed;
|
||||
> .@{menu-prefix-cls}-submenu-arrow {
|
||||
&:before,
|
||||
&:after {
|
||||
background: @disabled-color !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ This components provides some static methods, with usage and arguments as follow
|
||||
| Argument | Description | Type | Default |
|
||||
| -------- | ----------- | ---- | ------- |
|
||||
| content | content of the message | string\|ReactNode | - |
|
||||
| duration | time before auto-dismiss, in seconds | number | 1.5 |
|
||||
| duration | time(seconds) before auto-dismiss, don't dismiss if set to 0 | number | 1.5 |
|
||||
| onClose | Specify a function that will be called when the message is closed | Function | - |
|
||||
|
||||
Methods for global configuration and destruction are also provided:
|
||||
|
||||
@@ -27,7 +27,7 @@ title: Message
|
||||
| 参数 | 说明 | 类型 | 默认值 |
|
||||
| --- | --- | --- | --- |
|
||||
| content | 提示内容 | string\|ReactNode | - |
|
||||
| duration | 自动关闭的延时,单位秒 | number | 3 |
|
||||
| duration | 自动关闭的延时,单位秒。设为 0 时不自动关闭。 | number | 3 |
|
||||
| onClose | 关闭时触发的回调函数 | Function | - |
|
||||
|
||||
还提供了全局配置和全局销毁方法:
|
||||
|
||||
@@ -97,7 +97,7 @@ export default class Modal extends React.Component<ModalProps, {}> {
|
||||
maskTransitionName: 'fade',
|
||||
confirmLoading: false,
|
||||
visible: false,
|
||||
okType: 'primary',
|
||||
okType: 'primary' as ButtonType,
|
||||
};
|
||||
|
||||
static propTypes = {
|
||||
|
||||
@@ -69,6 +69,7 @@ The properties of the object are follows:
|
||||
| title | Title | string\|ReactNode | - |
|
||||
| width | Width of the modal dialog | string\|number | 416 |
|
||||
| zIndex | The `z-index` of the Modal | Number | 1000 |
|
||||
| keyboard | Whether support press esc to close | Boolean | true |
|
||||
| onCancel | Specify a function that will be called when the user clicks the Cancel button. The parameter of this function is a function whose execution should include closing the dialog. You can also just return a promise and when the promise is resolved, the modal dialog will also be closed | function | - |
|
||||
| onOk | Specify a function that will be called when the user clicks the OK button. The parameter of this function is a function whose execution should include closing the dialog. You can also just return a promise and when the promise is resolved, the modal dialog will also be closed | function | - |
|
||||
|
||||
|
||||
@@ -36,6 +36,7 @@ title: Modal
|
||||
| width | 宽度 | string\|number | 520 |
|
||||
| wrapClassName | 对话框外层容器的类名 | string | - |
|
||||
| zIndex | 设置 Modal 的 `z-index` | Number | 1000 |
|
||||
| keyboard | 是否支持键盘esc关闭 | boolean | true |
|
||||
| onCancel | 点击遮罩层或右上角叉或取消按钮的回调 | function(e) | 无 |
|
||||
| onOk | 点击确定回调 | function(e) | 无 |
|
||||
|
||||
|
||||
@@ -91,6 +91,7 @@
|
||||
padding: 24px;
|
||||
font-size: @font-size-base;
|
||||
line-height: @line-height-base;
|
||||
word-wrap: break-word;
|
||||
}
|
||||
|
||||
&-footer {
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import * as React from 'react';
|
||||
import Tooltip from '../tooltip';
|
||||
import { AbstractTooltipProps } from '../tooltip';
|
||||
import Tooltip, { AbstractTooltipProps, TooltipPlacement, TooltipTrigger } from '../tooltip';
|
||||
import warning from '../_util/warning';
|
||||
|
||||
export interface PopoverProps extends AbstractTooltipProps {
|
||||
@@ -11,9 +10,9 @@ export interface PopoverProps extends AbstractTooltipProps {
|
||||
export default class Popover extends React.Component<PopoverProps, {}> {
|
||||
static defaultProps = {
|
||||
prefixCls: 'ant-popover',
|
||||
placement: 'top',
|
||||
placement: 'top' as TooltipPlacement,
|
||||
transitionName: 'zoom-big',
|
||||
trigger: 'hover',
|
||||
trigger: 'hover' as TooltipTrigger,
|
||||
mouseEnterDelay: 0.1,
|
||||
mouseLeaveDelay: 0.1,
|
||||
overlayStyle: {},
|
||||
|
||||
113
components/progress/__tests__/__snapshots__/index.test.js.snap
Normal file
113
components/progress/__tests__/__snapshots__/index.test.js.snap
Normal file
@@ -0,0 +1,113 @@
|
||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`Progress render negetive progress 1`] = `
|
||||
<div
|
||||
class="ant-progress ant-progress-line ant-progress-status-normal ant-progress-show-info ant-progress-default"
|
||||
>
|
||||
<div>
|
||||
<div
|
||||
class="ant-progress-outer"
|
||||
>
|
||||
<div
|
||||
class="ant-progress-inner"
|
||||
>
|
||||
<div
|
||||
class="ant-progress-bg"
|
||||
style="width: 0%; height: 8px;"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<span
|
||||
class="ant-progress-text"
|
||||
>
|
||||
0%
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
|
||||
exports[`Progress render negetive successPercent 1`] = `
|
||||
<div
|
||||
class="ant-progress ant-progress-line ant-progress-status-normal ant-progress-show-info ant-progress-default"
|
||||
>
|
||||
<div>
|
||||
<div
|
||||
class="ant-progress-outer"
|
||||
>
|
||||
<div
|
||||
class="ant-progress-inner"
|
||||
>
|
||||
<div
|
||||
class="ant-progress-bg"
|
||||
style="width: 50%; height: 8px;"
|
||||
/>
|
||||
<div
|
||||
class="ant-progress-success-bg"
|
||||
style="width: 0%; height: 8px;"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<span
|
||||
class="ant-progress-text"
|
||||
>
|
||||
50%
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
|
||||
exports[`Progress render out-of-range progress 1`] = `
|
||||
<div
|
||||
class="ant-progress ant-progress-line ant-progress-status-success ant-progress-show-info ant-progress-default"
|
||||
>
|
||||
<div>
|
||||
<div
|
||||
class="ant-progress-outer"
|
||||
>
|
||||
<div
|
||||
class="ant-progress-inner"
|
||||
>
|
||||
<div
|
||||
class="ant-progress-bg"
|
||||
style="width: 100%; height: 8px;"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<span
|
||||
class="ant-progress-text"
|
||||
>
|
||||
<i
|
||||
class="anticon anticon-check-circle"
|
||||
/>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
|
||||
exports[`Progress render out-of-range progress with info 1`] = `
|
||||
<div
|
||||
class="ant-progress ant-progress-line ant-progress-status-success ant-progress-show-info ant-progress-default"
|
||||
>
|
||||
<div>
|
||||
<div
|
||||
class="ant-progress-outer"
|
||||
>
|
||||
<div
|
||||
class="ant-progress-inner"
|
||||
>
|
||||
<div
|
||||
class="ant-progress-bg"
|
||||
style="width: 100%; height: 8px;"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<span
|
||||
class="ant-progress-text"
|
||||
>
|
||||
<i
|
||||
class="anticon anticon-check-circle"
|
||||
/>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
@@ -10,4 +10,24 @@ describe('Progress', () => {
|
||||
wrapper.setProps({ percent: 50, successPercent: 100 });
|
||||
expect(wrapper.find('.ant-progress-status-success')).toHaveLength(1);
|
||||
});
|
||||
|
||||
it('render out-of-range progress', async () => {
|
||||
const wrapper = mount(<Progress percent={120} />);
|
||||
expect(wrapper.render()).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it('render out-of-range progress with info', async () => {
|
||||
const wrapper = mount(<Progress percent={120} showInfo />);
|
||||
expect(wrapper.render()).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it('render negetive progress', async () => {
|
||||
const wrapper = mount(<Progress percent={-20} />);
|
||||
expect(wrapper.render()).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it('render negetive successPercent', async () => {
|
||||
const wrapper = mount(<Progress percent={50} successPercent={-20} />);
|
||||
expect(wrapper.render()).toMatchSnapshot();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -10,10 +10,13 @@ const statusColorMap = {
|
||||
success: '#87d068',
|
||||
};
|
||||
|
||||
export type ProgressType = 'line' | 'circle' | 'dashboard';
|
||||
export type ProgressSize = 'default' | 'small';
|
||||
|
||||
export interface ProgressProps {
|
||||
prefixCls?: string;
|
||||
className?: string;
|
||||
type?: 'line' | 'circle' | 'dashboard';
|
||||
type?: ProgressType;
|
||||
percent?: number;
|
||||
successPercent?: number;
|
||||
format?: (percent: number) => string;
|
||||
@@ -25,20 +28,29 @@ export interface ProgressProps {
|
||||
style?: React.CSSProperties;
|
||||
gapDegree?: number;
|
||||
gapPosition?: 'top' | 'bottom' | 'left' | 'right';
|
||||
size?: 'default' | 'small';
|
||||
size?: ProgressSize;
|
||||
}
|
||||
|
||||
const validProgress = (progress: number | undefined) => {
|
||||
if (!progress || progress < 0) {
|
||||
return 0;
|
||||
} else if (progress > 100) {
|
||||
return 100;
|
||||
}
|
||||
return progress;
|
||||
};
|
||||
|
||||
export default class Progress extends React.Component<ProgressProps, {}> {
|
||||
static Line: any;
|
||||
static Circle: any;
|
||||
|
||||
static defaultProps = {
|
||||
type: 'line',
|
||||
type: 'line' as ProgressType,
|
||||
percent: 0,
|
||||
showInfo: true,
|
||||
trailColor: '#f3f3f3',
|
||||
prefixCls: 'ant-progress',
|
||||
size: 'default',
|
||||
size: 'default' as ProgressSize,
|
||||
};
|
||||
|
||||
static propTypes = {
|
||||
@@ -70,22 +82,22 @@ export default class Progress extends React.Component<ProgressProps, {}> {
|
||||
let text;
|
||||
const iconType = (type === 'circle' || type === 'dashboard') ? '' : '-circle';
|
||||
if (progressStatus === 'exception') {
|
||||
text = format ? textFormatter(percent) : <Icon type={`cross${iconType}`} />;
|
||||
text = format ? textFormatter(validProgress(percent)) : <Icon type={`cross${iconType}`} />;
|
||||
} else if (progressStatus === 'success') {
|
||||
text = format ? textFormatter(percent) : <Icon type={`check${iconType}`} />;
|
||||
text = format ? textFormatter(validProgress(percent)) : <Icon type={`check${iconType}`} />;
|
||||
} else {
|
||||
text = textFormatter(percent);
|
||||
text = textFormatter(validProgress(percent));
|
||||
}
|
||||
progressInfo = <span className={`${prefixCls}-text`}>{text}</span>;
|
||||
}
|
||||
|
||||
if (type === 'line') {
|
||||
const percentStyle = {
|
||||
width: `${percent}%`,
|
||||
width: `${validProgress(percent)}%`,
|
||||
height: strokeWidth || (size === 'small' ? 6 : 8),
|
||||
};
|
||||
const successPercentStyle = {
|
||||
width: `${successPercent}%`,
|
||||
width: `${validProgress(successPercent)}%`,
|
||||
height: strokeWidth || (size === 'small' ? 6 : 8),
|
||||
};
|
||||
const successSegment = successPercent !== undefined
|
||||
@@ -115,7 +127,7 @@ export default class Progress extends React.Component<ProgressProps, {}> {
|
||||
progress = (
|
||||
<div className={`${prefixCls}-inner`} style={circleStyle}>
|
||||
<Circle
|
||||
percent={percent}
|
||||
percent={validProgress(percent)}
|
||||
strokeWidth={circleWidth}
|
||||
trailWidth={circleWidth}
|
||||
strokeColor={(statusColorMap as any)[progressStatus]}
|
||||
|
||||
46
components/radio/__tests__/__snapshots__/group.test.js.snap
Normal file
46
components/radio/__tests__/__snapshots__/group.test.js.snap
Normal file
@@ -0,0 +1,46 @@
|
||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`Radio passes prefixCls down to radio 1`] = `
|
||||
<div
|
||||
class="my-radio-group"
|
||||
>
|
||||
<label
|
||||
class="my-radio-wrapper"
|
||||
>
|
||||
<span
|
||||
class="my-radio"
|
||||
>
|
||||
<input
|
||||
class="my-radio-input"
|
||||
type="radio"
|
||||
value="Apple"
|
||||
/>
|
||||
<span
|
||||
class="my-radio-inner"
|
||||
/>
|
||||
</span>
|
||||
<span>
|
||||
Apple
|
||||
</span>
|
||||
</label>
|
||||
<label
|
||||
class="my-radio-wrapper"
|
||||
>
|
||||
<span
|
||||
class="my-radio"
|
||||
>
|
||||
<input
|
||||
class="my-radio-input"
|
||||
type="radio"
|
||||
value="Orange"
|
||||
/>
|
||||
<span
|
||||
class="my-radio-inner"
|
||||
/>
|
||||
</span>
|
||||
<span>
|
||||
Orange
|
||||
</span>
|
||||
</label>
|
||||
</div>
|
||||
`;
|
||||
@@ -1,5 +1,5 @@
|
||||
import React from 'react';
|
||||
import { shallow, mount } from 'enzyme';
|
||||
import { shallow, mount, render } from 'enzyme';
|
||||
import Radio from '../radio';
|
||||
import RadioGroup from '../group';
|
||||
|
||||
@@ -112,4 +112,17 @@ describe('Radio', () => {
|
||||
expect(el.props().name).toEqual(GROUP_NAME);
|
||||
}));
|
||||
});
|
||||
|
||||
it('passes prefixCls down to radio', () => {
|
||||
const options = [
|
||||
{ label: 'Apple', value: 'Apple' },
|
||||
{ label: 'Orange', value: 'Orange' },
|
||||
];
|
||||
|
||||
const wrapper = render(
|
||||
<RadioGroup prefixCls="my-radio" options={options} />
|
||||
);
|
||||
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -20,6 +20,7 @@ function getCheckedValue(children: React.ReactNode) {
|
||||
export default class RadioGroup extends React.Component<RadioGroupProps, RadioGroupState> {
|
||||
static defaultProps = {
|
||||
disabled: false,
|
||||
prefixCls: 'ant-radio',
|
||||
};
|
||||
|
||||
static childContextTypes = {
|
||||
@@ -89,9 +90,10 @@ export default class RadioGroup extends React.Component<RadioGroupProps, RadioGr
|
||||
}
|
||||
render() {
|
||||
const props = this.props;
|
||||
const { prefixCls = 'ant-radio-group', className = '', options } = props;
|
||||
const classString = classNames(prefixCls, {
|
||||
[`${prefixCls}-${props.size}`]: props.size,
|
||||
const { prefixCls, className = '', options } = props;
|
||||
const groupPrefixCls = `${prefixCls}-group`;
|
||||
const classString = classNames(groupPrefixCls, {
|
||||
[`${groupPrefixCls}-${props.size}`]: props.size,
|
||||
}, className);
|
||||
|
||||
let children: React.ReactChildren[] | React.ReactElement<any>[] | React.ReactNode = props.children;
|
||||
@@ -103,6 +105,7 @@ export default class RadioGroup extends React.Component<RadioGroupProps, RadioGr
|
||||
return (
|
||||
<Radio
|
||||
key={index}
|
||||
prefixCls={prefixCls}
|
||||
disabled={this.props.disabled}
|
||||
value={option}
|
||||
onChange={this.onRadioChange}
|
||||
@@ -115,6 +118,7 @@ export default class RadioGroup extends React.Component<RadioGroupProps, RadioGr
|
||||
return (
|
||||
<Radio
|
||||
key={index}
|
||||
prefixCls={prefixCls}
|
||||
disabled={option.disabled || this.props.disabled}
|
||||
value={option.value}
|
||||
onChange={this.onRadioChange}
|
||||
|
||||
@@ -40,7 +40,7 @@ Select component to select value from options.
|
||||
| mode | Set mode of Select (Support after 2.9) | 'default' \| 'multiple' \| 'tags' \| 'combobox' | 'default' |
|
||||
| notFoundContent | Specify content to show when no result matches.. | string | 'Not Found' |
|
||||
| optionFilterProp | Which prop value of option will be used for filter if filterOption is true | string | value |
|
||||
| optionLabelProp | Which prop value of option will render as content of select. | string | `children` |
|
||||
| optionLabelProp | Which prop value of option will render as content of select. | string | `value` for `combobox`, `children` for other modes |
|
||||
| placeholder | Placeholder of select | string\|ReactNode | - |
|
||||
| showSearch | Whether show search input in single mode. | boolean | false |
|
||||
| showArrow | Whether to show the drop-down arrow | boolean | true |
|
||||
|
||||
@@ -11,7 +11,7 @@ title:
|
||||
|
||||
## en-US
|
||||
|
||||
Synchronize with [InptNumber](/components/input-number/) component.
|
||||
Synchronize with [InputNumber](/components/input-number/) component.
|
||||
|
||||
````jsx
|
||||
import { Slider, InputNumber, Row, Col } from 'antd';
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
order: 3
|
||||
title:
|
||||
zh-CN: 自定义提示
|
||||
en-US: Customerize tooltip
|
||||
en-US: Customize tooltip
|
||||
---
|
||||
|
||||
## zh-CN
|
||||
|
||||
@@ -5,6 +5,7 @@ import Animate from 'rc-animate';
|
||||
import isCssAnimationSupported from '../_util/isCssAnimationSupported';
|
||||
import omit from 'omit.js';
|
||||
|
||||
export type SpinSize = 'small' | 'default' | 'large';
|
||||
export type SpinIndicator = React.ReactElement<any>;
|
||||
|
||||
export interface SpinProps {
|
||||
@@ -12,7 +13,7 @@ export interface SpinProps {
|
||||
className?: string;
|
||||
spinning?: boolean;
|
||||
style?: React.CSSProperties;
|
||||
size?: 'small' | 'default' | 'large';
|
||||
size?: SpinSize;
|
||||
tip?: string;
|
||||
delay?: number;
|
||||
wrapperClassName?: string;
|
||||
@@ -28,7 +29,7 @@ export default class Spin extends React.Component<SpinProps, SpinState> {
|
||||
static defaultProps = {
|
||||
prefixCls: 'ant-spin',
|
||||
spinning: true,
|
||||
size: 'default',
|
||||
size: 'default' as SpinSize,
|
||||
wrapperClassName: '',
|
||||
};
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* stylelint-disable declaration-bang-space-before,no-duplicate-selectors */
|
||||
/* stylelint-disable declaration-bang-space-before,no-duplicate-selectors,string-no-newline */
|
||||
.tinyColorMixin() {
|
||||
@functions: ~`(function() {
|
||||
// TinyColor v1.4.1
|
||||
|
||||
@@ -56,9 +56,7 @@ html {
|
||||
}
|
||||
|
||||
// IE10+ doesn't honor `<meta name="viewport">` in some cases.
|
||||
@at-root {
|
||||
@-ms-viewport { width: device-width; }
|
||||
}
|
||||
@-ms-viewport { width: device-width; }
|
||||
|
||||
// Shim for "new" HTML5 structural elements to display correctly (IE10, older browsers)
|
||||
article, aside, dialog, figcaption, figure, footer, header, hgroup, main, nav, section {
|
||||
|
||||
@@ -336,6 +336,7 @@
|
||||
@table-header-sort-bg: @background-color-base;
|
||||
@table-row-hover-bg: @primary-1;
|
||||
@table-selected-row-bg: #fafafa;
|
||||
@table-expanded-row-bg: #fbfbfb;
|
||||
@table-padding-vertical: 16px;
|
||||
@table-padding-horizontal: 16px;
|
||||
|
||||
@@ -422,6 +423,7 @@
|
||||
// ---
|
||||
@switch-height: 22px;
|
||||
@switch-sm-height: 16px;
|
||||
@switch-sm-checked-margin-left: -(@switch-sm-height - 3px);
|
||||
@switch-disabled-opacity: 0.4;
|
||||
@switch-color: @primary-color;
|
||||
|
||||
|
||||
@@ -107,7 +107,7 @@
|
||||
&:before,
|
||||
&:after {
|
||||
left: 100%;
|
||||
margin-left: -12.5px;
|
||||
margin-left: @switch-sm-checked-margin-left;
|
||||
}
|
||||
|
||||
.@{switch-prefix-cls}-inner {
|
||||
|
||||
@@ -179,21 +179,17 @@ export default class Table<T> extends React.Component<TableProps<T>, TableState<
|
||||
this.store.setState({
|
||||
selectedRowKeys: nextProps.rowSelection.selectedRowKeys || [],
|
||||
});
|
||||
const { rowSelection } = this.props;
|
||||
if (rowSelection && (
|
||||
nextProps.rowSelection.getCheckboxProps !== rowSelection.getCheckboxProps
|
||||
)) {
|
||||
this.CheckboxPropsCache = {};
|
||||
}
|
||||
}
|
||||
if ('dataSource' in nextProps &&
|
||||
nextProps.dataSource !== this.props.dataSource) {
|
||||
this.store.setState({
|
||||
selectionDirty: false,
|
||||
});
|
||||
this.CheckboxPropsCache = {};
|
||||
}
|
||||
|
||||
// https://github.com/ant-design/ant-design/issues/10133
|
||||
this.CheckboxPropsCache = {};
|
||||
|
||||
if (this.getSortOrderColumns(this.columns).length > 0) {
|
||||
const sortState = this.getSortStateFromColumns(this.columns);
|
||||
if (sortState.sortColumn !== this.state.sortColumn ||
|
||||
|
||||
@@ -299,6 +299,34 @@ describe('Table.rowSelection', () => {
|
||||
});
|
||||
});
|
||||
|
||||
// https://github.com/ant-design/ant-design/issues/4245
|
||||
it('should allow dynamic getCheckboxProps', () => {
|
||||
class App extends React.Component {
|
||||
state = {
|
||||
disableName: 'Jack',
|
||||
};
|
||||
render() {
|
||||
return (
|
||||
<Table
|
||||
columns={columns}
|
||||
dataSource={data}
|
||||
rowSelection={{
|
||||
getCheckboxProps: record => ({ disabled: record.name === this.state.disableName }),
|
||||
}}
|
||||
/>
|
||||
);
|
||||
}
|
||||
}
|
||||
const wrapper = mount(<App />);
|
||||
let checkboxs = wrapper.find('input');
|
||||
expect(checkboxs.at(1).props().disabled).toBe(true);
|
||||
expect(checkboxs.at(2).props().disabled).toBe(false);
|
||||
wrapper.setState({ disableName: 'Lucy' });
|
||||
checkboxs = wrapper.find('input');
|
||||
expect(checkboxs.at(1).props().disabled).toBe(false);
|
||||
expect(checkboxs.at(2).props().disabled).toBe(true);
|
||||
});
|
||||
|
||||
// https://github.com/ant-design/ant-design/issues/4779
|
||||
it('should not switch pagination when select record', () => {
|
||||
const newData = [];
|
||||
|
||||
@@ -175,7 +175,7 @@ exports[`renders ./components/table/demo/basic.md correctly 1`] = `
|
||||
style="padding-left:0px"
|
||||
/>
|
||||
<a
|
||||
href="#"
|
||||
href="javascript:;"
|
||||
>
|
||||
John Brown
|
||||
</a>
|
||||
@@ -195,7 +195,7 @@ exports[`renders ./components/table/demo/basic.md correctly 1`] = `
|
||||
>
|
||||
<span>
|
||||
<a
|
||||
href="#"
|
||||
href="javascript:;"
|
||||
>
|
||||
Action 一 John Brown
|
||||
</a>
|
||||
@@ -203,7 +203,7 @@ exports[`renders ./components/table/demo/basic.md correctly 1`] = `
|
||||
class="ant-divider ant-divider-vertical"
|
||||
/>
|
||||
<a
|
||||
href="#"
|
||||
href="javascript:;"
|
||||
>
|
||||
Delete
|
||||
</a>
|
||||
@@ -212,7 +212,7 @@ exports[`renders ./components/table/demo/basic.md correctly 1`] = `
|
||||
/>
|
||||
<a
|
||||
class="ant-dropdown-link"
|
||||
href="#"
|
||||
href="javascript:;"
|
||||
>
|
||||
More actions
|
||||
<i
|
||||
@@ -233,7 +233,7 @@ exports[`renders ./components/table/demo/basic.md correctly 1`] = `
|
||||
style="padding-left:0px"
|
||||
/>
|
||||
<a
|
||||
href="#"
|
||||
href="javascript:;"
|
||||
>
|
||||
Jim Green
|
||||
</a>
|
||||
@@ -253,7 +253,7 @@ exports[`renders ./components/table/demo/basic.md correctly 1`] = `
|
||||
>
|
||||
<span>
|
||||
<a
|
||||
href="#"
|
||||
href="javascript:;"
|
||||
>
|
||||
Action 一 Jim Green
|
||||
</a>
|
||||
@@ -261,7 +261,7 @@ exports[`renders ./components/table/demo/basic.md correctly 1`] = `
|
||||
class="ant-divider ant-divider-vertical"
|
||||
/>
|
||||
<a
|
||||
href="#"
|
||||
href="javascript:;"
|
||||
>
|
||||
Delete
|
||||
</a>
|
||||
@@ -270,7 +270,7 @@ exports[`renders ./components/table/demo/basic.md correctly 1`] = `
|
||||
/>
|
||||
<a
|
||||
class="ant-dropdown-link"
|
||||
href="#"
|
||||
href="javascript:;"
|
||||
>
|
||||
More actions
|
||||
<i
|
||||
@@ -291,7 +291,7 @@ exports[`renders ./components/table/demo/basic.md correctly 1`] = `
|
||||
style="padding-left:0px"
|
||||
/>
|
||||
<a
|
||||
href="#"
|
||||
href="javascript:;"
|
||||
>
|
||||
Joe Black
|
||||
</a>
|
||||
@@ -311,7 +311,7 @@ exports[`renders ./components/table/demo/basic.md correctly 1`] = `
|
||||
>
|
||||
<span>
|
||||
<a
|
||||
href="#"
|
||||
href="javascript:;"
|
||||
>
|
||||
Action 一 Joe Black
|
||||
</a>
|
||||
@@ -319,7 +319,7 @@ exports[`renders ./components/table/demo/basic.md correctly 1`] = `
|
||||
class="ant-divider ant-divider-vertical"
|
||||
/>
|
||||
<a
|
||||
href="#"
|
||||
href="javascript:;"
|
||||
>
|
||||
Delete
|
||||
</a>
|
||||
@@ -328,7 +328,7 @@ exports[`renders ./components/table/demo/basic.md correctly 1`] = `
|
||||
/>
|
||||
<a
|
||||
class="ant-dropdown-link"
|
||||
href="#"
|
||||
href="javascript:;"
|
||||
>
|
||||
More actions
|
||||
<i
|
||||
@@ -453,7 +453,7 @@ exports[`renders ./components/table/demo/bordered.md correctly 1`] = `
|
||||
style="padding-left:0px"
|
||||
/>
|
||||
<a
|
||||
href="#"
|
||||
href="javascript:;"
|
||||
>
|
||||
John Brown
|
||||
</a>
|
||||
@@ -480,7 +480,7 @@ exports[`renders ./components/table/demo/bordered.md correctly 1`] = `
|
||||
style="padding-left:0px"
|
||||
/>
|
||||
<a
|
||||
href="#"
|
||||
href="javascript:;"
|
||||
>
|
||||
Jim Green
|
||||
</a>
|
||||
@@ -507,7 +507,7 @@ exports[`renders ./components/table/demo/bordered.md correctly 1`] = `
|
||||
style="padding-left:0px"
|
||||
/>
|
||||
<a
|
||||
href="#"
|
||||
href="javascript:;"
|
||||
>
|
||||
Joe Black
|
||||
</a>
|
||||
@@ -648,7 +648,7 @@ exports[`renders ./components/table/demo/colspan-rowspan.md correctly 1`] = `
|
||||
style="padding-left:0px"
|
||||
/>
|
||||
<a
|
||||
href="#"
|
||||
href="javascript:;"
|
||||
>
|
||||
John Brown
|
||||
</a>
|
||||
@@ -685,7 +685,7 @@ exports[`renders ./components/table/demo/colspan-rowspan.md correctly 1`] = `
|
||||
style="padding-left:0px"
|
||||
/>
|
||||
<a
|
||||
href="#"
|
||||
href="javascript:;"
|
||||
>
|
||||
Jim Green
|
||||
</a>
|
||||
@@ -722,7 +722,7 @@ exports[`renders ./components/table/demo/colspan-rowspan.md correctly 1`] = `
|
||||
style="padding-left:0px"
|
||||
/>
|
||||
<a
|
||||
href="#"
|
||||
href="javascript:;"
|
||||
>
|
||||
Joe Black
|
||||
</a>
|
||||
@@ -760,7 +760,7 @@ exports[`renders ./components/table/demo/colspan-rowspan.md correctly 1`] = `
|
||||
style="padding-left:0px"
|
||||
/>
|
||||
<a
|
||||
href="#"
|
||||
href="javascript:;"
|
||||
>
|
||||
Jim Red
|
||||
</a>
|
||||
@@ -793,7 +793,7 @@ exports[`renders ./components/table/demo/colspan-rowspan.md correctly 1`] = `
|
||||
style="padding-left:0px"
|
||||
/>
|
||||
<a
|
||||
href="#"
|
||||
href="javascript:;"
|
||||
>
|
||||
Jake White
|
||||
</a>
|
||||
@@ -1835,7 +1835,7 @@ exports[`renders ./components/table/demo/dynamic-settings.md correctly 1`] = `
|
||||
class=""
|
||||
>
|
||||
<a
|
||||
href="#"
|
||||
href="javascript:;"
|
||||
>
|
||||
John Brown
|
||||
</a>
|
||||
@@ -1855,7 +1855,7 @@ exports[`renders ./components/table/demo/dynamic-settings.md correctly 1`] = `
|
||||
>
|
||||
<span>
|
||||
<a
|
||||
href="#"
|
||||
href="javascript:;"
|
||||
>
|
||||
Action 一 John Brown
|
||||
</a>
|
||||
@@ -1863,7 +1863,7 @@ exports[`renders ./components/table/demo/dynamic-settings.md correctly 1`] = `
|
||||
class="ant-divider ant-divider-vertical"
|
||||
/>
|
||||
<a
|
||||
href="#"
|
||||
href="javascript:;"
|
||||
>
|
||||
Delete
|
||||
</a>
|
||||
@@ -1872,7 +1872,7 @@ exports[`renders ./components/table/demo/dynamic-settings.md correctly 1`] = `
|
||||
/>
|
||||
<a
|
||||
class="ant-dropdown-link"
|
||||
href="#"
|
||||
href="javascript:;"
|
||||
>
|
||||
More actions
|
||||
<i
|
||||
@@ -1917,7 +1917,7 @@ exports[`renders ./components/table/demo/dynamic-settings.md correctly 1`] = `
|
||||
class=""
|
||||
>
|
||||
<a
|
||||
href="#"
|
||||
href="javascript:;"
|
||||
>
|
||||
John Brown
|
||||
</a>
|
||||
@@ -1937,7 +1937,7 @@ exports[`renders ./components/table/demo/dynamic-settings.md correctly 1`] = `
|
||||
>
|
||||
<span>
|
||||
<a
|
||||
href="#"
|
||||
href="javascript:;"
|
||||
>
|
||||
Action 一 John Brown
|
||||
</a>
|
||||
@@ -1945,7 +1945,7 @@ exports[`renders ./components/table/demo/dynamic-settings.md correctly 1`] = `
|
||||
class="ant-divider ant-divider-vertical"
|
||||
/>
|
||||
<a
|
||||
href="#"
|
||||
href="javascript:;"
|
||||
>
|
||||
Delete
|
||||
</a>
|
||||
@@ -1954,7 +1954,7 @@ exports[`renders ./components/table/demo/dynamic-settings.md correctly 1`] = `
|
||||
/>
|
||||
<a
|
||||
class="ant-dropdown-link"
|
||||
href="#"
|
||||
href="javascript:;"
|
||||
>
|
||||
More actions
|
||||
<i
|
||||
@@ -1999,7 +1999,7 @@ exports[`renders ./components/table/demo/dynamic-settings.md correctly 1`] = `
|
||||
class=""
|
||||
>
|
||||
<a
|
||||
href="#"
|
||||
href="javascript:;"
|
||||
>
|
||||
John Brown
|
||||
</a>
|
||||
@@ -2019,7 +2019,7 @@ exports[`renders ./components/table/demo/dynamic-settings.md correctly 1`] = `
|
||||
>
|
||||
<span>
|
||||
<a
|
||||
href="#"
|
||||
href="javascript:;"
|
||||
>
|
||||
Action 一 John Brown
|
||||
</a>
|
||||
@@ -2027,7 +2027,7 @@ exports[`renders ./components/table/demo/dynamic-settings.md correctly 1`] = `
|
||||
class="ant-divider ant-divider-vertical"
|
||||
/>
|
||||
<a
|
||||
href="#"
|
||||
href="javascript:;"
|
||||
>
|
||||
Delete
|
||||
</a>
|
||||
@@ -2036,7 +2036,7 @@ exports[`renders ./components/table/demo/dynamic-settings.md correctly 1`] = `
|
||||
/>
|
||||
<a
|
||||
class="ant-dropdown-link"
|
||||
href="#"
|
||||
href="javascript:;"
|
||||
>
|
||||
More actions
|
||||
<i
|
||||
@@ -2081,7 +2081,7 @@ exports[`renders ./components/table/demo/dynamic-settings.md correctly 1`] = `
|
||||
class=""
|
||||
>
|
||||
<a
|
||||
href="#"
|
||||
href="javascript:;"
|
||||
>
|
||||
John Brown
|
||||
</a>
|
||||
@@ -2101,7 +2101,7 @@ exports[`renders ./components/table/demo/dynamic-settings.md correctly 1`] = `
|
||||
>
|
||||
<span>
|
||||
<a
|
||||
href="#"
|
||||
href="javascript:;"
|
||||
>
|
||||
Action 一 John Brown
|
||||
</a>
|
||||
@@ -2109,7 +2109,7 @@ exports[`renders ./components/table/demo/dynamic-settings.md correctly 1`] = `
|
||||
class="ant-divider ant-divider-vertical"
|
||||
/>
|
||||
<a
|
||||
href="#"
|
||||
href="javascript:;"
|
||||
>
|
||||
Delete
|
||||
</a>
|
||||
@@ -2118,7 +2118,7 @@ exports[`renders ./components/table/demo/dynamic-settings.md correctly 1`] = `
|
||||
/>
|
||||
<a
|
||||
class="ant-dropdown-link"
|
||||
href="#"
|
||||
href="javascript:;"
|
||||
>
|
||||
More actions
|
||||
<i
|
||||
@@ -2163,7 +2163,7 @@ exports[`renders ./components/table/demo/dynamic-settings.md correctly 1`] = `
|
||||
class=""
|
||||
>
|
||||
<a
|
||||
href="#"
|
||||
href="javascript:;"
|
||||
>
|
||||
John Brown
|
||||
</a>
|
||||
@@ -2183,7 +2183,7 @@ exports[`renders ./components/table/demo/dynamic-settings.md correctly 1`] = `
|
||||
>
|
||||
<span>
|
||||
<a
|
||||
href="#"
|
||||
href="javascript:;"
|
||||
>
|
||||
Action 一 John Brown
|
||||
</a>
|
||||
@@ -2191,7 +2191,7 @@ exports[`renders ./components/table/demo/dynamic-settings.md correctly 1`] = `
|
||||
class="ant-divider ant-divider-vertical"
|
||||
/>
|
||||
<a
|
||||
href="#"
|
||||
href="javascript:;"
|
||||
>
|
||||
Delete
|
||||
</a>
|
||||
@@ -2200,7 +2200,7 @@ exports[`renders ./components/table/demo/dynamic-settings.md correctly 1`] = `
|
||||
/>
|
||||
<a
|
||||
class="ant-dropdown-link"
|
||||
href="#"
|
||||
href="javascript:;"
|
||||
>
|
||||
More actions
|
||||
<i
|
||||
@@ -2245,7 +2245,7 @@ exports[`renders ./components/table/demo/dynamic-settings.md correctly 1`] = `
|
||||
class=""
|
||||
>
|
||||
<a
|
||||
href="#"
|
||||
href="javascript:;"
|
||||
>
|
||||
John Brown
|
||||
</a>
|
||||
@@ -2265,7 +2265,7 @@ exports[`renders ./components/table/demo/dynamic-settings.md correctly 1`] = `
|
||||
>
|
||||
<span>
|
||||
<a
|
||||
href="#"
|
||||
href="javascript:;"
|
||||
>
|
||||
Action 一 John Brown
|
||||
</a>
|
||||
@@ -2273,7 +2273,7 @@ exports[`renders ./components/table/demo/dynamic-settings.md correctly 1`] = `
|
||||
class="ant-divider ant-divider-vertical"
|
||||
/>
|
||||
<a
|
||||
href="#"
|
||||
href="javascript:;"
|
||||
>
|
||||
Delete
|
||||
</a>
|
||||
@@ -2282,7 +2282,7 @@ exports[`renders ./components/table/demo/dynamic-settings.md correctly 1`] = `
|
||||
/>
|
||||
<a
|
||||
class="ant-dropdown-link"
|
||||
href="#"
|
||||
href="javascript:;"
|
||||
>
|
||||
More actions
|
||||
<i
|
||||
@@ -2327,7 +2327,7 @@ exports[`renders ./components/table/demo/dynamic-settings.md correctly 1`] = `
|
||||
class=""
|
||||
>
|
||||
<a
|
||||
href="#"
|
||||
href="javascript:;"
|
||||
>
|
||||
John Brown
|
||||
</a>
|
||||
@@ -2347,7 +2347,7 @@ exports[`renders ./components/table/demo/dynamic-settings.md correctly 1`] = `
|
||||
>
|
||||
<span>
|
||||
<a
|
||||
href="#"
|
||||
href="javascript:;"
|
||||
>
|
||||
Action 一 John Brown
|
||||
</a>
|
||||
@@ -2355,7 +2355,7 @@ exports[`renders ./components/table/demo/dynamic-settings.md correctly 1`] = `
|
||||
class="ant-divider ant-divider-vertical"
|
||||
/>
|
||||
<a
|
||||
href="#"
|
||||
href="javascript:;"
|
||||
>
|
||||
Delete
|
||||
</a>
|
||||
@@ -2364,7 +2364,7 @@ exports[`renders ./components/table/demo/dynamic-settings.md correctly 1`] = `
|
||||
/>
|
||||
<a
|
||||
class="ant-dropdown-link"
|
||||
href="#"
|
||||
href="javascript:;"
|
||||
>
|
||||
More actions
|
||||
<i
|
||||
@@ -2409,7 +2409,7 @@ exports[`renders ./components/table/demo/dynamic-settings.md correctly 1`] = `
|
||||
class=""
|
||||
>
|
||||
<a
|
||||
href="#"
|
||||
href="javascript:;"
|
||||
>
|
||||
John Brown
|
||||
</a>
|
||||
@@ -2429,7 +2429,7 @@ exports[`renders ./components/table/demo/dynamic-settings.md correctly 1`] = `
|
||||
>
|
||||
<span>
|
||||
<a
|
||||
href="#"
|
||||
href="javascript:;"
|
||||
>
|
||||
Action 一 John Brown
|
||||
</a>
|
||||
@@ -2437,7 +2437,7 @@ exports[`renders ./components/table/demo/dynamic-settings.md correctly 1`] = `
|
||||
class="ant-divider ant-divider-vertical"
|
||||
/>
|
||||
<a
|
||||
href="#"
|
||||
href="javascript:;"
|
||||
>
|
||||
Delete
|
||||
</a>
|
||||
@@ -2446,7 +2446,7 @@ exports[`renders ./components/table/demo/dynamic-settings.md correctly 1`] = `
|
||||
/>
|
||||
<a
|
||||
class="ant-dropdown-link"
|
||||
href="#"
|
||||
href="javascript:;"
|
||||
>
|
||||
More actions
|
||||
<i
|
||||
@@ -2491,7 +2491,7 @@ exports[`renders ./components/table/demo/dynamic-settings.md correctly 1`] = `
|
||||
class=""
|
||||
>
|
||||
<a
|
||||
href="#"
|
||||
href="javascript:;"
|
||||
>
|
||||
John Brown
|
||||
</a>
|
||||
@@ -2511,7 +2511,7 @@ exports[`renders ./components/table/demo/dynamic-settings.md correctly 1`] = `
|
||||
>
|
||||
<span>
|
||||
<a
|
||||
href="#"
|
||||
href="javascript:;"
|
||||
>
|
||||
Action 一 John Brown
|
||||
</a>
|
||||
@@ -2519,7 +2519,7 @@ exports[`renders ./components/table/demo/dynamic-settings.md correctly 1`] = `
|
||||
class="ant-divider ant-divider-vertical"
|
||||
/>
|
||||
<a
|
||||
href="#"
|
||||
href="javascript:;"
|
||||
>
|
||||
Delete
|
||||
</a>
|
||||
@@ -2528,7 +2528,7 @@ exports[`renders ./components/table/demo/dynamic-settings.md correctly 1`] = `
|
||||
/>
|
||||
<a
|
||||
class="ant-dropdown-link"
|
||||
href="#"
|
||||
href="javascript:;"
|
||||
>
|
||||
More actions
|
||||
<i
|
||||
@@ -2573,7 +2573,7 @@ exports[`renders ./components/table/demo/dynamic-settings.md correctly 1`] = `
|
||||
class=""
|
||||
>
|
||||
<a
|
||||
href="#"
|
||||
href="javascript:;"
|
||||
>
|
||||
John Brown
|
||||
</a>
|
||||
@@ -2593,7 +2593,7 @@ exports[`renders ./components/table/demo/dynamic-settings.md correctly 1`] = `
|
||||
>
|
||||
<span>
|
||||
<a
|
||||
href="#"
|
||||
href="javascript:;"
|
||||
>
|
||||
Action 一 John Brown
|
||||
</a>
|
||||
@@ -2601,7 +2601,7 @@ exports[`renders ./components/table/demo/dynamic-settings.md correctly 1`] = `
|
||||
class="ant-divider ant-divider-vertical"
|
||||
/>
|
||||
<a
|
||||
href="#"
|
||||
href="javascript:;"
|
||||
>
|
||||
Delete
|
||||
</a>
|
||||
@@ -2610,7 +2610,7 @@ exports[`renders ./components/table/demo/dynamic-settings.md correctly 1`] = `
|
||||
/>
|
||||
<a
|
||||
class="ant-dropdown-link"
|
||||
href="#"
|
||||
href="javascript:;"
|
||||
>
|
||||
More actions
|
||||
<i
|
||||
@@ -2781,7 +2781,7 @@ exports[`renders ./components/table/demo/edit-cell.md correctly 1`] = `
|
||||
class=""
|
||||
>
|
||||
<a
|
||||
href="#"
|
||||
href="javascript:;"
|
||||
>
|
||||
Delete
|
||||
</a>
|
||||
@@ -2824,7 +2824,7 @@ exports[`renders ./components/table/demo/edit-cell.md correctly 1`] = `
|
||||
class=""
|
||||
>
|
||||
<a
|
||||
href="#"
|
||||
href="javascript:;"
|
||||
>
|
||||
Delete
|
||||
</a>
|
||||
@@ -3543,7 +3543,7 @@ exports[`renders ./components/table/demo/expand.md correctly 1`] = `
|
||||
class=""
|
||||
>
|
||||
<a
|
||||
href="#"
|
||||
href="javascript:;"
|
||||
>
|
||||
Delete
|
||||
</a>
|
||||
@@ -3578,7 +3578,7 @@ exports[`renders ./components/table/demo/expand.md correctly 1`] = `
|
||||
class=""
|
||||
>
|
||||
<a
|
||||
href="#"
|
||||
href="javascript:;"
|
||||
>
|
||||
Delete
|
||||
</a>
|
||||
@@ -3613,7 +3613,7 @@ exports[`renders ./components/table/demo/expand.md correctly 1`] = `
|
||||
class=""
|
||||
>
|
||||
<a
|
||||
href="#"
|
||||
href="javascript:;"
|
||||
>
|
||||
Delete
|
||||
</a>
|
||||
@@ -4077,7 +4077,7 @@ exports[`renders ./components/table/demo/fixed-columns.md correctly 1`] = `
|
||||
class=""
|
||||
>
|
||||
<a
|
||||
href="#"
|
||||
href="javascript:;"
|
||||
>
|
||||
action
|
||||
</a>
|
||||
@@ -4144,7 +4144,7 @@ exports[`renders ./components/table/demo/fixed-columns.md correctly 1`] = `
|
||||
class=""
|
||||
>
|
||||
<a
|
||||
href="#"
|
||||
href="javascript:;"
|
||||
>
|
||||
action
|
||||
</a>
|
||||
@@ -4280,7 +4280,7 @@ exports[`renders ./components/table/demo/fixed-columns.md correctly 1`] = `
|
||||
class=""
|
||||
>
|
||||
<a
|
||||
href="#"
|
||||
href="javascript:;"
|
||||
>
|
||||
action
|
||||
</a>
|
||||
@@ -4293,7 +4293,7 @@ exports[`renders ./components/table/demo/fixed-columns.md correctly 1`] = `
|
||||
class=""
|
||||
>
|
||||
<a
|
||||
href="#"
|
||||
href="javascript:;"
|
||||
>
|
||||
action
|
||||
</a>
|
||||
@@ -4592,7 +4592,7 @@ exports[`renders ./components/table/demo/fixed-columns-header.md correctly 1`] =
|
||||
class=""
|
||||
>
|
||||
<a
|
||||
href="#"
|
||||
href="javascript:;"
|
||||
>
|
||||
action
|
||||
</a>
|
||||
@@ -4659,7 +4659,7 @@ exports[`renders ./components/table/demo/fixed-columns-header.md correctly 1`] =
|
||||
class=""
|
||||
>
|
||||
<a
|
||||
href="#"
|
||||
href="javascript:;"
|
||||
>
|
||||
action
|
||||
</a>
|
||||
@@ -4726,7 +4726,7 @@ exports[`renders ./components/table/demo/fixed-columns-header.md correctly 1`] =
|
||||
class=""
|
||||
>
|
||||
<a
|
||||
href="#"
|
||||
href="javascript:;"
|
||||
>
|
||||
action
|
||||
</a>
|
||||
@@ -4793,7 +4793,7 @@ exports[`renders ./components/table/demo/fixed-columns-header.md correctly 1`] =
|
||||
class=""
|
||||
>
|
||||
<a
|
||||
href="#"
|
||||
href="javascript:;"
|
||||
>
|
||||
action
|
||||
</a>
|
||||
@@ -4860,7 +4860,7 @@ exports[`renders ./components/table/demo/fixed-columns-header.md correctly 1`] =
|
||||
class=""
|
||||
>
|
||||
<a
|
||||
href="#"
|
||||
href="javascript:;"
|
||||
>
|
||||
action
|
||||
</a>
|
||||
@@ -4927,7 +4927,7 @@ exports[`renders ./components/table/demo/fixed-columns-header.md correctly 1`] =
|
||||
class=""
|
||||
>
|
||||
<a
|
||||
href="#"
|
||||
href="javascript:;"
|
||||
>
|
||||
action
|
||||
</a>
|
||||
@@ -4994,7 +4994,7 @@ exports[`renders ./components/table/demo/fixed-columns-header.md correctly 1`] =
|
||||
class=""
|
||||
>
|
||||
<a
|
||||
href="#"
|
||||
href="javascript:;"
|
||||
>
|
||||
action
|
||||
</a>
|
||||
@@ -5061,7 +5061,7 @@ exports[`renders ./components/table/demo/fixed-columns-header.md correctly 1`] =
|
||||
class=""
|
||||
>
|
||||
<a
|
||||
href="#"
|
||||
href="javascript:;"
|
||||
>
|
||||
action
|
||||
</a>
|
||||
@@ -5128,7 +5128,7 @@ exports[`renders ./components/table/demo/fixed-columns-header.md correctly 1`] =
|
||||
class=""
|
||||
>
|
||||
<a
|
||||
href="#"
|
||||
href="javascript:;"
|
||||
>
|
||||
action
|
||||
</a>
|
||||
@@ -5195,7 +5195,7 @@ exports[`renders ./components/table/demo/fixed-columns-header.md correctly 1`] =
|
||||
class=""
|
||||
>
|
||||
<a
|
||||
href="#"
|
||||
href="javascript:;"
|
||||
>
|
||||
action
|
||||
</a>
|
||||
@@ -5506,7 +5506,7 @@ exports[`renders ./components/table/demo/fixed-columns-header.md correctly 1`] =
|
||||
class=""
|
||||
>
|
||||
<a
|
||||
href="#"
|
||||
href="javascript:;"
|
||||
>
|
||||
action
|
||||
</a>
|
||||
@@ -5519,7 +5519,7 @@ exports[`renders ./components/table/demo/fixed-columns-header.md correctly 1`] =
|
||||
class=""
|
||||
>
|
||||
<a
|
||||
href="#"
|
||||
href="javascript:;"
|
||||
>
|
||||
action
|
||||
</a>
|
||||
@@ -5532,7 +5532,7 @@ exports[`renders ./components/table/demo/fixed-columns-header.md correctly 1`] =
|
||||
class=""
|
||||
>
|
||||
<a
|
||||
href="#"
|
||||
href="javascript:;"
|
||||
>
|
||||
action
|
||||
</a>
|
||||
@@ -5545,7 +5545,7 @@ exports[`renders ./components/table/demo/fixed-columns-header.md correctly 1`] =
|
||||
class=""
|
||||
>
|
||||
<a
|
||||
href="#"
|
||||
href="javascript:;"
|
||||
>
|
||||
action
|
||||
</a>
|
||||
@@ -5558,7 +5558,7 @@ exports[`renders ./components/table/demo/fixed-columns-header.md correctly 1`] =
|
||||
class=""
|
||||
>
|
||||
<a
|
||||
href="#"
|
||||
href="javascript:;"
|
||||
>
|
||||
action
|
||||
</a>
|
||||
@@ -5571,7 +5571,7 @@ exports[`renders ./components/table/demo/fixed-columns-header.md correctly 1`] =
|
||||
class=""
|
||||
>
|
||||
<a
|
||||
href="#"
|
||||
href="javascript:;"
|
||||
>
|
||||
action
|
||||
</a>
|
||||
@@ -5584,7 +5584,7 @@ exports[`renders ./components/table/demo/fixed-columns-header.md correctly 1`] =
|
||||
class=""
|
||||
>
|
||||
<a
|
||||
href="#"
|
||||
href="javascript:;"
|
||||
>
|
||||
action
|
||||
</a>
|
||||
@@ -5597,7 +5597,7 @@ exports[`renders ./components/table/demo/fixed-columns-header.md correctly 1`] =
|
||||
class=""
|
||||
>
|
||||
<a
|
||||
href="#"
|
||||
href="javascript:;"
|
||||
>
|
||||
action
|
||||
</a>
|
||||
@@ -5610,7 +5610,7 @@ exports[`renders ./components/table/demo/fixed-columns-header.md correctly 1`] =
|
||||
class=""
|
||||
>
|
||||
<a
|
||||
href="#"
|
||||
href="javascript:;"
|
||||
>
|
||||
action
|
||||
</a>
|
||||
@@ -5623,7 +5623,7 @@ exports[`renders ./components/table/demo/fixed-columns-header.md correctly 1`] =
|
||||
class=""
|
||||
>
|
||||
<a
|
||||
href="#"
|
||||
href="javascript:;"
|
||||
>
|
||||
action
|
||||
</a>
|
||||
@@ -8513,7 +8513,7 @@ exports[`renders ./components/table/demo/jsx.md correctly 1`] = `
|
||||
>
|
||||
<span>
|
||||
<a
|
||||
href="#"
|
||||
href="javascript:;"
|
||||
>
|
||||
Action 一
|
||||
</a>
|
||||
@@ -8521,7 +8521,7 @@ exports[`renders ./components/table/demo/jsx.md correctly 1`] = `
|
||||
class="ant-divider ant-divider-vertical"
|
||||
/>
|
||||
<a
|
||||
href="#"
|
||||
href="javascript:;"
|
||||
>
|
||||
Delete
|
||||
</a>
|
||||
@@ -8530,7 +8530,7 @@ exports[`renders ./components/table/demo/jsx.md correctly 1`] = `
|
||||
/>
|
||||
<a
|
||||
class="ant-dropdown-link"
|
||||
href="#"
|
||||
href="javascript:;"
|
||||
>
|
||||
More actions
|
||||
<i
|
||||
@@ -8572,7 +8572,7 @@ exports[`renders ./components/table/demo/jsx.md correctly 1`] = `
|
||||
>
|
||||
<span>
|
||||
<a
|
||||
href="#"
|
||||
href="javascript:;"
|
||||
>
|
||||
Action 一
|
||||
</a>
|
||||
@@ -8580,7 +8580,7 @@ exports[`renders ./components/table/demo/jsx.md correctly 1`] = `
|
||||
class="ant-divider ant-divider-vertical"
|
||||
/>
|
||||
<a
|
||||
href="#"
|
||||
href="javascript:;"
|
||||
>
|
||||
Delete
|
||||
</a>
|
||||
@@ -8589,7 +8589,7 @@ exports[`renders ./components/table/demo/jsx.md correctly 1`] = `
|
||||
/>
|
||||
<a
|
||||
class="ant-dropdown-link"
|
||||
href="#"
|
||||
href="javascript:;"
|
||||
>
|
||||
More actions
|
||||
<i
|
||||
@@ -8631,7 +8631,7 @@ exports[`renders ./components/table/demo/jsx.md correctly 1`] = `
|
||||
>
|
||||
<span>
|
||||
<a
|
||||
href="#"
|
||||
href="javascript:;"
|
||||
>
|
||||
Action 一
|
||||
</a>
|
||||
@@ -8639,7 +8639,7 @@ exports[`renders ./components/table/demo/jsx.md correctly 1`] = `
|
||||
class="ant-divider ant-divider-vertical"
|
||||
/>
|
||||
<a
|
||||
href="#"
|
||||
href="javascript:;"
|
||||
>
|
||||
Delete
|
||||
</a>
|
||||
@@ -8648,7 +8648,7 @@ exports[`renders ./components/table/demo/jsx.md correctly 1`] = `
|
||||
/>
|
||||
<a
|
||||
class="ant-dropdown-link"
|
||||
href="#"
|
||||
href="javascript:;"
|
||||
>
|
||||
More actions
|
||||
<i
|
||||
@@ -8841,7 +8841,7 @@ exports[`renders ./components/table/demo/nested-table.md correctly 1`] = `
|
||||
class=""
|
||||
>
|
||||
<a
|
||||
href="#"
|
||||
href="javascript:;"
|
||||
>
|
||||
Publish
|
||||
</a>
|
||||
@@ -8891,7 +8891,7 @@ exports[`renders ./components/table/demo/nested-table.md correctly 1`] = `
|
||||
class=""
|
||||
>
|
||||
<a
|
||||
href="#"
|
||||
href="javascript:;"
|
||||
>
|
||||
Publish
|
||||
</a>
|
||||
@@ -8941,7 +8941,7 @@ exports[`renders ./components/table/demo/nested-table.md correctly 1`] = `
|
||||
class=""
|
||||
>
|
||||
<a
|
||||
href="#"
|
||||
href="javascript:;"
|
||||
>
|
||||
Publish
|
||||
</a>
|
||||
@@ -9394,7 +9394,7 @@ exports[`renders ./components/table/demo/row-selection.md correctly 1`] = `
|
||||
style="padding-left:0px"
|
||||
/>
|
||||
<a
|
||||
href="#"
|
||||
href="javascript:;"
|
||||
>
|
||||
John Brown
|
||||
</a>
|
||||
@@ -9443,7 +9443,7 @@ exports[`renders ./components/table/demo/row-selection.md correctly 1`] = `
|
||||
style="padding-left:0px"
|
||||
/>
|
||||
<a
|
||||
href="#"
|
||||
href="javascript:;"
|
||||
>
|
||||
Jim Green
|
||||
</a>
|
||||
@@ -9492,7 +9492,7 @@ exports[`renders ./components/table/demo/row-selection.md correctly 1`] = `
|
||||
style="padding-left:0px"
|
||||
/>
|
||||
<a
|
||||
href="#"
|
||||
href="javascript:;"
|
||||
>
|
||||
Joe Black
|
||||
</a>
|
||||
@@ -9542,7 +9542,7 @@ exports[`renders ./components/table/demo/row-selection.md correctly 1`] = `
|
||||
style="padding-left:0px"
|
||||
/>
|
||||
<a
|
||||
href="#"
|
||||
href="javascript:;"
|
||||
>
|
||||
Disabled User
|
||||
</a>
|
||||
|
||||
@@ -20,7 +20,7 @@ const columns = [{
|
||||
title: 'Name',
|
||||
dataIndex: 'name',
|
||||
key: 'name',
|
||||
render: text => <a href="#">{text}</a>,
|
||||
render: text => <a href="javascript:;">{text}</a>,
|
||||
}, {
|
||||
title: 'Age',
|
||||
dataIndex: 'age',
|
||||
@@ -34,11 +34,11 @@ const columns = [{
|
||||
key: 'action',
|
||||
render: (text, record) => (
|
||||
<span>
|
||||
<a href="#">Action 一 {record.name}</a>
|
||||
<a href="javascript:;">Action 一 {record.name}</a>
|
||||
<Divider type="vertical" />
|
||||
<a href="#">Delete</a>
|
||||
<a href="javascript:;">Delete</a>
|
||||
<Divider type="vertical" />
|
||||
<a href="#" className="ant-dropdown-link">
|
||||
<a href="javascript:;" className="ant-dropdown-link">
|
||||
More actions <Icon type="down" />
|
||||
</a>
|
||||
</span>
|
||||
|
||||
@@ -19,7 +19,7 @@ import { Table } from 'antd';
|
||||
const columns = [{
|
||||
title: 'Name',
|
||||
dataIndex: 'name',
|
||||
render: text => <a href="#">{text}</a>,
|
||||
render: text => <a href="javascript:;">{text}</a>,
|
||||
}, {
|
||||
title: 'Cash Assets',
|
||||
className: 'column-money',
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user