mirror of
https://github.com/ant-design/ant-design.git
synced 2026-02-15 13:59:19 +08:00
Compare commits
920 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1a505e8fb0 | ||
|
|
9ab9e62308 | ||
|
|
819e55e968 | ||
|
|
22860b9e87 | ||
|
|
44da4049f6 | ||
|
|
9dc4102cdd | ||
|
|
47e3cedf86 | ||
|
|
3b6dc3f3c4 | ||
|
|
9b68ce020c | ||
|
|
e17c8e093e | ||
|
|
caec11c03a | ||
|
|
ca255cc547 | ||
|
|
4acadc47b5 | ||
|
|
d7eca4e151 | ||
|
|
a8cab96c13 | ||
|
|
4e726fdfd7 | ||
|
|
9f017bc5ae | ||
|
|
ccf507b603 | ||
|
|
f545e52ec5 | ||
|
|
8026020dd4 | ||
|
|
463a5db9ba | ||
|
|
10f6907da4 | ||
|
|
3118e2898e | ||
|
|
6c38ca62c6 | ||
|
|
14b44c880e | ||
|
|
8bff515287 | ||
|
|
fd40643c2d | ||
|
|
c30c156c56 | ||
|
|
f433382180 | ||
|
|
e672f41e1e | ||
|
|
29c262ab36 | ||
|
|
6ded879619 | ||
|
|
d8c1bdb3ab | ||
|
|
89a6aa96ed | ||
|
|
df1b1f5a47 | ||
|
|
dd22bae0fc | ||
|
|
1dc4e45bce | ||
|
|
8b1a4f80a9 | ||
|
|
91bbcd6f2c | ||
|
|
27b8e39666 | ||
|
|
7cfd9b2bcb | ||
|
|
c66062edb4 | ||
|
|
776beaee05 | ||
|
|
bdecb4ebd9 | ||
|
|
9ec8f66c4d | ||
|
|
c2e9abddc7 | ||
|
|
e8f61f11ef | ||
|
|
c419a1ddef | ||
|
|
81435e2798 | ||
|
|
49080aa01d | ||
|
|
17044043dc | ||
|
|
3d1914f45b | ||
|
|
5d7ef9d889 | ||
|
|
38b889f00c | ||
|
|
27e4f1b658 | ||
|
|
7c8e55f0db | ||
|
|
d21e500fab | ||
|
|
afce275d25 | ||
|
|
39993fc749 | ||
|
|
e165b8a705 | ||
|
|
635a0548de | ||
|
|
30abcdf992 | ||
|
|
0ffccf8b0f | ||
|
|
8904b50720 | ||
|
|
f46a87d3e0 | ||
|
|
5b6b36f5d6 | ||
|
|
58fd54e978 | ||
|
|
acd3a8f4d2 | ||
|
|
ed2303a5da | ||
|
|
b2aea45b4f | ||
|
|
bd19b0892c | ||
|
|
5a8bd0f6d8 | ||
|
|
f3c35941ec | ||
|
|
a3d4b753b9 | ||
|
|
fab83990c2 | ||
|
|
43d14f8517 | ||
|
|
644891f8f6 | ||
|
|
c5f56b9db3 | ||
|
|
b651579c1b | ||
|
|
95245c21a7 | ||
|
|
989b2e2041 | ||
|
|
30c437c83e | ||
|
|
429a9714d5 | ||
|
|
81e3429955 | ||
|
|
05fbdd0959 | ||
|
|
a4637526b9 | ||
|
|
11c0683baa | ||
|
|
eb663f0084 | ||
|
|
fdfb4ba843 | ||
|
|
ea2c113530 | ||
|
|
11a6cd51a2 | ||
|
|
5f938a6818 | ||
|
|
641f1ddeeb | ||
|
|
f36bc02ac3 | ||
|
|
6236641c74 | ||
|
|
250c7a9c68 | ||
|
|
9d2c91598b | ||
|
|
9df6e06d70 | ||
|
|
5ac468167d | ||
|
|
b36df9da2b | ||
|
|
6acf6fc643 | ||
|
|
2437ca419e | ||
|
|
eb62c44564 | ||
|
|
9e319990d2 | ||
|
|
ae87b663bf | ||
|
|
89ce2254af | ||
|
|
77d64971e5 | ||
|
|
461470ebc6 | ||
|
|
9b715f0b90 | ||
|
|
298a60f13b | ||
|
|
f321596e04 | ||
|
|
e57cf5ff80 | ||
|
|
aea18c3627 | ||
|
|
2a4adeef46 | ||
|
|
5bb45279bb | ||
|
|
9f484f9bf0 | ||
|
|
bb2c2036ba | ||
|
|
1cdf0d9141 | ||
|
|
eddd1db3e9 | ||
|
|
c2031f701c | ||
|
|
8369557322 | ||
|
|
33a71eb8fb | ||
|
|
a5b20dcb82 | ||
|
|
ed84626f01 | ||
|
|
aa3458deb6 | ||
|
|
b381f1f5ec | ||
|
|
643b32d0d3 | ||
|
|
d5b6cc70cd | ||
|
|
b475ac55f6 | ||
|
|
594dce8f87 | ||
|
|
ac95d1aea4 | ||
|
|
d490a027bb | ||
|
|
66a89df91f | ||
|
|
b216a44b28 | ||
|
|
37c8c4ed30 | ||
|
|
35fc427630 | ||
|
|
2feef3358c | ||
|
|
dbc4e684df | ||
|
|
e77108c775 | ||
|
|
fb8fec6d3a | ||
|
|
30745da52e | ||
|
|
a2eb54b1ae | ||
|
|
e1efb82dcb | ||
|
|
421feb1c84 | ||
|
|
fa1547df84 | ||
|
|
224e65fc27 | ||
|
|
1746e1f0d7 | ||
|
|
0a583afc5c | ||
|
|
072d860f8a | ||
|
|
ace985afce | ||
|
|
b8f6185abc | ||
|
|
c7d6ce5d3f | ||
|
|
bceed31da4 | ||
|
|
94283b730f | ||
|
|
16b2cc044e | ||
|
|
7d619dfbd7 | ||
|
|
121898001d | ||
|
|
e9a592a9c8 | ||
|
|
786f5cd7e0 | ||
|
|
696b4252a8 | ||
|
|
59193ef34a | ||
|
|
a73d0504ca | ||
|
|
9667ec17bd | ||
|
|
f48cf1df90 | ||
|
|
112aaed5fb | ||
|
|
8cc1943b77 | ||
|
|
cb1e0bfe8e | ||
|
|
6654a4220d | ||
|
|
8551b706cf | ||
|
|
ec2322a906 | ||
|
|
5510d12ce8 | ||
|
|
8271b5d069 | ||
|
|
c651c7a04f | ||
|
|
6cb3ae46a2 | ||
|
|
24e2af63f2 | ||
|
|
99a998afb5 | ||
|
|
319fa7c82d | ||
|
|
35229e55b1 | ||
|
|
156c933235 | ||
|
|
471da70c1e | ||
|
|
9423609243 | ||
|
|
07dfac18f7 | ||
|
|
7b56d7248f | ||
|
|
668cec2f9e | ||
|
|
1547b889b7 | ||
|
|
bac4d04844 | ||
|
|
ad3e49e397 | ||
|
|
882ae31199 | ||
|
|
6954c3506c | ||
|
|
a204c0afa2 | ||
|
|
bedfb180a8 | ||
|
|
81f16cb2e0 | ||
|
|
d8aef384d3 | ||
|
|
a3e723648b | ||
|
|
dc1d0af64e | ||
|
|
a0a1bff7fe | ||
|
|
843d82f6bd | ||
|
|
90c1dfc5c0 | ||
|
|
9547fe5bc4 | ||
|
|
81048aafb2 | ||
|
|
96dd7132e8 | ||
|
|
56b6fc38d7 | ||
|
|
3ceda311b6 | ||
|
|
7fed87f835 | ||
|
|
6c509f9712 | ||
|
|
c23afb05d0 | ||
|
|
fe09eec9aa | ||
|
|
2bedd6b0e6 | ||
|
|
a5733f5de3 | ||
|
|
3b6ea67115 | ||
|
|
fc8f533e67 | ||
|
|
a5b0848efe | ||
|
|
bc3a285e64 | ||
|
|
1e48ec0c6a | ||
|
|
eb21c93d3d | ||
|
|
62cbe9e064 | ||
|
|
65c86e60ce | ||
|
|
156ce90a8e | ||
|
|
a94e3ab3e0 | ||
|
|
6527f9cdb0 | ||
|
|
742999ff28 | ||
|
|
d84452e8b8 | ||
|
|
a7200c906c | ||
|
|
7e2d456453 | ||
|
|
53ffc83d23 | ||
|
|
ef8beaffde | ||
|
|
d9ef06496d | ||
|
|
e0699597ca | ||
|
|
21f375b7d7 | ||
|
|
83a02a6050 | ||
|
|
6dade37aec | ||
|
|
275bdaef1a | ||
|
|
c9b3a50519 | ||
|
|
3d322a7c04 | ||
|
|
0d26b4c972 | ||
|
|
35bc4726a9 | ||
|
|
d0d6e10894 | ||
|
|
c355eae6d1 | ||
|
|
61aac68028 | ||
|
|
44319bec11 | ||
|
|
ef43be1c67 | ||
|
|
f04f340fa1 | ||
|
|
fc884242d8 | ||
|
|
036aeb333d | ||
|
|
72f7232929 | ||
|
|
8bdad3d418 | ||
|
|
640fcc51e8 | ||
|
|
62b72d6c51 | ||
|
|
ac5bdc6983 | ||
|
|
2268418a97 | ||
|
|
a51a37cbd8 | ||
|
|
1fdce5db28 | ||
|
|
50bdbbda40 | ||
|
|
55f58cf59f | ||
|
|
789e45fd52 | ||
|
|
84e561b237 | ||
|
|
ac07dcefb0 | ||
|
|
d4171badfd | ||
|
|
ff7ba0fb6f | ||
|
|
fcb935b101 | ||
|
|
6624805ad4 | ||
|
|
5bf94956e4 | ||
|
|
7b1df54523 | ||
|
|
f56e1a7de7 | ||
|
|
145ed77c00 | ||
|
|
723da5e164 | ||
|
|
f089d1852d | ||
|
|
f77c38bddf | ||
|
|
7b8090d279 | ||
|
|
e00bfdc150 | ||
|
|
988e12f54b | ||
|
|
187e9dd85c | ||
|
|
b216597cfd | ||
|
|
d329d191dd | ||
|
|
a93cb09e15 | ||
|
|
e061ada71a | ||
|
|
9abce572a4 | ||
|
|
26d746bd8f | ||
|
|
f9273bc95a | ||
|
|
01d4acb7a9 | ||
|
|
fe3af14273 | ||
|
|
20ea524ef1 | ||
|
|
ea92bbf371 | ||
|
|
f61f811432 | ||
|
|
70e10dee59 | ||
|
|
7a5e11c799 | ||
|
|
e0bf1cefe7 | ||
|
|
1f652bfe4c | ||
|
|
bee3c43e7a | ||
|
|
ad6dbcb9c6 | ||
|
|
53640c3f18 | ||
|
|
33f37debd7 | ||
|
|
8e744545ff | ||
|
|
f0c6350e0e | ||
|
|
cf3c0aac43 | ||
|
|
d3ec477f8f | ||
|
|
8dfb44ba72 | ||
|
|
f46112d385 | ||
|
|
5443e79329 | ||
|
|
59b11f3b48 | ||
|
|
48f7d22929 | ||
|
|
1f6bcf963f | ||
|
|
749b6e7242 | ||
|
|
dc209c20f9 | ||
|
|
87c8c7ad67 | ||
|
|
7d8c7d72b7 | ||
|
|
57e3be2c32 | ||
|
|
4b38dbd669 | ||
|
|
293d63910a | ||
|
|
e92ef95f74 | ||
|
|
f6d349731c | ||
|
|
f58b1075ac | ||
|
|
32497c35fe | ||
|
|
754966991b | ||
|
|
1e80254059 | ||
|
|
7d49cc18a9 | ||
|
|
e633f91c27 | ||
|
|
258b3d170c | ||
|
|
d5d69d4063 | ||
|
|
47aa36fb06 | ||
|
|
1fb7bd7205 | ||
|
|
e30116f4bd | ||
|
|
9a7c369af6 | ||
|
|
11f9459738 | ||
|
|
1651015688 | ||
|
|
592653c2ad | ||
|
|
711703b91e | ||
|
|
c23c0a6b16 | ||
|
|
f689ede0fa | ||
|
|
30e4fa8a8d | ||
|
|
fdc8d357ef | ||
|
|
c79592cf05 | ||
|
|
af9dc73eef | ||
|
|
d6dde83247 | ||
|
|
d98d7a451c | ||
|
|
9f75694c75 | ||
|
|
9bcde59001 | ||
|
|
43751c9930 | ||
|
|
1f18c93d7f | ||
|
|
b69a6886d7 | ||
|
|
47c5de29f3 | ||
|
|
eb3c274e01 | ||
|
|
df934445c0 | ||
|
|
87bfe2df87 | ||
|
|
3001ca4114 | ||
|
|
02c5616250 | ||
|
|
807b573bff | ||
|
|
b687a32044 | ||
|
|
a329d3d39b | ||
|
|
8892d85e33 | ||
|
|
500b222556 | ||
|
|
d339e628ed | ||
|
|
a033e576fd | ||
|
|
02daedd67b | ||
|
|
53d279eb77 | ||
|
|
acf58de807 | ||
|
|
4c52ccaff9 | ||
|
|
4f73a23a10 | ||
|
|
29b5f433f8 | ||
|
|
5a33774238 | ||
|
|
ba0d2598fe | ||
|
|
e3b6430a4b | ||
|
|
3570458c31 | ||
|
|
a22a011c49 | ||
|
|
94d46e4c01 | ||
|
|
e4c5ab9c69 | ||
|
|
456cea652b | ||
|
|
3727ea2c33 | ||
|
|
a9430e6748 | ||
|
|
e8ef77b963 | ||
|
|
d21523ef8c | ||
|
|
75a6a562a0 | ||
|
|
40e94945d9 | ||
|
|
8016cccd18 | ||
|
|
fa0e90f577 | ||
|
|
528a7645ca | ||
|
|
a5a1458148 | ||
|
|
8f1dd9ccda | ||
|
|
ee176347ac | ||
|
|
f7b918add3 | ||
|
|
c712d072eb | ||
|
|
f2b987aaa9 | ||
|
|
f5ade936e1 | ||
|
|
c8eec8c56f | ||
|
|
18c6860296 | ||
|
|
e9b3c36866 | ||
|
|
1dd3e001c5 | ||
|
|
fdb943e887 | ||
|
|
1651682020 | ||
|
|
cb8f6a6ef5 | ||
|
|
2fdc4ec1e6 | ||
|
|
bcda84141e | ||
|
|
b3979885e4 | ||
|
|
9e54bebf33 | ||
|
|
4bfd076cb8 | ||
|
|
6a17efcbf1 | ||
|
|
da8c82a6e4 | ||
|
|
6e2ace3ba8 | ||
|
|
4880b6ec16 | ||
|
|
59e219e138 | ||
|
|
5da1403bc0 | ||
|
|
1856fbe0df | ||
|
|
bb195ee95f | ||
|
|
6748221ed3 | ||
|
|
0f63c7186e | ||
|
|
483491d0d8 | ||
|
|
981573037a | ||
|
|
a0026a5923 | ||
|
|
63c3c7c88f | ||
|
|
0a9a3887b5 | ||
|
|
50b9839bb3 | ||
|
|
8618a387da | ||
|
|
bb7c580e4b | ||
|
|
ecc18ef3a6 | ||
|
|
414d3d3a64 | ||
|
|
fb70e9d70b | ||
|
|
746990b84d | ||
|
|
4962d19462 | ||
|
|
0cf3600e25 | ||
|
|
0cdcdfba7b | ||
|
|
0eefa85b04 | ||
|
|
1a93536a26 | ||
|
|
f1110f2bc5 | ||
|
|
eb69e0a0f8 | ||
|
|
8e8c0b4db3 | ||
|
|
e8fc686dcf | ||
|
|
b5ad05bc06 | ||
|
|
a88f8fcc21 | ||
|
|
330e1f7a4b | ||
|
|
8f98ae80bd | ||
|
|
2fe4ac1a30 | ||
|
|
50466ed281 | ||
|
|
29d2a756b0 | ||
|
|
401519ec6f | ||
|
|
12bf17b166 | ||
|
|
3ae966f158 | ||
|
|
b2556b4cd5 | ||
|
|
35ae41f618 | ||
|
|
bef7db465e | ||
|
|
0b8b0d2deb | ||
|
|
551807cd91 | ||
|
|
a6037d66c0 | ||
|
|
859761eea7 | ||
|
|
541a992a56 | ||
|
|
d00871acdd | ||
|
|
58ec298ded | ||
|
|
99e4cd6aec | ||
|
|
b54a70bc8e | ||
|
|
6eff4bd02a | ||
|
|
d6a0b1bd3e | ||
|
|
ef339a32ac | ||
|
|
4d5eb5a92f | ||
|
|
69775dea68 | ||
|
|
fff756ff5f | ||
|
|
bcb82a518b | ||
|
|
c63c8b6c04 | ||
|
|
24f58c20e1 | ||
|
|
abb2763a66 | ||
|
|
7582ab7481 | ||
|
|
455ea58b10 | ||
|
|
e1a46cc419 | ||
|
|
90511c3261 | ||
|
|
8e496966cf | ||
|
|
dc8be3fcfd | ||
|
|
acc0c5a216 | ||
|
|
144c67f054 | ||
|
|
ad92793a47 | ||
|
|
d90e1b2a9e | ||
|
|
54eadefeca | ||
|
|
8e2d65298a | ||
|
|
e0ab15907f | ||
|
|
4f85be834c | ||
|
|
fa12a715e0 | ||
|
|
e93d24021f | ||
|
|
9e6bc99816 | ||
|
|
0c0fc38be6 | ||
|
|
f648edacdb | ||
|
|
2ba3a84331 | ||
|
|
547745271e | ||
|
|
d2aca99190 | ||
|
|
499ab69f65 | ||
|
|
199d9433d5 | ||
|
|
568963e894 | ||
|
|
5c2b03dbfc | ||
|
|
55d2511608 | ||
|
|
94e4ddb032 | ||
|
|
d28b8f3591 | ||
|
|
31c93e2dcc | ||
|
|
4513019abc | ||
|
|
5fb8cf85ef | ||
|
|
896e738fce | ||
|
|
e51a3a6da4 | ||
|
|
a5f7dd7192 | ||
|
|
c733f94c33 | ||
|
|
90959aab19 | ||
|
|
91400d54fa | ||
|
|
f505ebd188 | ||
|
|
42aaeb4f3d | ||
|
|
f2d4d0a9e4 | ||
|
|
0ad85e2987 | ||
|
|
1013339247 | ||
|
|
c2e7d18663 | ||
|
|
6f586ba243 | ||
|
|
a0dc7d3a72 | ||
|
|
983609c009 | ||
|
|
545d171223 | ||
|
|
98faa4378c | ||
|
|
3d71d980a7 | ||
|
|
8a9a8c972f | ||
|
|
119d498935 | ||
|
|
d19bfcbf74 | ||
|
|
8cfa61f46b | ||
|
|
6bdb84a011 | ||
|
|
639e60af45 | ||
|
|
72ac2c914f | ||
|
|
aa6afd81b5 | ||
|
|
edf8a4f239 | ||
|
|
e085b5d25c | ||
|
|
05473dcd0b | ||
|
|
fddc92f27d | ||
|
|
18bf973e94 | ||
|
|
3ccef11dec | ||
|
|
79afe8ef89 | ||
|
|
6fe6480bd5 | ||
|
|
8173007402 | ||
|
|
09c8addae1 | ||
|
|
b7a1665c97 | ||
|
|
255eac9079 | ||
|
|
7e522291c8 | ||
|
|
bd5daa939a | ||
|
|
bbfdc46aa2 | ||
|
|
02670cb174 | ||
|
|
c394145f41 | ||
|
|
4667a0f6d6 | ||
|
|
a7e37d614a | ||
|
|
b0909774c0 | ||
|
|
8a63b39e63 | ||
|
|
9a85303f79 | ||
|
|
b112948130 | ||
|
|
e6554e7edb | ||
|
|
f9f93c0c30 | ||
|
|
feed80c8db | ||
|
|
9980ce964c | ||
|
|
efcc28ed51 | ||
|
|
81b5d9890a | ||
|
|
e94b110a46 | ||
|
|
968c932778 | ||
|
|
5f27e46500 | ||
|
|
b45bf6d814 | ||
|
|
02fa2cd672 | ||
|
|
65a79b1ded | ||
|
|
35e74f825e | ||
|
|
ab41503343 | ||
|
|
f9193952ff | ||
|
|
9d39a55604 | ||
|
|
96722605fd | ||
|
|
2413c6af61 | ||
|
|
4960f711c3 | ||
|
|
44b3dad12f | ||
|
|
953b84f7d1 | ||
|
|
d04f9161db | ||
|
|
da1bfba781 | ||
|
|
3ca9be1bf6 | ||
|
|
6ffe39145d | ||
|
|
3ad49dd4cc | ||
|
|
c20e66f02b | ||
|
|
266e458a20 | ||
|
|
1b7da8f9c0 | ||
|
|
2b2e962738 | ||
|
|
91707b89d8 | ||
|
|
22e14970ec | ||
|
|
ac21152e10 | ||
|
|
277facc8e3 | ||
|
|
ca89227568 | ||
|
|
81a8d71ec3 | ||
|
|
39207efa4d | ||
|
|
46ffda9c93 | ||
|
|
43bf6c4846 | ||
|
|
19fa96754d | ||
|
|
f6a1eca7e0 | ||
|
|
9c7cec3e39 | ||
|
|
27a17428de | ||
|
|
a481134cea | ||
|
|
81a010e0ae | ||
|
|
b4916d45d3 | ||
|
|
c112abd137 | ||
|
|
ab4e676b2a | ||
|
|
4419d4c94c | ||
|
|
01bbd5a3d3 | ||
|
|
0bb73534b2 | ||
|
|
032d3bea12 | ||
|
|
e7013fcb3f | ||
|
|
3fb21c0325 | ||
|
|
384803528f | ||
|
|
6c5a11a363 | ||
|
|
516ce2d821 | ||
|
|
60f9ba5b33 | ||
|
|
9eee9f5dcd | ||
|
|
69b5acb45f | ||
|
|
fda881cc7a | ||
|
|
7fcfa13c24 | ||
|
|
b653a2c055 | ||
|
|
631ca1cea2 | ||
|
|
6bc57e450c | ||
|
|
f2268c2877 | ||
|
|
8945bb5da6 | ||
|
|
ed070c94ad | ||
|
|
9ebaeb6f4f | ||
|
|
66a731b4c2 | ||
|
|
7cb5d68211 | ||
|
|
a4648fd67f | ||
|
|
c67d9b2935 | ||
|
|
2cb0649ea0 | ||
|
|
6d06f2f4b4 | ||
|
|
daae971f83 | ||
|
|
625673486e | ||
|
|
25a60322e5 | ||
|
|
883f82172e | ||
|
|
36d24a5a40 | ||
|
|
ad4b49f843 | ||
|
|
e1e0b97e57 | ||
|
|
0e22ae62bb | ||
|
|
48ec77222f | ||
|
|
bc7e0bad3e | ||
|
|
2e2d891647 | ||
|
|
5ad194143f | ||
|
|
d00d631ef2 | ||
|
|
87932504b4 | ||
|
|
340cbda2d7 | ||
|
|
43bb22613b | ||
|
|
79b20a24a2 | ||
|
|
c825f0108e | ||
|
|
7ba016218c | ||
|
|
4477726412 | ||
|
|
fe33e76479 | ||
|
|
ba168b826f | ||
|
|
5aebf27ff1 | ||
|
|
eccaeaea0e | ||
|
|
c7be13b20e | ||
|
|
dbdd5d5126 | ||
|
|
963560d33b | ||
|
|
b6011d7a39 | ||
|
|
2659b35382 | ||
|
|
8119292e6c | ||
|
|
50e37796b8 | ||
|
|
0b67dc4e12 | ||
|
|
7d3bc4ebd4 | ||
|
|
82afb368c0 | ||
|
|
89a37da77f | ||
|
|
97fbb20fa8 | ||
|
|
2eb3d55743 | ||
|
|
6e145bfad3 | ||
|
|
115749e06f | ||
|
|
63daf8d0a3 | ||
|
|
9dcc28e218 | ||
|
|
1f69de8da4 | ||
|
|
dc9d4ae795 | ||
|
|
0ce61df3da | ||
|
|
bb9957ff45 | ||
|
|
4f0b3cad2a | ||
|
|
112231469f | ||
|
|
1f9b4a7981 | ||
|
|
ce0fe06c8a | ||
|
|
6bbbeb4a03 | ||
|
|
777e4adeb0 | ||
|
|
950c321b25 | ||
|
|
9429aedffc | ||
|
|
974f544713 | ||
|
|
c79557b810 | ||
|
|
76e848dc4b | ||
|
|
8e9a2eae38 | ||
|
|
a4a26797ec | ||
|
|
00932da89b | ||
|
|
1a11d7849f | ||
|
|
4d002055b5 | ||
|
|
e560cb26c3 | ||
|
|
1920d9af46 | ||
|
|
e188036606 | ||
|
|
48e75e0436 | ||
|
|
9131a79377 | ||
|
|
60373cc363 | ||
|
|
dbd6f29c29 | ||
|
|
726541ae08 | ||
|
|
3816778b6b | ||
|
|
6e583325ea | ||
|
|
0efd941346 | ||
|
|
fe564335bf | ||
|
|
48b63734c6 | ||
|
|
65adb9984e | ||
|
|
78c12a03fd | ||
|
|
e977f2435e | ||
|
|
e24a8cb5d8 | ||
|
|
bedadb6b3c | ||
|
|
a65ff1c2df | ||
|
|
5964e42a9b | ||
|
|
0c11dbb535 | ||
|
|
d0bbfd3d2d | ||
|
|
9f78e71c65 | ||
|
|
7dafa985c5 | ||
|
|
890cca119b | ||
|
|
e03670f55a | ||
|
|
111a1b100a | ||
|
|
f512baeb71 | ||
|
|
5d8a3f6f66 | ||
|
|
c7bbd0735a | ||
|
|
41b79d9c96 | ||
|
|
7be75f59fd | ||
|
|
a4bf6cd90b | ||
|
|
c7c3625899 | ||
|
|
7151a4e720 | ||
|
|
2ba8e6fec6 | ||
|
|
3ce1680ab7 | ||
|
|
24364e5bf9 | ||
|
|
7ff0573046 | ||
|
|
94b04a81fb | ||
|
|
aaf2a508be | ||
|
|
5f9b000593 | ||
|
|
0ed75caeac | ||
|
|
0e18c52b96 | ||
|
|
c832975663 | ||
|
|
4212103c91 | ||
|
|
e2a99f53f7 | ||
|
|
2382250d82 | ||
|
|
78e39a5520 | ||
|
|
5ede112633 | ||
|
|
39cc78685d | ||
|
|
3c700cd1b7 | ||
|
|
3a2f6bea18 | ||
|
|
fa88477886 | ||
|
|
12c6a73878 | ||
|
|
b4c70d2913 | ||
|
|
3afa6faa36 | ||
|
|
c61bba1020 | ||
|
|
48709cd583 | ||
|
|
82d1957941 | ||
|
|
644e23fac6 | ||
|
|
02f4e5794c | ||
|
|
c40bdb9c77 | ||
|
|
dd6d643519 | ||
|
|
dde8df5612 | ||
|
|
9969a3b598 | ||
|
|
88ee7b3e8e | ||
|
|
55d6d420bf | ||
|
|
1debb624f3 | ||
|
|
e585103d4d | ||
|
|
9ed60b3fda | ||
|
|
cfccd84f62 | ||
|
|
eeeafef4bb | ||
|
|
e34639a0a8 | ||
|
|
fbe59e29a3 | ||
|
|
7df095414c | ||
|
|
51f84e82e2 | ||
|
|
d4fd348114 | ||
|
|
a5cc8b33e3 | ||
|
|
e62fa2a403 | ||
|
|
d7a29f682b | ||
|
|
42d279b691 | ||
|
|
1f3b9e4ee2 | ||
|
|
a644510677 | ||
|
|
7e2828d4a4 | ||
|
|
c140daabc5 | ||
|
|
9cf1d72e3e | ||
|
|
81be11534c | ||
|
|
64466a79cb | ||
|
|
7889832280 | ||
|
|
3b49abb104 | ||
|
|
e13ffac490 | ||
|
|
22b3a3979a | ||
|
|
61d67f4563 | ||
|
|
c90e0b3667 | ||
|
|
51655e2e7c | ||
|
|
3512dff758 | ||
|
|
2cfa7eb978 | ||
|
|
c0b6f652cc | ||
|
|
9be44edf26 | ||
|
|
847153d998 | ||
|
|
baa8e23280 | ||
|
|
0bea0f6482 | ||
|
|
3202d28cb9 | ||
|
|
28c7545030 | ||
|
|
cd2ab56a16 | ||
|
|
d5a4c93e7a | ||
|
|
f88139396d | ||
|
|
4f874c5065 | ||
|
|
cccd61114d | ||
|
|
602cf0a309 | ||
|
|
4f5f12d81e | ||
|
|
e81ac57382 | ||
|
|
25a6fe0287 | ||
|
|
254c4c40b6 | ||
|
|
ace361e3ab | ||
|
|
1d63de1106 | ||
|
|
2255275daa | ||
|
|
97fb038dde | ||
|
|
053521be39 | ||
|
|
de030a0333 | ||
|
|
e6ad9daff8 | ||
|
|
8749438aed | ||
|
|
153fb0fc34 | ||
|
|
7667225b0f | ||
|
|
c30d1b191f | ||
|
|
bac9cee1d8 | ||
|
|
4ee2194b45 | ||
|
|
109afc53ef | ||
|
|
ef79554bd1 | ||
|
|
9b025806b8 | ||
|
|
1c736c38b3 | ||
|
|
448a3ff4dd | ||
|
|
d9c0d10e43 | ||
|
|
015dab8cca | ||
|
|
1b79b74bea | ||
|
|
7b916da2ae | ||
|
|
23df258f50 | ||
|
|
b0040bfc37 | ||
|
|
d7837da175 | ||
|
|
1682d2cd14 | ||
|
|
eb901c4bc6 | ||
|
|
426a35c248 | ||
|
|
b991137628 | ||
|
|
41f157e596 | ||
|
|
14de57c32e | ||
|
|
2e313ef8f0 | ||
|
|
5e55383796 | ||
|
|
df6f75b343 | ||
|
|
505cc23a74 | ||
|
|
8c632ef2cf | ||
|
|
975b25f9d5 | ||
|
|
f51d48fb33 | ||
|
|
920b32e94c | ||
|
|
ea616e4deb | ||
|
|
268336a651 | ||
|
|
6790e80f3e | ||
|
|
45f5d6cdfe | ||
|
|
cc5f2edde1 | ||
|
|
670a4d09a1 | ||
|
|
d086ee253e | ||
|
|
0a1c0712a2 | ||
|
|
dc314983b9 | ||
|
|
bd2ad34300 | ||
|
|
920adb9a8a | ||
|
|
5e84b79996 | ||
|
|
9193c05102 | ||
|
|
8e8f19e2b5 | ||
|
|
6d74ea346f | ||
|
|
c209c45660 | ||
|
|
f40be3d7ac | ||
|
|
e01c8c8ff6 | ||
|
|
ef54b60add | ||
|
|
f36c6933af | ||
|
|
e2be361cd0 | ||
|
|
9bb7ec0b87 | ||
|
|
becb888f6e | ||
|
|
b0aef6cad5 | ||
|
|
e6ef5b5707 | ||
|
|
fd7ef2407c | ||
|
|
dd60cf8ca2 | ||
|
|
45dee9e504 | ||
|
|
e43c8012ad | ||
|
|
4e75347d35 | ||
|
|
d629086c74 | ||
|
|
f4312895d6 | ||
|
|
cf8aa16761 | ||
|
|
0080b6ddf5 | ||
|
|
47d43e579f | ||
|
|
f03e5549bf | ||
|
|
47c58fb0b2 | ||
|
|
fd625ef1a0 | ||
|
|
af89c14e4a | ||
|
|
35095fc776 | ||
|
|
a4a6db76de | ||
|
|
b57047c919 | ||
|
|
4417dcf300 | ||
|
|
52833f50f5 | ||
|
|
ba65f9429e | ||
|
|
03adcefafd | ||
|
|
fa235b7876 | ||
|
|
709c750c2b | ||
|
|
85d8137506 | ||
|
|
deebe4d973 | ||
|
|
2cde334cd5 | ||
|
|
14844eb0e0 | ||
|
|
c3159a11e2 | ||
|
|
62f4e44ac6 | ||
|
|
cc71ab957e | ||
|
|
0d5fc18db7 | ||
|
|
2202648d6e | ||
|
|
f5247aba61 | ||
|
|
1b607baddc | ||
|
|
d7ac759a22 | ||
|
|
eb25e96565 | ||
|
|
b8118bb09c | ||
|
|
81d609c41a | ||
|
|
addc0ca521 | ||
|
|
1abbc1c31b | ||
|
|
720a3d30b4 | ||
|
|
03504446b5 | ||
|
|
99048fa9bf | ||
|
|
0e5431d21b | ||
|
|
551b17203c | ||
|
|
c50e02dcbf | ||
|
|
acdc563a54 | ||
|
|
4d645a256f | ||
|
|
f28c328442 | ||
|
|
55fc44aba4 | ||
|
|
54c6b63e9f | ||
|
|
67c38fa3b4 | ||
|
|
977a5a1cc7 | ||
|
|
d6da30573b | ||
|
|
5ef4828974 | ||
|
|
5b4adeb339 | ||
|
|
f414398fae | ||
|
|
b83529daf2 | ||
|
|
97c75d4ea8 | ||
|
|
03fc4f57be | ||
|
|
61e680875c | ||
|
|
861c5b33d1 | ||
|
|
584102d085 | ||
|
|
3f7802bce6 | ||
|
|
863b777361 | ||
|
|
581040fc5d |
12
.babelrc
12
.babelrc
@@ -1,6 +1,10 @@
|
||||
{
|
||||
"presets": ["es2015", "react", "stage-0"],
|
||||
"plugins": [
|
||||
"add-module-exports"
|
||||
]
|
||||
"env": {
|
||||
"test": {
|
||||
"presets": ["es2015", "react", "stage-0"],
|
||||
"plugins": [
|
||||
"add-module-exports"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
components/**/*.js
|
||||
components/**/*.jsx
|
||||
components/*/__tests__/type.tsx
|
||||
!.eslintrc.js
|
||||
!components/*/__tests__/*
|
||||
!components/*/__tests__/**/*.js
|
||||
!components/*/demo/*
|
||||
|
||||
21
.github/PULL_REQUEST_TEMPLATE.md
vendored
21
.github/PULL_REQUEST_TEMPLATE.md
vendored
@@ -1,9 +1,22 @@
|
||||
First of all, thanks for your contribution! :-)
|
||||
First of all, thank you for your contribution! :-)
|
||||
|
||||
Please makes sure these boxes are checked before submitting your PR, thank you!
|
||||
Please makes sure that these checkboxes are checked before submitting your PR, thank you!
|
||||
|
||||
* [ ] Make sure you propose PR to correct branch: bugfix for `master`, feature for latest active branch `feature-x.x`.
|
||||
* [ ] Make sure you follow antd's [code convention](https://github.com/ant-design/ant-design/wiki/Code-convention-for-antd).
|
||||
* [ ] Make sure that you propose PR to right branch: bugfix for `master`, feature for latest active branch `feature-x.x`.
|
||||
* [ ] Make sure that you follow antd's [code convention](https://github.com/ant-design/ant-design/wiki/Code-convention-for-antd).
|
||||
* [ ] Run `npm run lint` and fix those errors before submitting in order to keep consistent code style.
|
||||
* [ ] Rebase before creating a PR to keep commit history clear.
|
||||
* [ ] Add some descriptions and refer relative issues for you PR.
|
||||
|
||||
Extra checklist:
|
||||
|
||||
**if** *isBugFix* **:**
|
||||
|
||||
* [ ] Make sure that you add at least one unit test for the bug which you had fixed.
|
||||
|
||||
**elif** *isNewFeature* **:**
|
||||
|
||||
* [ ] Update API docs for the component.
|
||||
* [ ] Update/Add demo to demonstrate new feature.
|
||||
* [ ] Update TypeScript definition for the component.
|
||||
* [ ] Add unit tests for the feature.
|
||||
|
||||
2
.gitignore
vendored
2
.gitignore
vendored
@@ -26,6 +26,7 @@ _site
|
||||
_data
|
||||
dist
|
||||
/lib
|
||||
/es
|
||||
elasticsearch-*
|
||||
config/base.yaml
|
||||
/.vscode/
|
||||
@@ -35,3 +36,4 @@ components/**/*.js
|
||||
components/**/*.jsx
|
||||
!components/**/__tests__/*.js
|
||||
!components/**/__tests__/*.js.snap
|
||||
/.history
|
||||
|
||||
45
.jest.js
Normal file
45
.jest.js
Normal file
@@ -0,0 +1,45 @@
|
||||
const libDir = process.env.LIB_DIR;
|
||||
|
||||
const transformIgnorePatterns = [
|
||||
'/dist/',
|
||||
'node_modules\/[^/]+?\/(?!(es|node_modules)\/)', // Ignore modules without es dir
|
||||
];
|
||||
|
||||
module.exports = {
|
||||
setupFiles: [
|
||||
'./tests/setup.js',
|
||||
],
|
||||
moduleFileExtensions: [
|
||||
'ts',
|
||||
'tsx',
|
||||
'js',
|
||||
'jsx',
|
||||
'json',
|
||||
'md',
|
||||
],
|
||||
modulePathIgnorePatterns: [
|
||||
'/_site/',
|
||||
],
|
||||
testPathIgnorePatterns: [
|
||||
'/node_modules/',
|
||||
'dekko',
|
||||
'node',
|
||||
],
|
||||
transform: {
|
||||
'\\.tsx?$': './node_modules/antd-tools/lib/jest/codePreprocessor',
|
||||
'\\.js$': './node_modules/antd-tools/lib/jest/codePreprocessor',
|
||||
'\\.md$': './node_modules/antd-tools/lib/jest/demoPreprocessor',
|
||||
},
|
||||
testRegex: libDir === 'dist' ? 'demo\\.test\\.js$' : '.*\\.test\\.js$',
|
||||
collectCoverageFrom: [
|
||||
'components/**/*.{ts,tsx}',
|
||||
'!components/*/style/index.tsx',
|
||||
'!components/style/index.tsx',
|
||||
'!components/*/locale/index.tsx',
|
||||
'!components/*/__tests__/**/type.tsx',
|
||||
],
|
||||
transformIgnorePatterns,
|
||||
snapshotSerializers: [
|
||||
'enzyme-to-json/serializer',
|
||||
],
|
||||
};
|
||||
21
.jest.node.js
Normal file
21
.jest.node.js
Normal file
@@ -0,0 +1,21 @@
|
||||
module.exports = {
|
||||
setupFiles: [
|
||||
'./tests/setup.js',
|
||||
],
|
||||
moduleFileExtensions: [
|
||||
'ts',
|
||||
'tsx',
|
||||
'js',
|
||||
'md',
|
||||
],
|
||||
transform: {
|
||||
'\\.tsx?$': './node_modules/antd-tools/lib/jest/codePreprocessor',
|
||||
'\\.js$': './node_modules/antd-tools/lib/jest/codePreprocessor',
|
||||
'\\.md$': './node_modules/antd-tools/lib/jest/demoPreprocessor',
|
||||
},
|
||||
testRegex: 'demo\\.test\\.js$',
|
||||
testEnvironment: 'node',
|
||||
snapshotSerializers: [
|
||||
'enzyme-to-json/serializer'
|
||||
],
|
||||
};
|
||||
@@ -1,19 +0,0 @@
|
||||
{
|
||||
"setupFiles": [
|
||||
"./tests/setup.js"
|
||||
],
|
||||
"moduleFileExtensions": [
|
||||
"ts",
|
||||
"tsx",
|
||||
"js",
|
||||
"md"
|
||||
],
|
||||
"transform": {
|
||||
"\\.tsx?$": "./node_modules/typescript-babel-jest",
|
||||
"\\.js$": "./node_modules/babel-jest",
|
||||
"\\.md$": "./node_modules/antd-demo-jest"
|
||||
},
|
||||
"testRegex": "demo\\.test\\.js$",
|
||||
"testEnvironment": "node",
|
||||
"snapshotSerializers": ["enzyme-to-json/serializer"]
|
||||
}
|
||||
@@ -1,10 +1,7 @@
|
||||
{
|
||||
"extends": "stylelint-config-standard",
|
||||
"rules": {
|
||||
"at-rule-empty-line-before": null,
|
||||
"at-rule-name-space-after": null,
|
||||
"comment-empty-line-before": null,
|
||||
"declaration-bang-space-before": null,
|
||||
"declaration-empty-line-before": null,
|
||||
"function-comma-newline-after": null,
|
||||
"function-name-case": null,
|
||||
|
||||
10
.travis.yml
10
.travis.yml
@@ -19,14 +19,18 @@ script:
|
||||
npm run lint
|
||||
elif [ "$TEST_TYPE" = dist ]; then
|
||||
npm run dist && \
|
||||
node ./tests/dekko/dist.test.js
|
||||
node ./tests/dekko/dist.test.js && \
|
||||
LIB_DIR=dist npm test -- --coverage -w 2
|
||||
elif [ "$TEST_TYPE" = compile ]; then
|
||||
npm run dist && \
|
||||
npm run compile && \
|
||||
node ./tests/dekko/lib.test.js
|
||||
node ./tests/dekko/lib.test.js && \
|
||||
LIB_DIR=es npm test -- --coverage -w 2 && \
|
||||
LIB_DIR=lib npm test -- --coverage -w 2
|
||||
elif [ "$TEST_TYPE" = test:dom ]; then
|
||||
npm run dist && \
|
||||
npm test -- --coverage -w 2 && \
|
||||
bash <(curl -s https://codecov.io/bash)
|
||||
elif [ "$TEST_TYPE" = test:node ]; then
|
||||
npm test -- --config .jest.node.json -w 2
|
||||
npm run test-node -- -w 2
|
||||
fi
|
||||
|
||||
163
AUTHORS.txt
163
AUTHORS.txt
@@ -1,110 +1,249 @@
|
||||
Aaron Planell López <aaronplanell@gmail.com>
|
||||
Adrian Dimitrov <dimitrov.adrian@gmail.com>
|
||||
Albert Zheng <lisong.zheng@gmail.com>
|
||||
Albert 理斯特 <shuaizhexu@gmail.com>
|
||||
Alexander <labriko@yandex.ru>
|
||||
Alexandre Kirszenberg <a.kirszenberg@gmail.com>
|
||||
Anas Tawfeek <anas.tawfeek@outlook.com>
|
||||
Andrew Murray <radarhere@gmail.com>
|
||||
Andrey G <plandem@gmail.com>
|
||||
Arthur Denner Oliveira Santos <arthurdenner7@gmail.com>
|
||||
BK Heleth <bon.hoo@hotmail.com>
|
||||
Babajide Fowotade <jide.b.tade@gmail.com>
|
||||
Benjamin Kniffler <bkniffler@me.com>
|
||||
Benjy Cui <benjytrys@gmail.com>
|
||||
Bernie <bernie.wangbj@gmail.com>
|
||||
Bill Sheikh <bilawals22@gmail.com>
|
||||
Bo Chen <bochen2014@yahoo.com>
|
||||
Bozhao <yubz86@gmail.com>
|
||||
Brett Lamy <bel423@me.com>
|
||||
Brook Shi <iwxiaot@gmail.com>
|
||||
Bruce Mitchener <bruce.mitchener@gmail.com>
|
||||
Bruno Maia <bruno.mm.maia@gmail.com>
|
||||
C <4019980@qq.com>
|
||||
Cam Song <neosoyn@gmail.com>
|
||||
Catalin Miron <mironcatalin@gmail.com>
|
||||
Cee Cirno <i@cee.moe>
|
||||
Chikara Chan <chenhongtu@51xianqu.net>
|
||||
Chris Kelly <cjke.7777@gmail.com>
|
||||
ChrisFan <chris.fan.dev@gmail.com>
|
||||
Cody Chan <int64ago@gmail.com>
|
||||
Colton Pierson <colton@coltonpierson.com>
|
||||
Conway Anderson <hello@conwayanderson.com>
|
||||
Cordaro <elvis07@163.com>
|
||||
D & R <jdz321@qq.com>
|
||||
Damian Green <damian.green@microlease.com>
|
||||
Danny Hoower Antonio Viasus Avila <danjavia@gmail.com>
|
||||
Daqi Song <dqaria@gmail.com>
|
||||
Darren Poon <dyhpoon@gmail.com>
|
||||
DengYun <tdzl2003@gmail.com>
|
||||
Dorian <dorian@doma.io>
|
||||
Edd Hannay <accounts@edd.fm>
|
||||
Eddie Xie <oeddyo@gmail.com>
|
||||
Eden Wang <yociduo@vip.qq.com>
|
||||
Egor Yurtaev <yurtaev.egor@gmail.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>
|
||||
Graeme Yeates <gyeates@clearpath.ai>
|
||||
Graeme Yeates <yeatesgraeme@gmail.com>
|
||||
Gray Choi <gray.choi.1988@gmail.com>
|
||||
Guan Hao <raptium@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>
|
||||
Hubert Argasinski <argasinski.hubert@gmail.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>
|
||||
Ivo Stratev <ivo.stratev.tues@gmail.com>
|
||||
James <james@schoolshape.com>
|
||||
Jerry Bendy <jerry@icewingcc.com>
|
||||
Jesper We <jesper@journeyman.se>
|
||||
Jialei <jialeicui@126.com>
|
||||
Jieraaa <842533841@qq.com>
|
||||
Joe <qiaolibo@126.com>
|
||||
Joe Hsu <jhsu.x1@gmail.com>
|
||||
Jonatas Walker <jonataswalker@gmail.com>
|
||||
Jordan Hornblow <jordan@jch254.com>
|
||||
Junyu Zhan <irrigator@yeah.net>
|
||||
Kenaniah Cerny <kenaniah@gmail.com>
|
||||
Kenneth Truong <kenneth.e.truong@gmail.com>
|
||||
Kevin Ivan <info@kevinivan.com>
|
||||
KgTong <kgtong1992@gmail.com>
|
||||
Kimmo Saari <kimmo.saari@revolt.fi>
|
||||
Knacktus <knacktus@gmail.com>
|
||||
Kyle Rosenberg <kyle.rosenberg@gmail.com>
|
||||
Larry Laski <larry.laski@gmail.com>
|
||||
LeeHarlan <709886167@qq.com>
|
||||
Leo <clinyong@gmail.com>
|
||||
Leon Shi <superRaytin@163.com>
|
||||
Leon Shi <superRaytin@gmail.com>
|
||||
Liu Yang <zation1@gmail.com>
|
||||
LongYinan <lynweklm@gmail.com>
|
||||
MG12 <wuzhao.mail@gmail.com>
|
||||
Ma Tianxiao <matx2215@outlook.com>
|
||||
Madis Väin <madisvain@gmail.com>
|
||||
Manjit Kumar <manjit1727@gmail.com>
|
||||
Marius Ileana <visvadw@gmail.com>
|
||||
Marshall Chen <Juniors.fei@gmail.com>
|
||||
Martin Litvaj <kamahl19@gmail.com>
|
||||
Martin Novák <martinnovak@outlook.com>
|
||||
Meck <yesmeck@gmail.com>
|
||||
MeiLin <postget.me@gmail.com>
|
||||
Min <dicklwm@163.com>
|
||||
Minqi Pan <pmq2001@gmail.com>
|
||||
Minsung Ryu <ryums0227@gmail.com>
|
||||
Mitchell Demler <mitchell.demler@harcourts.net>
|
||||
Mr.Tone <vector@malubei.com>
|
||||
Nathan Tavares Nascimento <nathan.tnascimento@gmail.com>
|
||||
Nathan Wells <nwwells@gmail.com>
|
||||
Neverland <chenjiahan@buaa.edu.cn>
|
||||
Nico <nicolas@freddelacompta.com>
|
||||
Nimo <nimo.jser@gmail.com>
|
||||
Nishant Arora <na.nishantarora@gmail.com>
|
||||
OAwan <georgio.wan@gmail.com>
|
||||
Panjie Setiawan Wicaksono <panjie@panjiesw.com>
|
||||
Patrick Gidich <patrick.gidich@simnova.com>
|
||||
Patryk <longer44@gmail.com>
|
||||
Peter Berg <atticusberg@gmail.com>
|
||||
Pierre <pierre@bazoge.com>
|
||||
Piper Chester <piperchester@gmail.com>
|
||||
Pixy Yuan <pixy.bupt@gmail.com>
|
||||
Pyiner <lijiuyang1992@gmail.com>
|
||||
Qiaosen Huang <joesonw@gmail.com>
|
||||
Qingrong Ke <keqingrong1992@gmail.com>
|
||||
Rafael Cosman <rafaelcosman@alumni.stanford.edu>
|
||||
RaoHai <surgesoft@gmail.com>
|
||||
Rex <zhangzilong.zzl@163.com>
|
||||
Richard D. Worth <rdworth@gmail.com>
|
||||
Robert Wilkinson <wilkinson.robert.a@gmail.com>
|
||||
Rrrandom <emanonhere@gmail.com>
|
||||
Sakol Assawasagool <koobitor@gmail.com>
|
||||
Sanjay Kumar <sk@tectusdreamlab.com>
|
||||
Sean Lin <sean@ejoy.com>
|
||||
Sean Sun <pinggodstudio@gmail.com>
|
||||
Sebastian Blade <blade254353074@hotmail.com>
|
||||
Sergio Crisostomo <sergiosbox@gmail.com>
|
||||
Shawn Sit <xueqingxiao@gmail.com>
|
||||
ShiTengFei <shitengfei@goyoo.com>
|
||||
SimaQ <sima.zhang1990@gmail.com>
|
||||
Tao Zhang <windse7en@gmail.com>
|
||||
The Rock <zhoguoxin@126.com>
|
||||
Tino D <ginodeis@gmail.com>
|
||||
Tyler <chaotyler@gmail.com>
|
||||
Vadim Macagon <vadim.macagon@gmail.com>
|
||||
Valentin Vichnal <valentin@vichnal.com>
|
||||
Vemund Santi <veund@santi.no>
|
||||
Vincent Zhang <vxzhong@qq.com>
|
||||
Walter Barbagallo <turbometalskater@gmail.com>
|
||||
Warren Seymour <warren@fountainhead.tech>
|
||||
Wei Zhu <yesmeck@gmail.com>
|
||||
Will Chen <willchen90@gmail.com>
|
||||
Xie Guanglei <xieguanglei@hotmail.com>
|
||||
Yiming <ymjrcc@qq.com>
|
||||
Yogesh <yogeshkumar180592@gmail.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>
|
||||
afc163 <afc163@gmail.com>
|
||||
ashishg-qburst <ashishg@qburst.com>
|
||||
bang <sqibang@gmail.com>
|
||||
bang88 <sqibang@gmail.com>
|
||||
blankzust <450811238@qq.com>
|
||||
caoyi <caoyi0905@mail.hfut.edu.cn>
|
||||
cathayandy <wzm_andy@126.com>
|
||||
chchen <cc272309126@gmail.com>
|
||||
chencheng (云谦) <sorrycc@gmail.com>
|
||||
clinyong <clinyong@gmail.com>
|
||||
corneyl <cornieljoosse@gmail.com>
|
||||
ddcat1115 <ddcat1115@gmail.com>
|
||||
denzw <denzw@21cn.com>
|
||||
detailyang <detailyang@gmail.com>
|
||||
devqin <devqin@gmail.com>
|
||||
djorkaeff <djorkae55@gmail.com>
|
||||
duzliang <duzliang@gmail.com>
|
||||
ecofe <150641329@qq.com>
|
||||
edgji <j.edgji@gmail.com>
|
||||
elios <elios264@hotmail.com>
|
||||
elrrrrrrr <elrrrrrrr@gmail.com>
|
||||
ezpub <ez.foro@gmail.com>
|
||||
feng zhi hao <fzhihao@outlook.com>
|
||||
fengmk2 <m@fengmk2.com>
|
||||
flashback313 <windmark2012@gmail.com>
|
||||
genie <genie88@163.com>
|
||||
handycode <lihandi@gmail.com>
|
||||
hansnow <hansnow2012@gmail.com>
|
||||
haoxin <coderhaoxin@outlook.com>
|
||||
hardfist <yangjianzju@gmail.com>
|
||||
hi-caicai <hi@cai-cai.me>
|
||||
iamcastelli <sowed@cyberdude.com>
|
||||
ioldfish <fish.wangl@gmail.com>
|
||||
jasonslyvia <jasonslyvia@gmail.com>
|
||||
jiang <155259966@qq.com>
|
||||
jinouwuque <ee2win@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>
|
||||
keng <keng@renderinghouse.com>
|
||||
ko <git@yaksok.net>
|
||||
kossel <lis.yichao@gmail.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>
|
||||
liekkas <zjq0717@163.com>
|
||||
lixiaochou077 <qi.liqi07@gmail.com>
|
||||
lixiaoyang <lixiaoyang2345@gmail.com>
|
||||
lizhaocai <lzc09008@gmail.com>
|
||||
loganpowell <loganp@tepper.cmu.edu>
|
||||
mArker <252133226@qq.com>
|
||||
mitchell.demler <mitchell.demler@harcourts.net>
|
||||
muzuiget <muzuiget@gmail.com>
|
||||
natergj <nater_nater@me.com>
|
||||
paranoidjk <hust2012jiangkai@gmail.com>
|
||||
parlop <parlop@gmail.com>
|
||||
pd4d10 <pd4d10@gmail.com>
|
||||
peiming <hyrijk@gmail.com>
|
||||
pinggod <pinggodstudio@gmail.com>
|
||||
pizn <pizner@gmail.com>
|
||||
plandem <plandem@gmail.com>
|
||||
popomore <sakura9515@gmail.com>
|
||||
qubaoming <qubaoming@didichuxing.com>
|
||||
ryangun <ryangun@foxmail.com>
|
||||
sadmark <zhoubin@laidian360.com>
|
||||
shelwin <wxfans@gmail.com>
|
||||
shenlin192@gmail.com <shenlin192@gmail.com>
|
||||
shlice <licesh@gmail.com>
|
||||
shouyong <enlangs@163.com>
|
||||
simaQ <sima.zhang1990@gmail.com>
|
||||
slientcloud <rjmuqiang@gmail.com>
|
||||
snadn <snadn@snadn.cn>
|
||||
sojournerc <cmeyer@zvelo.com>
|
||||
sorrycc <sorrycc@gmail.com>
|
||||
swindme <swindme@163.com>
|
||||
tianli.zhao <275287902@qq.com>
|
||||
tom <caolvchong@gmail.com>
|
||||
ustccjw <317713370@qq.com>
|
||||
wangtao0101 <yuecjn@gmail.com>
|
||||
warmhug <hualei5280@gmail.com>
|
||||
whtang906 <whtang906@gmail.com>
|
||||
wizawu <wizawu@gmail.com>
|
||||
wonyun <wy393767068@163.com>
|
||||
xiaofan2406 <xiaofan2406@gmail.com>
|
||||
yeliex <yeliex@yeliex.com>
|
||||
yiminghe <yiminghe@gmail.com>
|
||||
@@ -112,20 +251,30 @@ yubozhao <yubz86@gmail.com>
|
||||
yuche <i@yuche.me>
|
||||
z <haig8@msn.com>
|
||||
zack <zxyah@126.com>
|
||||
zerob4wl <zerob4wl@gmail.com>
|
||||
zhangpc <zhangpc@tenxcloud.com>
|
||||
zhaocai <lzc09008@gmail.com>
|
||||
zhujun24 <zhujun87654321@gmail.com>
|
||||
zilong <jzlxiaohei@163.com>
|
||||
zinkey <yaya@uloveit.com.cn>
|
||||
zollero <corona7@163.com>
|
||||
zuiidea <zuiiidea@gmail.com>
|
||||
偏右 <afc163@gmail.com>
|
||||
逸达 <dqaria@gmail.com>
|
||||
蔡伦 <sliuqin@gmail.com>
|
||||
陆离 <surgesoft@gmail.com>
|
||||
一喵呜 <hyb628@gmail.com>
|
||||
乔奕轩 <qiao_yixuan@163.com>
|
||||
低位 <zhujun87654321@gmail.com>
|
||||
广彬-梁 <326741518@qq.com>
|
||||
闲耘™ <hotoo.cn@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>
|
||||
陆离 <surgesoft@gmail.com>
|
||||
陈帅 <wasd2144@hotmail.com>
|
||||
马斯特 <sd4399340@126.com>
|
||||
马金花儿 <o.o@mug.dog>
|
||||
白羊座小葛 <abeyuhang@gmail.com>
|
||||
黄子毅 <576625322@qq.com>
|
||||
|
||||
@@ -17,10 +17,383 @@ If you want to read change logs before `2.0.0`, please visit [GitHub](https://gi
|
||||
|
||||
---
|
||||
|
||||
## 2.13.4
|
||||
|
||||
`2017-09-29`
|
||||
|
||||
- 🐞 Fix missing Pagination `size="small"` style.
|
||||
- 🐞 Fix Anchor missing padding. [#7712](https://github.com/ant-design/ant-design/issues/7712)
|
||||
- 🐞 Fix TreeSelect extra select below search input. [#7703](https://github.com/ant-design/ant-design/issues/7703)
|
||||
- 🐞 Fix the jumping problem of Form validate text. [#7730](https://github.com/ant-design/ant-design/issues/7730)
|
||||
- 🐞 Fix Button Group loading style. [#7709](https://github.com/ant-design/ant-design/issues/7709)
|
||||
- 🐞 Fix blur placeholder text color. [#7365](https://github.com/ant-design/ant-design/issues/7365)
|
||||
- 🐞 Fix Mention `suggestion.toLowerCase is not a function` error. [#7696](https://github.com/ant-design/ant-design/issues/7696) [@kappa-gooner](https://github.com/kappa-gooner)
|
||||
- 🐞 Fix a children height problem of Layout.Sider. [#7716](https://github.com/ant-design/ant-design/pull/7716) [@zheeeng](https://github.com/zheeeng)
|
||||
- 🐞 Fix Dropdown menu group style.
|
||||
- 🐞 Fix Table filter icon and dropdown style.
|
||||
- 🐞 Fix a AutoComplete circular reference bug in Inferno. [#7742](https://github.com/ant-design/ant-design/pull/7742) [@menberg](https://github.com/menberg)
|
||||
- 🐞 Fix Upload cannot upload file when using `beforeUpload`. [#7762](https://github.com/ant-design/ant-design/issues/7762) [#6983](https://github.com/ant-design/ant-design/issues/6983)
|
||||
- TypeScript
|
||||
- 🐞 Fix Input `maxLength` definite. [#7744](https://github.com/ant-design/ant-design/pull/7744) [@delesseps](https://github.com/delesseps)
|
||||
- 🐞 Fix `disabledTime` definite of DatePicker. [#7740](https://github.com/ant-design/ant-design/pull/7740) [@778758944](https://github.com/778758944)
|
||||
|
||||
## 2.13.3
|
||||
|
||||
`2017-09-22`
|
||||
|
||||
- 🐞 Fix Affix scrolling bug when document's height minus viewport's height is smaller than the height of children of Affix. [#2349](https://github.com/ant-design/ant-design/issues/2349)
|
||||
- 🐞 Fix broken style of header of Card when `Card[title]` is void and `Card[extra]` is set. [f46112d#commitcomment-24480417](https://github.com/ant-design/ant-design/commit/f46112d38561c89780eb44ecbba82347d2b912da#commitcomment-24480417)
|
||||
- 🐞 Fix TypeScript definition of `Checkbox[children]`. [#7650](https://github.com/ant-design/ant-design/issues/7650) [@liaokaien](https://github.com/liaokaien)
|
||||
- 🐞 Fix error when set nested name in `getFieldDecorator` and then click the label of `Form.Item`. [#7693](https://github.com/ant-design/ant-design/issues/7693)
|
||||
- Input
|
||||
- 🐞 Fix broken style of `Input.Group[compat]` when it has `Select` as its children. [#7662](https://github.com/ant-design/ant-design/issues/7662)
|
||||
- 🐞 Fix TypeScript definition of `Input[autoComplete]`. [#7699](https://github.com/ant-design/ant-design/pull/7699) [@delesseps](https://github.com/delesseps)
|
||||
- LocaleProvider
|
||||
- 🇵🇹 Support Portuguese. [#7449](https://github.com/ant-design/ant-design/pull/7449) [@taviroquai](https://github.com/taviroquai)
|
||||
- 🐞 Fix missing translations in Dutch locale. [#7694](https://github.com/ant-design/ant-design/pull/7694) [@kstiopin](https://github.com/kstiopin)
|
||||
- Table
|
||||
- 🐞 Fix height of table header when `rowSelection` is set. [#7663](https://github.com/ant-design/ant-design/issues/7663)
|
||||
- 🐞 Fix bug that click on first two options will not trigger event when `rowSelection.hideDefaultselections` is set. [#7626](https://github.com/ant-design/ant-design/issues/7626) [@infeng](https://github.com/infeng)
|
||||
- 🐞 Fix TypeScript definition of `Table[scroll]`. [#7640](https://github.com/ant-design/ant-design/pull/7640) [@BlackGanglion](https://github.com/BlackGanglion)
|
||||
|
||||
|
||||
## 2.13.2
|
||||
|
||||
`2017-09-15`
|
||||
|
||||
- 🐞 Fix title and extra content position of narrow Card. [#7604](https://github.com/ant-design/ant-design/issues/7604)
|
||||
- 🐞 Fix inlineCollapsed style of MenuItemGroup. [#7109](https://github.com/ant-design/ant-design/issues/7109)
|
||||
- 🐞 Revert [#7142](https://github.com/ant-design/ant-design/issues/7142) to fix empty data style of Table.
|
||||
- 🐞 Fix Form `getFieldDecoratorOptions` missing types of `normalize` and `validateFirst`. [#7552](https://github.com/ant-design/ant-design/issues/7552) [@meteor91](https://github.com/meteor91) [@mitchelldemler](https://github.com/mitchelldemler)
|
||||
- 🐞 Fix Modal `zIndex` type. [#7624](https://github.com/ant-design/ant-design/issues/7624)
|
||||
- 🌟 Improve tree node loading icon position. [#7584](https://github.com/ant-design/ant-design/issues/7584)
|
||||
- 🌟 Update a lot of components's English doc. [@khalibloo](https://github.com/khalibloo)
|
||||
|
||||
## 2.13.1
|
||||
|
||||
`2017-09-10`
|
||||
|
||||
- 🐞 Fix Card.Grid broken style. [commit/c7d6ce](https://github.com/ant-design/ant-design/commit/c7d6ce5d3f7bfae1f2252d702fb1bdf04fdc80cb)
|
||||
- 🐞 Fix Cascader overlaping text. [#7475](https://github.com/ant-design/ant-design/issues/7475)
|
||||
- 🐞 Fix simple mode Pagination prev and next button missing. [#7500](https://github.com/ant-design/ant-design/issues/7500)
|
||||
- 🐞 Fix Slider typings. [#7532](https://github.com/ant-design/ant-design/issues/7532)
|
||||
- Table
|
||||
- 🐞 Fix empty data scroll style. [#7457](https://github.com/ant-design/ant-design/issues/7457) [#7468](https://github.com/ant-design/ant-design/issues/7468) [#7470](https://github.com/ant-design/ant-design/issues/7470) [#7509](https://github.com/ant-design/ant-design/issues/7509)
|
||||
- 🌟 Make supplement for API docs. [#7525](https://github.com/ant-design/ant-design/pull/7525) [@hansnow](https://github.com/hansnow)
|
||||
- 🐞 Fix Upload typings. [#7507](https://github.com/ant-design/ant-design/pull/7507) [@WingGao](https://github.com/WingGao)
|
||||
- 🐞 Fix inlineCollapsed Menu when Submenu is opened. [#7514](https://github.com/ant-design/ant-design/issues/7514)
|
||||
- 🐞 Fix validateStatus styles of some Form Controls. [#7498](https://github.com/ant-design/ant-design/issues/7498)
|
||||
- 🐞 Fix @link-hover-decoration not working. [#7531](https://github.com/ant-design/ant-design/issues/7531)
|
||||
- 🌟 Optimize the English documentation of some components. [@khalibloo](https://github.com/khalibloo)
|
||||
|
||||
## 2.13.0
|
||||
|
||||
`2017-09-01`
|
||||
|
||||
- 🌟 Add `okType` and `cancelType` prop to Popconfirm and Modal and it's related methods. [#6848](https://github.com/ant-design/ant-design/pull/6848) [@yociduo](https://github.com/yociduo)
|
||||
- 🌟 Add `zIndex` prop to Modal and it's relatedt methos. [#6880](https://github.com/ant-design/ant-design/pull/6880) [@Alex1990](https://github.com/Alex1990)
|
||||
- 🌟 Add `name` prop to RadioGroup. [#7009](https://github.com/ant-design/ant-design/pull/7009) [@djyde](https://github.com/djyde)
|
||||
- 🌟 Add `hideDefaultSelections` props to Table. [#7295](https://github.com/ant-design/ant-design/issues/7295)
|
||||
- Dropdown
|
||||
- 🌟 Add `disabled` prop. [#7102](https://github.com/ant-design/ant-design/pull/7102) [@yociduo](https://github.com/yociduo)
|
||||
- 🌟 Menu can not be selected defaultly now.
|
||||
- 🌟 Add a third parameter `originalElement` to Pagination's `itemRender`.
|
||||
- 🌟 Add `backfill` prop to AutoComplete, items are selected by keyborad will be backfilled to the search input. [#5764](https://github.com/ant-design/ant-design/issues/5764)
|
||||
- 🌟 Add `firstActiveValue` prop to Select to allow specify active item when open select first time. [#6318](https://github.com/ant-design/ant-design/issues/6318) [@L-x-C](https://github.com/ant-design/ant-design/issues/6318)
|
||||
- LocaleProvider
|
||||
- 🌟 Add Persian. [#6878](https://github.com/ant-design/ant-design/pull/6878) [@mkermani144](https://github.com/mkermani144)
|
||||
- 🌟 Add Greek. [#6928](https://github.com/ant-design/ant-design/pull/6928) [@michmach](https://github.com/michmach)
|
||||
- 🌟 Add Norwegian. [#7122](https://github.com/ant-design/ant-design/pull/7122) [@santi](https://github.com/santi)
|
||||
- 🌟 Add Serbian. [#7201](https://github.com/ant-design/ant-design/pull/7201) [@paunovic-stefan](https://github.com/paunovic-stefan)
|
||||
- 🐞 Fix Menu's title can not be hidden when collapsing Sider. [#7409](https://github.com/ant-design/ant-design/issues/7409)
|
||||
- 🐞 Fix some TypeScript type definitions [#7355](https://github.com/ant-design/ant-design/pull/7355) [#7378](https://github.com/ant-design/ant-design/pull/7378) [#7384](https://github.com/ant-design/ant-design/pull/7384)
|
||||
- 🐞 Fix some components can not use conditional rendering. [#6530](https://github.com/ant-design/ant-design/issues/6530)
|
||||
- Website
|
||||
- 🌟 Add a shortcut `s` to focus the search input.
|
||||
- 🌟 Add a color picker to the footer to change primary color and preview lively.
|
||||
|
||||
## 2.12.8
|
||||
|
||||
`2017-08-27`
|
||||
|
||||
- 📖 Rewrite the [Use in create-react-app](/docs/react/use-with-create-react-app) documentation without ejecting. [#7276](https://github.com/ant-design/ant-design/pull/7276)
|
||||
- 🌟 Better empty data style for fixed-columns Table. [#7298](https://github.com/ant-design/ant-design/issues/7298)
|
||||
- 🐞 Fix `disabled` logic of CheckboxGroup and Checkbox. [#7266](https://github.com/ant-design/ant-design/issues/7266) [@dilidili](https://github.com/dilidili)
|
||||
- 🐞 Fix errors of rendering Spin and Carousel in react-snapshot or other jsdom environment. [#3308](https://github.com/ant-design/ant-design/issues/3308) [#7318](https://github.com/ant-design/ant-design/issues/7318)
|
||||
- 🐞 Fix some details of Select, Tooltip and Menu.
|
||||
|
||||
## 2.12.7
|
||||
|
||||
`2017-08-21`
|
||||
|
||||
- antd of Angular@4.0, [ng-zorro-antd](https://ng.ant.design) is open sourcing.
|
||||
- Affix supports more scenes. [01d4acb](https://github.com/ant-design/ant-design/commit/01d4acb7a9b030be3552b4ca19b4e899dc2bb7c7)
|
||||
- Fix that AutoComplete children ref doesn't work. [#6814](https://github.com/ant-design/ant-design/issues/6814)
|
||||
- Button
|
||||
- Improve the logic to insert space in Chinese characters. [59b11f3](https://github.com/ant-design/ant-design/commit/59b11f3b480d43cb32fb24e351cb4c4dd569243c)
|
||||
- Fix that `event.target` of click is not `button`. [#7034](https://github.com/ant-design/ant-design/issues/7034)
|
||||
- Fix that Carousel's `innerSlider` doesn't exist. [#7191](https://github.com/ant-design/ant-design/issues/7191)
|
||||
- Fix the style of button in DatePicker. [ad6dbcb](https://github.com/ant-design/ant-design/commit/ad6dbcb9c6dac407a38f2391d3e5fa1d8ae1cfab)
|
||||
- Fix TypeScript definition of Form.[#7245](https://github.com/ant-design/ant-design/pull/7245)
|
||||
- Fix TypeScript definition of InputNumber. [#7257](https://github.com/ant-design/ant-design/issues/7257)
|
||||
- Fix missing collapse animation of `Layout.Sider` in IE11. [#6349](https://github.com/ant-design/ant-design/issues/6349)
|
||||
- Fix typo of Spanish locale of LocaleProvider. [#7234](https://github.com/ant-design/ant-design/pull/7234) [@ramsesmoreno](https://github.com/ramsesmoreno)
|
||||
- Fix that notification's default placement should not be overrided. [#5895](https://github.com/ant-design/ant-design/issues/5895)
|
||||
- Fix disabled style of button in Pagination. [cf3c0aa](https://github.com/ant-design/ant-design/commit/cf3c0aac43e2825bfd85ca3b8abbf4742e504260)
|
||||
- Fix that wrong exports of Select which cause webpack build error. [#7222](https://github.com/ant-design/ant-design/issues/7222)
|
||||
- Fix that Tabs should show arrow buttons while resize its container. [#7231](https://github.com/ant-design/ant-design/issues/7231) [#7210](https://github.com/ant-design/ant-design/issues/7210)
|
||||
- Fix style of Timeline which has only one `Timeline.Item`. [#7214](https://github.com/ant-design/ant-design/issues/7214)
|
||||
- Fix wrong behavior of Upload when uid is 0. [#7269](https://github.com/ant-design/ant-design/issues/7269)
|
||||
|
||||
## 2.12.6
|
||||
|
||||
`2017-08-11`
|
||||
|
||||
- Fix Collapse arrow position in IE9/10/11. [af9dc73](https://github.com/ant-design/ant-design/commit/af9dc73eef2aac3e68fdfc99f9231153437f5068)
|
||||
- Fix empty Table scrollBar's position. [#7142](https://github.com/ant-design/ant-design/issues/7142)
|
||||
- Fix RangePicker Input's style of height. [47c5de2](https://github.com/ant-design/ant-design/commit/47c5de29f370a77fc19a6a8eda8ac57476f312a6)
|
||||
- Card
|
||||
- Improve Card.Grid style of collapse border. [807b573](https://github.com/ant-design/ant-design/commit/807b573bff43bc71115afeb086f565561807a32d)
|
||||
- Fix the `no-animation` type's className. [#7185](https://github.com/ant-design/ant-design/issues/7185)
|
||||
- Fix Input Safari text align. [#7135](https://github.com/ant-design/ant-design/issues/7135)
|
||||
- Layout
|
||||
- Fix stretched layout by content. [500b222](https://github.com/ant-design/ant-design/commit/500b2225567f03397d9faec5f4e60a8f35fc4d28)
|
||||
- Fix the collapse trigger's position. [f689ede](https://github.com/ant-design/ant-design/commit/f689ede0fa836dd0d99f4e4d96e0c43d0ff19742)
|
||||
- Fix Upload doesn't handle some error scenarios which response is not a string. [#6818](https://github.com/ant-design/ant-design/issues/6818)
|
||||
- Form
|
||||
- Add `validateFirst` prop of docs. [#6959](https://github.com/ant-design/ant-design/issues/6959)
|
||||
- Fix `wrappedComponentRef`. [#6545](https://github.com/ant-design/ant-design/issues/6545)
|
||||
- Add FormCreateOption's generic type. [#7119](https://github.com/ant-design/ant-design/pull/7119) [@djyde](https://github.com/djyde)
|
||||
- Fix `square` font size to `@form-feedback-icon-size`. [9bcde59](https://github.com/ant-design/ant-design/commit/9bcde590015855a12fdee851cf4e4836d0195cd7)
|
||||
|
||||
## 2.12.5
|
||||
|
||||
`2017-08-07`
|
||||
|
||||
- Fix the `SelectPropTypes not found` issue under es mode. [#7123](https://github.com/ant-design/ant-design/issues/7123)
|
||||
- Fix Row no wrap issue. [4f73a23](https://github.com/ant-design/ant-design/commit/4f73a23a103733a3c148bb04013493a042f90a8f)
|
||||
- Fix broken style of InputNumber and RangePicker. [#7117](https://github.com/ant-design/ant-design/issues/7117) [#7126](https://github.com/ant-design/ant-design/issues/7126)
|
||||
|
||||
## 2.12.4
|
||||
|
||||
`2017-08-06`
|
||||
|
||||
- Fix Affix throw invalid calling object in IE. [#7060](https://github.com/ant-design/ant-design/issues/7060)
|
||||
- Make optimization for title display behavior of Badge. [#7024](https://github.com/ant-design/ant-design/issues/7024)
|
||||
- Card
|
||||
- Fix `noHovering` API typo. [#7078](https://github.com/ant-design/ant-design/issues/7078)
|
||||
- Fix `children` type definitions. [pull/7030](https://github.com/ant-design/ant-design/pull/7030) [@djyde](https://github.com/djyde)
|
||||
- Fix Collapse `onChange` parameter type definitions. [pull/7084](https://github.com/ant-design/ant-design/pull/7084) [@davidctj](https://github.com/davidctj)
|
||||
- Dropdown
|
||||
- Fix Dropdown.Button align issue. [#7070](https://github.com/ant-design/ant-design/issues/7070)
|
||||
- Add `size` prop for docs. [pull/7071](https://github.com/ant-design/ant-design/pull/7071) [@hansnow](https://github.com/hansnow)
|
||||
- Input
|
||||
- Fix outline covered by addon. [commit/0f63c7](https://github.com/ant-design/ant-design/commit/0f63c7186ef3a5db36c01df9d9ebde9d5b3871ef)
|
||||
- Fix InputGroup demo. [pull/7089](https://github.com/ant-design/ant-design/pull/7089) [@jdz321](https://github.com/jdz321)
|
||||
- Fix InputNumber Formatter demo issue. [pull/7098](https://github.com/ant-design/ant-design/pull/7098) [@tim-soft](https://github.com/tim-soft)
|
||||
- Menu
|
||||
- Fix abnormal performance of inlineCollapsed Menu. [#7048](https://github.com/ant-design/ant-design/issues/7048) [#7063](https://github.com/ant-design/ant-design/issues/7063)
|
||||
- Fix SubMenu can't be highlighted if its children are selected. [pull/7042](https://github.com/ant-design/ant-design/pull/7042) [@atomgao](https://github.com/atomgao)
|
||||
- Fix notification `type` type definitions. [#7073](https://github.com/ant-design/ant-design/issues/7073) [@marswong](https://github.com/marswong)
|
||||
- Fix Pagination `showTotal` type definitions. [#7054](https://github.com/ant-design/ant-design/issues/7054)
|
||||
- Fix RangePicker throw error after clear. [#7077](https://github.com/ant-design/ant-design/issues/7077)
|
||||
- Adds `onFocus` and `onBlur` type definitions for Select. [pull/7082](https://github.com/ant-design/ant-design/pull/7082) [@troynt](https://github.com/troynt)
|
||||
- Fix Tabs `tabBarExtraContent` style issue in vertical mode. Upgrade rc-tabs to 9.0.2, refactor the dom structure of TabBar `extraContent`. [#6578](https://github.com/ant-design/ant-design/issues/6578)
|
||||
- Fix missing icon issue for TreeSelect. [#7020](https://github.com/ant-design/ant-design/issues/7020)
|
||||
- Fix `error TS7016: Could not find a declaration file for module 'rc-util/lib/Dom/addEventListener'`. [#7033](https://github.com/ant-design/ant-design/issues/7033) [@djyde](https://github.com/djyde)
|
||||
- Translate patterns/list. [list](https://ant.design/docs/pattern/list) [@zachguo](https://github.com/zachguo)
|
||||
|
||||
## 2.12.3
|
||||
|
||||
`2017-07-30`
|
||||
|
||||
- Fix indeterminate Checkbox style when it's disabled.
|
||||
- Fix Card `this.container` may not exists issue. [#6976](https://github.com/ant-design/ant-design/pull/6976) [@neekey](https://github.com/neekey)
|
||||
- Fix Button align issue when set base font to `14px`. [#7001](https://github.com/ant-design/ant-design/issues/7001)
|
||||
- Dropdown
|
||||
- Fix Menu can be multiple cicked. [#6314](https://github.com/ant-design/ant-design/issues/6314)
|
||||
- Fix Menu dispears if it's hovered before it's shown. [#6949](https://github.com/ant-design/ant-design/issues/6949)
|
||||
- Fix align issue.
|
||||
- Fix Grid Card padding.
|
||||
- Improve Menu animation.[#6955](https://github.com/ant-design/ant-design/pull/6955)
|
||||
- Twrak DatePicker icon position.
|
||||
- Add new less variables.[e1a46cc](https://github.com/ant-design/ant-design/commit/e1a46cc419fb4975ae1782ba793b378c8e584057)
|
||||
- Fix some issues of TypeScript definitions.
|
||||
|
||||
## 2.12.2
|
||||
|
||||
`2017-07-22`
|
||||
|
||||
- Longer message duration (1.5s to 3s).
|
||||
- Fix Anchor links not highlighted. [#6473](https://github.com/ant-design/ant-design/issues/6473)
|
||||
- Fix disabled style of Input.TextArea. [#6858](https://github.com/ant-design/ant-design/pull/6858) [@lyz810](https://github.com/lyz810)
|
||||
- Fix disabled style of TimePicker. [#6918](https://github.com/ant-design/ant-design/issues/6918)
|
||||
- Fix overlaped issue of form feedback icon and select arrow which is introduced in `2.12.1` again. [#4431](https://github.com/ant-design/ant-design/issues/4431)
|
||||
- Fix vertical Tabs arrow style. [255eac9](https://github.com/ant-design/ant-design/commit/255eac907949ded5b79f216a29831dcf4afa9362)
|
||||
- Update Polish locale. [#6869](https://github.com/ant-design/ant-design/pull/6869) [#6870](https://github.com/ant-design/ant-design/pull/6870) [#6871](https://github.com/ant-design/ant-design/pull/6871) [@imosapatryk](https://github.com/imosapatryk)
|
||||
- Fix that `http` url incluced in source code. [#6893](https://github.com/ant-design/ant-design/issues/6893)
|
||||
- Adjust vertical align of Menu icon and text.
|
||||
- Fix `overlay is marked as required` warning of Tooltip. [#6897](https://github.com/ant-design/ant-design/issues/6897)
|
||||
- Fix disabled style of Slider under colored background. [#6665](https://github.com/ant-design/ant-design/issues/6665)
|
||||
- Adjust click area of TreeSelect item.
|
||||
- Fix some issues of TypeScript definitions.
|
||||
|
||||
## 2.12.1
|
||||
|
||||
`2017-07-17`
|
||||
|
||||
- Fix typo in Bulgarian locales. [#6788](https://github.com/ant-design/ant-design/pull/6788) [@NoHomey](https://github.com/NoHomey)
|
||||
- Fix broken style of `<Avatar src="..." />` when image cannot be loaded. [#6804](https://github.com/ant-design/ant-design/issues/6804)
|
||||
- Fix broken style of loading icon button in `Button.Group`. [#6822](https://github.com/ant-design/ant-design/issues/6822)
|
||||
- Fix TypeScript's definition of Checkbox. [#6768](https://github.com/ant-design/ant-design/issues/6768)
|
||||
- Fix broken style of `Collapse.Panel[header]` when content is too long. [#6832](https://github.com/ant-design/ant-design/issues/6832)
|
||||
- Input
|
||||
- Fix that `className` should be added to wrapper. [#6809](https://github.com/ant-design/ant-design/issues/6809)
|
||||
- Fix TypeScript's definition of `Input.Search`. [#6837](https://github.com/ant-design/ant-design/pull/6837) [@newraina](https://github.com/newraina)
|
||||
- Fix that value of `Input.TextArea` cannot be reset. [#6776](https://github.com/ant-design/ant-design/issues/6776)
|
||||
- Fix broken style of error status of Select in `Input.Group`.
|
||||
|
||||
<img src="https://user-images.githubusercontent.com/507615/27983847-551ffe0a-63f9-11e7-81ba-8c3336ddafd0.png" />
|
||||
|
||||
- Fix that the implementation of Layout should not affect Anchor and BackTop. [#6817](https://github.com/ant-design/ant-design/issues/6817)
|
||||
- Menu
|
||||
- Fix animation of inline menu.
|
||||
- Fix style of border of `Menu.Item`. [46ffda9](https://github.com/ant-design/ant-design/commit/46ffda9c9385ec54e0c78594ed6c280d40ef035d)
|
||||
- Fix that RangePicker should show correct months in panels when `value|defaultValue` is set. [#6764 point 3](https://github.com/ant-design/ant-design/issues/6764)
|
||||
- Fix alignment of Tooltip. [#6830](https://github.com/ant-design/ant-design/issues/6830)
|
||||
|
||||
## 2.12.0
|
||||
|
||||
`2017-07-08`
|
||||
|
||||
- Add Card `noHovering` and Card.Grid. [pull/6748](https://github.com/ant-design/ant-design/pull/6748)
|
||||
- DatePicker, MonthPicker, RangePicker now support `className` prop. [pull/6584](https://github.com/ant-design/ant-design/pull/6584) [@EnrikoLabriko](https://github.com/EnrikoLabriko)
|
||||
- Add Input.Textarea, Input[type='textArea'] will be deprecated. [pull/6138](https://github.com/ant-design/ant-design/pull/6138)
|
||||
- LocaleProvider supporting Thai. [pull/6721](https://github.com/ant-design/ant-design/pull/6721) [@koobitor](https://github.com/koobitor)
|
||||
- Mention support `focus` function. [#6135](https://github.com/ant-design/ant-design/issues/6135)
|
||||
- Menu inline mode could be collapsed by `inlineCollapsed`, and use `context` to pass `collapsed` prop from Layout.Sider to Menu, don't need customized css code anymore. [pull/6686](https://github.com/ant-design/ant-design/pull/6686)
|
||||
- Add Pagination `itemRender`, now you can customize the structure of page number. [25a603](https://github.com/ant-design/ant-design/commit/25a60322e5c6649522fb9f0d34919eba0ccb1f65)
|
||||
- Add Tooltip `autoAdjustOverflow` prop, now the auto adjust feature can be disabled. [pull/6661](https://github.com/ant-design/ant-design/pull/6661) [@jdz321](https://github.com/jdz321)
|
||||
- Fix errors in docs of Avatar. [pull/6711](https://github.com/ant-design/ant-design/pull/6711) [@llaski](https://github.com/llaski)
|
||||
- DatePicker
|
||||
- Fix `onOk` type definitions. [pull/6619](https://github.com/ant-design/ant-design/pull/6619) [@newraina](https://github.com/newraina)
|
||||
- Improve icon style. [pull/6655](https://github.com/ant-design/ant-design/pull/6655) [@megawac](https://github.com/megawac)
|
||||
- Form
|
||||
- Fix formItem `extra` content line height. [#6618](https://github.com/ant-design/ant-design/issues/6618)
|
||||
- Fix FormItem `labelCol` `wrapperCol` type definitions. [pull/6611](https://github.com/ant-design/ant-design/pull/6611) [@newraina](https://github.com/newraina)
|
||||
- Fix autosize Input.Textarea scrollbar style issue. [#6609](https://github.com/ant-design/ant-design/issues/6609)
|
||||
- Add missing TypeScript definition of `precision` in InputNumber. [#6715](https://github.com/ant-design/ant-design/issues/6715)
|
||||
- Fix Select overflow issue. [#6621](https://github.com/ant-design/ant-design/issues/6621)
|
||||
- Slider
|
||||
- Improve styles. [#6665](https://github.com/ant-design/ant-design/issues/6665)
|
||||
- Upgrade rc-slider to 8.2.0, add `dotStyle`, `activeDotStyle` props. [rc-slider/pull/292](https://github.com/react-component/slider/pull/292)
|
||||
- Fix Spin z-index issue. [#6759](https://github.com/ant-design/ant-design/issues/6759)
|
||||
- Fix nested Steps style issue. [#6754](https://github.com/ant-design/ant-design/issues/6754)
|
||||
- Table
|
||||
- Fix expanded area background of fixed header Table. [#6657](https://github.com/ant-design/ant-design/issues/6657)
|
||||
- Add `onRowDoubleClick` prop for docs. [pull/6667](https://github.com/ant-design/ant-design/pull/6667) [@yurtaev](https://github.com/yurtaev)
|
||||
- Make supplement for `loading` docs. [pull/6763](https://github.com/ant-design/ant-design/pull/6763) [@hansnow](https://github.com/hansnow)
|
||||
- Upgrade rc-table to 5.4.0, support `onRowMouseEnter` and `onRowMouseLeave`. [rc-table/0db582](https://github.com/react-component/table/commit/0db582a75dfa119715eb4db8a59eacfca744c5a0)
|
||||
- Improve TimePicker format support. [950c32](https://github.com/ant-design/ant-design/commit/950c321b25091ef31b130b83674478974590d7f3)
|
||||
- Make style improvement or tweaking for many components, includes [Checkbox](https://ant.design/components/checkbox/), [Radio](https://ant.design/components/radio/), [Tabs](https://ant.design/components/tabs/), [Card](https://ant.design/components/card/) and etc.
|
||||
- Now you can open demo in codepen. [#5140](https://github.com/ant-design/ant-design/issues/5140)
|
||||
|
||||
## 2.11.2
|
||||
|
||||
`2017-06-25`
|
||||
|
||||
- Dropdown.Button now support `getPopupContainer` function. [#6527](https://github.com/ant-design/ant-design/pull/6527)
|
||||
- Fix disabled dropdown submenu style error. [#6548](https://github.com/ant-design/ant-design/issues/6548)
|
||||
- Fix background color error of Calendar. [aaf2a50](https://github.com/ant-design/ant-design/commit/aaf2a508bef96f81faf556036649b2a2fe5b635b)
|
||||
- Select of Calendar now take place in header. [#6479](https://github.com/ant-design/ant-design/pull/6479)
|
||||
- Fix horia horizontal scroll error of Input and Textarea. [#6577](https://github.com/ant-design/ant-design/issues/6577)
|
||||
- Improve document of `disabled` attribute of Checkbox and Radio. [#6597](https://github.com/ant-design/ant-design/pull/6597)
|
||||
- Increase click area of Table's sort and filter icon. [#6528](https://github.com/ant-design/ant-design/pull/6528)
|
||||
- Add `event:Event` parameter of Table.props.onRowClick. [e2a99f5](https://github.com/ant-design/ant-design/commit/e2a99f53f7a27bd7de4adf99d0e1ee755b537c72)
|
||||
|
||||
## 2.11.1
|
||||
|
||||
`2017-06-18`
|
||||
|
||||
- Fix setting `className` of Table's pagination not working issue. [#6416](https://github.com/ant-design/ant-design/issues/6416)
|
||||
- Fix nested Tabs style issue.[#6431](https://github.com/ant-design/ant-design/issues/6431) [@sadmark](https://github.com/sadmark)
|
||||
- Fix RadioButton wrapping leaves off the left border on small screen.[#6492](https://github.com/ant-design/ant-design/issues/6492) [@pierreneter](https://github.com/pierreneter)
|
||||
- Fix RangePicker footer border.
|
||||
- Improve Dropdown.Button's type definitions. [#6482](https://github.com/ant-design/ant-design/pull/6482) [@newraina](https://github.com/newraina)
|
||||
|
||||
|
||||
## 2.11.0
|
||||
|
||||
`2017-06-07`
|
||||
|
||||
- New component [Avatar](https://ant.design/components/avatar/). 🌝
|
||||
- LocaleProvider
|
||||
- Supporting Bulgarian. [#6297](https://github.com/ant-design/ant-design/pull/6297) [@dimitrov-adrian](https://github.com/dimitrov-adrian)
|
||||
- Supporting Polish. [#6326](https://github.com/ant-design/ant-design/pull/6326) [@longersson](https://github.com/longersson)
|
||||
- Supporting Britain English. [#6344](https://github.com/ant-design/ant-design/pull/6344) [@damiangreen](https://github.com/damiangreen)
|
||||
- Supporting Italian. [#6344](https://github.com/ant-design/ant-design/pull/6344) [@damiangreen](https://github.com/damiangreen)
|
||||
- Supporting French. [#6344](https://github.com/ant-design/ant-design/pull/6344) [@damiangreen](https://github.com/damiangreen)
|
||||
- Supporting Belgian. [#6344](https://github.com/ant-design/ant-design/pull/6344) [@damiangreen](https://github.com/damiangreen)
|
||||
- Collapse.Panel can be disabled now, which makes users cannot toggle panel with mouse/keyboard. [#6119](https://github.com/ant-design/ant-design/issues/6119) [demo](https://ant.design/components/collapse/#components-collapse-demo-basic)
|
||||
- DatePicker and RangePicker support customized footer. [#6122](https://github.com/ant-design/ant-design/issues/6122) [#5188](https://github.com/ant-design/ant-design/issues/5188) [demo](https://ant.design/components/date-picker/#components-date-picker-demo-extra-footer)
|
||||
- InputNumber can set precision with property `precision`, this means that precision need not to follow `step`. [#5998](https://github.com/ant-design/ant-design/issues/5998)
|
||||
- TreeSelect supports `allowClear` in multiple mode.
|
||||
|
||||
- Improve keyboard support of Pagination. [rc-pagination#83](https://github.com/react-component/pagination/pull/83) [@geramirez](https://github.com/geramirez)
|
||||
- Improve style of Progress. [#6354](https://github.com/ant-design/ant-design/issues/6354)
|
||||
- Improve ARIA support of Slider. [#6301](https://github.com/ant-design/ant-design/pull/6301)
|
||||
|
||||
- Fix that animating elements should not be clickable. [#6314](https://github.com/ant-design/ant-design/issues/6314)
|
||||
- Fix `Cannot read property '0' of undefined` issue of DatePicker, TimePicker, and RangePicker. [#6334](https://github.com/ant-design/ant-design/issues/6334)
|
||||
- DatePicker
|
||||
- Fix misplaced popup. [#6347](https://github.com/ant-design/ant-design/issues/6347)
|
||||
- Fix wrong format of tooltip of date cell. [#5724](https://github.com/ant-design/ant-design/issues/5724) [@zefj](https://github.com/zefj)
|
||||
- Fix that disabled date is selectable while using keyboard. [#6345](https://github.com/ant-design/ant-design/issues/6345)
|
||||
- Fix nested fields support of Form `validateFieldsAndScroll`. [#5410](https://github.com/ant-design/ant-design/issues/5410)
|
||||
- Input[addon]
|
||||
- Fix that style doesn't work. [#6379](https://github.com/ant-design/ant-design/issues/6379)
|
||||
- Fix vertical align issue. [#6403](https://github.com/ant-design/ant-design/issues/6403)
|
||||
- Fix that confirm button not clickable when the returned promise of Modal.confirm is rejected. [#6183](https://github.com/ant-design/ant-design/issues/6183)
|
||||
- Fix style of input of Pagination. [#6339](https://github.com/ant-design/ant-design/issues/6339)
|
||||
- Fix that user input of Select should not be trimed in search mode. [#6382](https://github.com/ant-design/ant-design/issues/6382)
|
||||
- Fix that timers of Spin should be removed correctly. [#6383](https://github.com/ant-design/ant-design/issues/6383)
|
||||
- Fix onClick support of Switch. [#6373](https://github.com/ant-design/ant-design/issues/6373)
|
||||
- Fix wrong TypeScript definition of Table.Column which will cause `error TS2304: Cannot find name 'T'`. [#6313](https://github.com/ant-design/ant-design/issues/6313)
|
||||
- Fix error TypeScript definition of Timeline.Item and Dropdown.Button. [#6356](https://github.com/ant-design/ant-design/issues/6356)
|
||||
- Fix broken style of disabled Tree and TreeSelect. [#6320](https://github.com/ant-design/ant-design/issues/6320)
|
||||
|
||||
## 2.10.4
|
||||
|
||||
`2017-06-01`
|
||||
|
||||
- Fix `rc-util` dependency. [#6310](https://github.com/ant-design/ant-design/pull/6311) [@bkniffler](https://github.com/bkniffler)
|
||||
- Fix syntax error in es build. [#6310](https://github.com/ant-design/ant-design/issues/6310#issuecomment-305176273)
|
||||
|
||||
## 2.10.3
|
||||
|
||||
`2017-05-31`
|
||||
|
||||
- **Calendar**
|
||||
- Fix disabledDate not be supported, and make supplement for the types and documentation. [#6074](https://github.com/ant-design/ant-design/issues/6074)
|
||||
- Upgrade rc-calendar to 8.4.0, support Bulgarian, and user can select end date first. [commit/a4a6db](https://github.com/ant-design/ant-design/commit/a4a6db76de57ac2559a2be80208121ab5e168fbf)
|
||||
- **Alert** Remove default margin-bottom. [commit/5ef482](https://github.com/ant-design/ant-design/commit/5ef48289747409b6d962f75627ddb11e2765f965)
|
||||
- **Tabs** Fix inactive tab panel behavious. [#6237](https://github.com/ant-design/ant-design/issues/6237)
|
||||
- **Layout** Fix children in the collapsed Sider not be hidden. [#6131](https://github.com/ant-design/ant-design/issues/6131)
|
||||
- **Table** Fix table filter menu overflow issue. [#6245](https://github.com/ant-design/ant-design/issues/6245)
|
||||
- **InputNumber** Fix hasFeedback misplaced validated icon. [#6289](https://github.com/ant-design/ant-design/issues/6289)
|
||||
- **Typescript**
|
||||
- Upgrade TypeScript to 2.3.x. [#6263](https://github.com/ant-design/ant-design/issues/6263)
|
||||
- Add missing props in Table. [commit/acdc56](https://github.com/ant-design/ant-design/commit/acdc563a547c49960521b2b48cd5c707ac1e4cf2) [pull/6291](https://github.com/ant-design/ant-design/pull/6291) [@jch254](https://github.com/jch254)
|
||||
- Fix wrong type in Mention and Form. [pull/6268](https://github.com/ant-design/ant-design/pull/6268) [@jch254](https://github.com/jch254)
|
||||
- Fix wrong type in Badge. [pull/6291](https://github.com/ant-design/ant-design/pull/6291) [@jch254](https://github.com/jch254)
|
||||
- Add missing props in Input related Components. [pull/6276](https://github.com/ant-design/ant-design/pull/6276/commits/94901de2e8c0a2ed6f62f5aa50c98994aad71844) [@panjiesw](https://github.com/panjiesw) [commit/220264](https://github.com/ant-design/ant-design/commit/2202648d6e1c53409ade2141955232922b0040d6#diff-26cb6da96d10397e18e7dbd6c5d8f7a1L265) [@clinyong](https://github.com/clinyong)
|
||||
|
||||
## 2.10.2
|
||||
|
||||
`2017-05-23`
|
||||
|
||||
- Fix `prop-types` warnings which due to upgrading React. [#5678](https://github.com/ant-design/ant-design/issues/5678)
|
||||
- Fix `defaultValue` issue of DatePicker and RangePicker in showTime mode. [#6160](https://github.com/ant-design/ant-design/pull/6160)
|
||||
- Fix style issue of TreeSelect. [#6137](https://github.com/ant-design/ant-design/issues/6137)
|
||||
- Fix style issue of Input with prefix and addon. [#6144](https://github.com/ant-design/ant-design/issues/6144)
|
||||
- Fix some bugs of `notification.destroy`. [#6161](https://github.com/ant-design/ant-design/issues/6161)
|
||||
@@ -56,7 +429,7 @@ If you want to read change logs before `2.0.0`, please visit [GitHub](https://gi
|
||||
- Checkbox.Group can support more flexible layout with nested Checkbox. [demo](http://ant.design/components/checkbox-cn/#components-checkbox-demo-layout)
|
||||
- Notification's inline style and className can be customized now. [#5893](https://github.com/ant-design/ant-design/issues/5893) [@lixiaoyang1992](https://github.com/lixiaoyang1992)
|
||||
- TimePicker's open status can be controlled by `open` property. [#5913](https://github.com/ant-design/ant-design/pull/5913)
|
||||
- The returned value of Upload[onRemove] could be a promise to control remove logic asynchronously. [#5973](https://github.com/ant-design/ant-design/issues/5973) [@shlice](https://github.com/shlice)
|
||||
- The returned value of Upload `onRemove` could be a Promise to control remove logic asynchronously. [#5973](https://github.com/ant-design/ant-design/issues/5973) [@shlice](https://github.com/shlice)
|
||||
- Adjust padding of popup of Dropdown. [#5088](https://github.com/ant-design/ant-design/issues/5088)
|
||||
- AutoComplete
|
||||
- Fix inconsistent behavior between `dataSource: Object[]` and `dataSource: String[]`. [#5860](https://github.com/ant-design/ant-design/issues/5860)
|
||||
@@ -97,7 +470,6 @@ If you want to read change logs before `2.0.0`, please visit [GitHub](https://gi
|
||||
- Improve user experience of RangePicker, rc-calendar upgrade to `~8.0.0`. [#4985](https://github.com/ant-design/ant-design/issues/4985)
|
||||
- Fix RangePicker not aligned after customizing the size of input. [pull/5718](https://github.com/ant-design/ant-design/pull/5718) [@leadream](https://github.com/leadream)
|
||||
- **Form** Add a less variable to opt out of form item colons. [pull/5855](https://github.com/ant-design/ant-design/pull/5855) [@megawac](https://github.com/megawac)
|
||||
- **Icon** Add displayName. [pull/5643](https://github.com/ant-design/ant-design/pull/5643) [@handycode](https://github.com/handycode)
|
||||
- **Input**
|
||||
- Fix Input.Search style issue when be used in Input.Group. [#5743](https://github.com/ant-design/ant-design/issues/5743)
|
||||
- Fix AutoComplete style issue when be used in Input.Group. [#5832](https://github.com/ant-design/ant-design/issues/5832)
|
||||
@@ -192,7 +564,7 @@ If you want to read change logs before `2.0.0`, please visit [GitHub](https://gi
|
||||
- Fixed missing locales of Russian. [#5406](https://github.com/ant-design/ant-design/pull/5406) [@plandem](https://github.com/plandem)
|
||||
- Fixed it doesn't work with Upload. [#5388](https://github.com/ant-design/ant-design/pull/5388) [@natergj](https://github.com/natergj)
|
||||
- Fixed inconsistet animation of Menu Icon and text. [#5495](https://github.com/ant-design/ant-design/issues/5495)
|
||||
- Fixed `Modale[footer]` cannot be set to `null`. [#5462](https://github.com/ant-design/ant-design/issues/5462)
|
||||
- Fixed `Modal[footer]` cannot be set to `null`. [#5462](https://github.com/ant-design/ant-design/issues/5462)
|
||||
- Fixed Pagination will lost styles in `IE<=10` which is introduced in `2.8.2`. [#5484](https://github.com/ant-design/ant-design/issues/5484)
|
||||
- Fixed Popover will be closed by mistake while using Table in it. [#5407](https://github.com/ant-design/ant-design/issues/5407)
|
||||
- Remove restriction that Radio can only be direct chidlren of Radio.Group. [#5443](https://github.com/ant-design/ant-design/issues/5443)
|
||||
@@ -207,16 +579,16 @@ If you want to read change logs before `2.0.0`, please visit [GitHub](https://gi
|
||||
`2017-03-11`
|
||||
|
||||
- New [design specification documentation](https://ant.design/docs/spec/colors).
|
||||
- Fix error of Modal.confirm [#5269](https://github.com/ant-design/ant-design/issues/5269).
|
||||
- Fix mask style of Upload [#5275](https://github.com/ant-design/ant-design/issues/5275).
|
||||
- Fix progress not showing of Upload [#5323](https://github.com/ant-design/ant-design/issues/5323).
|
||||
- Fix a pagination showTotal wrong data issue of Table [#5259](https://github.com/ant-design/ant-design/issues/5259).
|
||||
- Fix a style issue while using Popconfirm and Button together [5301](https://github.com/ant-design/ant-design/issues/5301).
|
||||
- Fix a style issue of Radio [#5336](https://github.com/ant-design/ant-design/pull/5336).
|
||||
- Fix a issue that `getContainer` of Message didn't work [#5380](https://github.com/ant-design/ant-design/issues/5380).
|
||||
- Fix text alignment of Checkbox and Radio [696a3c0](https://github.com/ant-design/ant-design/commit/696a3c0e34156d78e87d629a3f0f8703af1f03ec).
|
||||
- Tweak animation and blur style of Spin [fa1e031](https://github.com/ant-design/ant-design/commit/fa1e031a7396c61fa9709a0c46fe63200c35d232).
|
||||
- Tweak some styles of Mention [240a93c](https://github.com/ant-design/ant-design/commit/240a93cee25bc8c6ad4520cd907a14a7b22ed773).
|
||||
- Fix error of Modal.confirm. [#5269](https://github.com/ant-design/ant-design/issues/5269)
|
||||
- Fix mask style of Upload. [#5275](https://github.com/ant-design/ant-design/issues/5275)
|
||||
- Fix progress not showing of Upload. [#5323](https://github.com/ant-design/ant-design/issues/5323)
|
||||
- Fix a pagination showTotal wrong data issue of Table. [#5259](https://github.com/ant-design/ant-design/issues/5259)
|
||||
- Fix a style issue while using Popconfirm and Button together. [#5301](https://github.com/ant-design/ant-design/issues/5301)
|
||||
- Fix a style issue of Radio. [#5336](https://github.com/ant-design/ant-design/pull/5336)
|
||||
- Fix a issue that `getContainer` of Message didn't work. [#5380](https://github.com/ant-design/ant-design/issues/5380)
|
||||
- Fix text alignment of Checkbox and Radio. [696a3c0](https://github.com/ant-design/ant-design/commit/696a3c0e34156d78e87d629a3f0f8703af1f03ec)
|
||||
- Tweak animation and blur style of Spin. [fa1e031](https://github.com/ant-design/ant-design/commit/fa1e031a7396c61fa9709a0c46fe63200c35d232)
|
||||
- Tweak some styles of Mention. [240a93c](https://github.com/ant-design/ant-design/commit/240a93cee25bc8c6ad4520cd907a14a7b22ed773)
|
||||
|
||||
## 2.8.1
|
||||
|
||||
@@ -270,7 +642,7 @@ If you want to read change logs before `2.0.0`, please visit [GitHub](https://gi
|
||||
- Added a new `Fixed Header` demo. [demo](https://ant.design/components/layout-cn/#components-layout-demo-fixed)
|
||||
- Added `Sider[breakpoint]` to allow config responsive breakpoint. [#4931](https://github.com/ant-design/ant-design/pull/4931)
|
||||
- Form
|
||||
- Added `layout` to replace the original `horizontal`、`vertical`、`inline`. [#5056](https://github.com/ant-design/ant-design/issues/5056)
|
||||
- Added `layout` to replace the original `horizontal`, `vertical`, `inline`. [#5056](https://github.com/ant-design/ant-design/issues/5056)
|
||||
- Calendar
|
||||
- Added `dateFullCellRender` and `monthFullCellRender` to allow override the content of cell. [#5138](https://github.com/ant-design/ant-design/pull/5138) [@wonyun](https://github.com/wonyun)
|
||||
- Added `onSelect` for date selection. [demo](https://ant.design/components/calendar-cn/#components-calendar-demo-select)
|
||||
@@ -315,7 +687,7 @@ If you want to read change logs before `2.0.0`, please visit [GitHub](https://gi
|
||||
- Fix that `Cannot find module '../../package.json'` error. [#4935](https://github.com/ant-design/ant-design/issues/4935)
|
||||
- Fix definitions of Table, RangePicker and Upload.
|
||||
- Fix lack of event argument for Modal `onOk` `afterClose` and Popconfirm `onConfirm` `onCancel`. [#4787](https://github.com/ant-design/ant-design/issues/4787)
|
||||
- Improve animation of Menu[inline] and Collapse.
|
||||
- Improve animation of Menu inline mode and Collapse.
|
||||
- Improve Checkbox and Radio vertical align style.
|
||||
- Table
|
||||
- Fix misplace header when fix column. [#4936](https://github.com/ant-design/ant-design/issues/4936)
|
||||
@@ -394,7 +766,7 @@ If you want to read change logs before `2.0.0`, please visit [GitHub](https://gi
|
||||
- **Tabs** Fix content missing problem since the second tab pane under IE9. [#4795](https://github.com/ant-design/ant-design/issues/4795)
|
||||
- **rc-pagination** Upgrade to ~1.7.0, add pageSize as onChange's second argument.
|
||||
- **Global optimization**
|
||||
- Make some bugfixes and optimizations about documentation、link and style.
|
||||
- Make some bugfixes and optimizations about documentation, link and style.
|
||||
- Use stylelint instead of lesslint, and fix some lint issues. [#2179](https://github.com/ant-design/ant-design/issues/2179)
|
||||
- Unify border radius to 4px. [#4772](https://github.com/ant-design/ant-design/issues/4772)
|
||||
- Support `import { version } from 'antd'`. [#4751](https://github.com/ant-design/ant-design/pull/4751)
|
||||
@@ -439,7 +811,7 @@ If you want to read change logs before `2.0.0`, please visit [GitHub](https://gi
|
||||
* Fixed Badge misplace issue when browser zoom above 100%. [#4747](https://github.com/ant-design/ant-design/issues/4747) [#4290](https://github.com/ant-design/ant-design/issues/4290)
|
||||
* Fixed a mis-align issue of fixed header Table. [#4750](https://github.com/ant-design/ant-design/issues/4750)
|
||||
* Fixed Table scrolling lag issue in IE. [#4522](https://github.com/ant-design/ant-design/issues/4522)
|
||||
* Add icon aliases: `addfile` => `file-add`,`addfolder` => `folder-open`, and the old type names are still working. [#4758](https://github.com/ant-design/ant-design/issues/4758)
|
||||
* Add icon aliases: `addfile` => `file-add`, `addfolder` => `folder-open`, and the old type names are still working. [#4758](https://github.com/ant-design/ant-design/issues/4758)
|
||||
|
||||
## 2.6.4
|
||||
|
||||
@@ -452,7 +824,7 @@ If you want to read change logs before `2.0.0`, please visit [GitHub](https://gi
|
||||
* Table
|
||||
* Improve Table fixed header's scrollbar style.[#4637](https://github.com/ant-design/ant-design/issues/4637)
|
||||
* Fix issue resulting in Table's header flashes when `loading` is true in Safari.[#4622](https://github.com/ant-design/ant-design/issues/4622)
|
||||
* Fix multiple border issues. [#4647](https://github.com/ant-design/ant-design/issues/4647)、[#4635](https://github.com/ant-design/ant-design/issues/4635)
|
||||
* Fix multiple border issues. [#4647](https://github.com/ant-design/ant-design/issues/4647), [#4635](https://github.com/ant-design/ant-design/issues/4635)
|
||||
* Fix `showHeader`'s default value.[#4658](https://github.com/ant-design/ant-design/issues/4658)
|
||||
* Fix missing `TableColumnConfig` type.[#4660](https://github.com/ant-design/ant-design/issues/4660)
|
||||
|
||||
|
||||
@@ -17,10 +17,381 @@ timeline: true
|
||||
|
||||
---
|
||||
|
||||
## 2.13.4
|
||||
|
||||
`2017-09-29`
|
||||
|
||||
- 🐞 修复 Pagination 小号样式失效的问题。
|
||||
- 🐞 修复 Anchor 的样式错位。[#7712](https://github.com/ant-design/ant-design/issues/7712)
|
||||
- 🐞 修复 TreeSelect 搜索框下多余文字的问题。[#7703](https://github.com/ant-design/ant-design/issues/7703)
|
||||
- 🐞 修复 Form 校验文字跳动的问题。[#7730](https://github.com/ant-design/ant-design/issues/7730)
|
||||
- 🐞 修复各类型 Button Group 的 loading 样式。 [#7709](https://github.com/ant-design/ant-design/issues/7709)
|
||||
- 🐞 修复 placeholder 文本在某些情况下无法看清的问题。[#7365](https://github.com/ant-design/ant-design/issues/7365)
|
||||
- 🐞 修复一个 Mention 的 `suggestion.toLowerCase is not a function` 报错问题。 [#7696](https://github.com/ant-design/ant-design/issues/7696) [@kappa-gooner](https://github.com/kappa-gooner)
|
||||
- 🐞 修复一个 Layout.Sider 子元素的高度问题。[#7716](https://github.com/ant-design/ant-design/pull/7716) [@zheeeng](https://github.com/zheeeng)
|
||||
- 🐞 修复 Dropdown 菜单分组的样式。
|
||||
- 🐞 修复 Table 筛选图标和菜单样式错位。
|
||||
- 🐞 修复一个 AutoComplete 在 Inferno 下循环引用的问题。[#7742](https://github.com/ant-design/ant-design/pull/7742) [@menberg](https://github.com/menberg)
|
||||
- 🐞 修复 Upload 使用 `beforeUpload` 验证文件类型失败后无法再次上传的问题。[#7762](https://github.com/ant-design/ant-design/issues/7762) [#6983](https://github.com/ant-design/ant-design/issues/6983)
|
||||
- TypeScript
|
||||
- 🐞 修复 Input 的 `maxLength` 定义。[#7744](https://github.com/ant-design/ant-design/pull/7744) [@delesseps](https://github.com/delesseps)
|
||||
- 🐞 修复 DatePicker 等组件的 `disabledTime` 的返回值定义。[#7740](https://github.com/ant-design/ant-design/pull/7740) [@778758944](https://github.com/778758944)
|
||||
|
||||
## 2.13.3
|
||||
|
||||
`2017-09-22`
|
||||
|
||||
- 🐞 修复 Affix 在内容与视口高度差小于 children 高度时触发的滚动抖动问题。[#2349](https://github.com/ant-design/ant-design/issues/2349)
|
||||
- 🐞 修复 `Card[title]` 为空且设置 `Card[extra]` 时样式错乱的问题。[f46112d#commitcomment-24480417](https://github.com/ant-design/ant-design/commit/f46112d38561c89780eb44ecbba82347d2b912da#commitcomment-24480417)
|
||||
- 🐞 修复 `Checkbox[children]` TypeScript definition。[#7650](https://github.com/ant-design/ant-design/issues/7650) [@liaokaien](https://github.com/liaokaien)
|
||||
- 🐞 修复 `getFieldDecorator` 内使用嵌套 id 后点击 `Form.Item` label 报错的问题。[#7693](https://github.com/ant-design/ant-design/issues/7693)
|
||||
- Input
|
||||
- 🐞 修复 `Input.Group[compat]` 内嵌 `Select` 等控件时的样式问题。[#7662](https://github.com/ant-design/ant-design/issues/7662)
|
||||
- 🐞 优化 `Input[autoComplete]` TypeScript 定义。[#7699](https://github.com/ant-design/ant-design/pull/7699) [@delesseps](https://github.com/delesseps)
|
||||
- LocaleProvider
|
||||
- 🇵🇹 新增葡萄牙语。[#7449](https://github.com/ant-design/ant-design/pull/7449) [@taviroquai](https://github.com/taviroquai)
|
||||
- 🐞 修复荷兰语 locale 缺少文案的问题。[#7694](https://github.com/ant-design/ant-design/pull/7694) [@kstiopin](https://github.com/kstiopin)
|
||||
- Table
|
||||
- 🐞 修复 `rowSelection` 导致的表头高度问题。[#7663](https://github.com/ant-design/ant-design/issues/7663)
|
||||
- 🐞 修复使用 `rowSelection.hideDefaultselections` 时导致自定义选项点击没反应的问题。[#7626](https://github.com/ant-design/ant-design/issues/7626) [@infeng](https://github.com/infeng)
|
||||
- 🐞 优化 `Table[scroll]` TypeScript definition。[#7640](https://github.com/ant-design/ant-design/pull/7640) [@BlackGanglion](https://github.com/BlackGanglion)
|
||||
|
||||
## 2.13.2
|
||||
|
||||
`2017-09-15`
|
||||
|
||||
- 🐞 修复了 Card Extra 内容过多样式错乱的问题。[#7604](https://github.com/ant-design/ant-design/issues/7604)
|
||||
- 🐞 修复了分组 Menu 收缩时的错位问题。[#7109](https://github.com/ant-design/ant-design/issues/7109)
|
||||
- 🐞 回滚 [#7142](https://github.com/ant-design/ant-design/issues/7142) 里对固定列表格空数据的样式优化,修复带来的一系列样式问题。
|
||||
- 🐞 修复了 Form `getFieldDecoratorOptions` 缺失 `normalize` 以及 `validateFirst` 属性定义的问题。[#7552](https://github.com/ant-design/ant-design/issues/7552) [@meteor91](https://github.com/meteor91) [@mitchelldemler](https://github.com/mitchelldemler)
|
||||
- 🐞 修复了 Modal 的 `zIndex` 属性定义。[#7624](https://github.com/ant-design/ant-design/issues/7624)
|
||||
- 🌟 优化了 Tree 加载中图标的显示位置。[#7584](https://github.com/ant-design/ant-design/issues/7584)
|
||||
- 🌟 优化了大量组件的英文文档。[@khalibloo](https://github.com/khalibloo)
|
||||
|
||||
## 2.13.1
|
||||
|
||||
`2017-09-10`
|
||||
|
||||
- 🐞 修复了 Card.Grid 的样式问题。[commit/c7d6ce](https://github.com/ant-design/ant-design/commit/c7d6ce5d3f7bfae1f2252d702fb1bdf04fdc80cb)
|
||||
- 🐞 修复了 Cascader 指针图标与文字重叠的问题。[#7475](https://github.com/ant-design/ant-design/issues/7475)
|
||||
- 🐞 修复了 Pagination 在简洁模式下前后按钮未展示的问题。[#7500](https://github.com/ant-design/ant-design/issues/7500)
|
||||
- 🐞 修复了 Slider 的 type 定义。[#7532](https://github.com/ant-design/ant-design/issues/7532)
|
||||
- Table
|
||||
- 🐞 修复了在空数据情况下包含固定列时的一些样式问题。[#7457](https://github.com/ant-design/ant-design/issues/7457) [#7468](https://github.com/ant-design/ant-design/issues/7468) [#7470](https://github.com/ant-design/ant-design/issues/7470) [#7509](https://github.com/ant-design/ant-design/issues/7509)
|
||||
- 🌟 补充了 API 文档。[#7525](https://github.com/ant-design/ant-design/pull/7525) [@hansnow](https://github.com/hansnow)
|
||||
- 🐞 修复了 Upload 的 type 定义。 [#7507](https://github.com/ant-design/ant-design/pull/7507) [@WingGao](https://github.com/WingGao)
|
||||
- 🐞 修复了 Submenu 展开时 inlineCollapsed Menu 的样式问题。[#7514](https://github.com/ant-design/ant-design/issues/7514)
|
||||
- 🐞 修复了一些表单控件的校验样式问题。[#7498](https://github.com/ant-design/ant-design/issues/7498)
|
||||
- 🐞 修复了 @link-hover-decoration 无效的问题。[#7531](https://github.com/ant-design/ant-design/issues/7531)
|
||||
- 🌟 优化了部分组件的英文文档。[@khalibloo](https://github.com/khalibloo)
|
||||
|
||||
## 2.13.0
|
||||
|
||||
`2017-09-01`
|
||||
|
||||
- 🌟 Popconfirm 和 Modal 及其相关方法新增 `okType` 和 `cancelType` 用以指定按钮类型。[#6848](https://github.com/ant-design/ant-design/pull/6848) [@yociduo](https://github.com/yociduo)
|
||||
- 🌟 Modal 及其相关方法新增 `zIndex`。[#6880](https://github.com/ant-design/ant-design/pull/6880) [@Alex1990](https://github.com/Alex1990)
|
||||
- 🌟 RadioGroup 新增 `name` 属性。[#7009](https://github.com/ant-design/ant-design/pull/7009) [@djyde](https://github.com/djyde)
|
||||
- 🌟 Table 新增 `hideDefaultSelections` 属性。[#7295](https://github.com/ant-design/ant-design/issues/7295)
|
||||
- Dropdown
|
||||
- 🌟 新增 `disabled` 属性。[#7102](https://github.com/ant-design/ant-design/pull/7102) [@yociduo](https://github.com/yociduo)
|
||||
- 🌟 Menu 默认调整为不能选中。
|
||||
- 🌟 Pagination 的 `itemRender` 新增第三个参数 `originalElement`。
|
||||
- 🌟 AutoComplete 新增 `backfill` 属性,键盘选择时能回填选中项到输入框中。[#5764](https://github.com/ant-design/ant-design/issues/5764)
|
||||
- 🌟 Select 新增 `firstActiveValue` 属性,允许指定首次打开时默认选中的项。[#6318](https://github.com/ant-design/ant-design/issues/6318) [@L-x-C](https://github.com/ant-design/ant-design/issues/6318)
|
||||
- LocaleProvider
|
||||
- 🌟 新增波斯语。[#6878](https://github.com/ant-design/ant-design/pull/6878) [@mkermani144](https://github.com/mkermani144)
|
||||
- 🌟 新增希腊语。[#6928](https://github.com/ant-design/ant-design/pull/6928) [@michmach](https://github.com/michmach)
|
||||
- 🌟 新增挪威语。[#7122](https://github.com/ant-design/ant-design/pull/7122) [@santi](https://github.com/santi)
|
||||
- 🌟 新增塞尔维亚语。[#7201](https://github.com/ant-design/ant-design/pull/7201) [@paunovic-stefan](https://github.com/paunovic-stefan)
|
||||
- 🐞 修复 Sider 隐藏时 Menu 的标题不会隐藏的问题。[#7409](https://github.com/ant-design/ant-design/issues/7409)
|
||||
- 🐞 修复 TypeScript 定义 [#7355](https://github.com/ant-design/ant-design/pull/7355) [#7378](https://github.com/ant-design/ant-design/pull/7378) [#7384](https://github.com/ant-design/ant-design/pull/7384)
|
||||
- 🐞 修复一些组件不能使用条件渲染的问题。[#6530](https://github.com/ant-design/ant-design/issues/6530)
|
||||
- 网站
|
||||
- 🌟 新增快捷键 `s` 聚焦搜索框。
|
||||
- 🌟 页脚新增主色修改预览功能。
|
||||
|
||||
## 2.12.8
|
||||
|
||||
`2017-08-27`
|
||||
|
||||
- 📖 重写了 [《在 create-react-app 中使用》](/docs/react/use-with-create-react-app) 文档,现在不再需要 eject。[#7276](https://github.com/ant-design/ant-design/pull/7276)
|
||||
- 🌟 优化了固定列的空表格样式。[#7298](https://github.com/ant-design/ant-design/issues/7298)
|
||||
- 🐞 修复了 CheckboxGroup 和 Checkbox 的 `disabled` 属性逻辑。[#7266](https://github.com/ant-design/ant-design/issues/7266) [@dilidili](https://github.com/dilidili)
|
||||
- 🐞 修复在 react-snapshot 或 jsdom 环境下测试 Spin 和 Carousel 时报错的问题。[#3308](https://github.com/ant-design/ant-design/issues/3308) [#7318](https://github.com/ant-design/ant-design/issues/7318)
|
||||
- 🐞 修复 Select、Tooltip、Menu 的一些细节样式问题。
|
||||
|
||||
## 2.12.7
|
||||
|
||||
`2017-08-21`
|
||||
|
||||
- Angular@4.0 版 antd [ng-zorro-antd](https://ng.ant.design) 开源。
|
||||
- 优化 Affix 支持的场景。[01d4acb](https://github.com/ant-design/ant-design/commit/01d4acb7a9b030be3552b4ca19b4e899dc2bb7c7)
|
||||
- 修复 AutoComplete children ref 失效的问题。[#6814](https://github.com/ant-design/ant-design/issues/6814)
|
||||
- Button
|
||||
- 优化自动在中文字符中间插入空格的逻辑。[59b11f3](https://github.com/ant-design/ant-design/commit/59b11f3b480d43cb32fb24e351cb4c4dd569243c)
|
||||
- 修复点击事件的 `event.target` 不是 button 的问题。[#7034](https://github.com/ant-design/ant-design/issues/7034)
|
||||
- 修复 Carousel 的 `innerSlider` 引用问题。[#7191](https://github.com/ant-design/ant-design/issues/7191)
|
||||
- 修复 DatePicker 中的按钮样式。[ad6dbcb](https://github.com/ant-design/ant-design/commit/ad6dbcb9c6dac407a38f2391d3e5fa1d8ae1cfab)
|
||||
- 修复 Form TypeScript definition。[#7245](https://github.com/ant-design/ant-design/pull/7245)
|
||||
- 修复 InputNumber 的 TypeScript definition。[#7257](https://github.com/ant-design/ant-design/issues/7257)
|
||||
- 修复 `Layout.Sider` 在 IE11 下没有折叠动画的问题。[#6349](https://github.com/ant-design/ant-design/issues/6349)
|
||||
- 修复 LocaleProvider 西班牙语的拼写问题。[#7234](https://github.com/ant-design/ant-design/pull/7234) [@ramsesmoreno](https://github.com/ramsesmoreno)
|
||||
- 修复 notification 默认 placement 会被覆盖的问题。[#5895](https://github.com/ant-design/ant-design/issues/5895)
|
||||
- 修复 Pagination 按钮的 disabled 样式。[cf3c0aa](https://github.com/ant-design/ant-design/commit/cf3c0aac43e2825bfd85ca3b8abbf4742e504260)
|
||||
- 修复 Select exports 导致的 webpack 构建错误的问题。[#7222](https://github.com/ant-design/ant-design/issues/7222)
|
||||
- 修复 Tabs 在父容器宽度动态变化时切换按钮没有出现的问题。[#7231](https://github.com/ant-design/ant-design/issues/7231) [#7210](https://github.com/ant-design/ant-design/issues/7210)
|
||||
- 修复 Timeline 在只有一个 `Timeline.Item` 时的样式问题。[#7214](https://github.com/ant-design/ant-design/issues/7214)
|
||||
- 修复 Upload 在 uid 为 0 时的错误行为。[#7269](https://github.com/ant-design/ant-design/issues/7269)
|
||||
|
||||
## 2.12.6
|
||||
|
||||
`2017-08-11`
|
||||
|
||||
- 修复了在 IE9/10/11 下 Collapse 的箭头位置不正确的问题。[af9dc73](https://github.com/ant-design/ant-design/commit/af9dc73eef2aac3e68fdfc99f9231153437f5068)
|
||||
- 修复了 Table 为空表格时滚动条展示位置不正确的问题。[#7142](https://github.com/ant-design/ant-design/issues/7142)
|
||||
- 修复了 RangePicker Input 的高度。[47c5de2](https://github.com/ant-design/ant-design/commit/47c5de29f370a77fc19a6a8eda8ac57476f312a6)
|
||||
- Card
|
||||
- 优化了 Card.Grid 边框覆盖的样式。[807b573](https://github.com/ant-design/ant-design/commit/807b573bff43bc71115afeb086f565561807a32d)
|
||||
- 修复了对应 `no-animation` 类型的 className。[#7185](https://github.com/ant-design/ant-design/issues/7185)
|
||||
- 修复了 Input Safari 下文本对齐的问题。[#7135](https://github.com/ant-design/ant-design/issues/7135)
|
||||
- Layout
|
||||
- 修复了组件的拉伸展示问题。[500b222](https://github.com/ant-design/ant-design/commit/500b2225567f03397d9faec5f4e60a8f35fc4d28)
|
||||
- 修复了折叠箭头的位置。[f689ede](https://github.com/ant-design/ant-design/commit/f689ede0fa836dd0d99f4e4d96e0c43d0ff19742)
|
||||
- 修复了 Upload 的 response 不是 string 的情况下没有处理错误提示信息的问题。[#6818](https://github.com/ant-design/ant-design/issues/6818)
|
||||
- Form
|
||||
- 补充了文档中缺少的 `validateFirst` 属性描述。[#6959](https://github.com/ant-design/ant-design/issues/6959)
|
||||
- 修复了 `wrappedComponentRef`。[#6545](https://github.com/ant-design/ant-design/issues/6545)
|
||||
- 补充了 FormCreateOption 的 `generic type`。[#7119](https://github.com/ant-design/ant-design/pull/7119) [@djyde](https://github.com/djyde)
|
||||
- 修改了 `square` 的字体大小为 `@form-feedback-icon-size`。[9bcde59](https://github.com/ant-design/ant-design/commit/9bcde590015855a12fdee851cf4e4836d0195cd7)
|
||||
|
||||
## 2.12.5
|
||||
|
||||
`2017-08-07`
|
||||
|
||||
- 修复 ES 模式下报 `SelectPropTypes not found` 的问题。[#7123](https://github.com/ant-design/ant-design/issues/7123)
|
||||
- 修复 Row 在 flex 模式下元素不换行的问题。[4f73a23](https://github.com/ant-design/ant-design/commit/4f73a23a103733a3c148bb04013493a042f90a8f)
|
||||
- 修复 InputNumber 和 RangePicker 的样式问题。[#7117](https://github.com/ant-design/ant-design/issues/7117) [#7126](https://github.com/ant-design/ant-design/issues/7126)
|
||||
|
||||
## 2.12.4
|
||||
|
||||
`2017-08-06`
|
||||
|
||||
- 修复了 Affix 在 IE 下调用对象无效的报错。[#7060](https://github.com/ant-design/ant-design/issues/7060)
|
||||
- 对 Badge 默认 title 的出现条件进行了优化。[#7024](https://github.com/ant-design/ant-design/issues/7024)
|
||||
- Card
|
||||
- 修改了文档中 `onHovering` 属性的错误描述。[#7078](https://github.com/ant-design/ant-design/issues/7078)
|
||||
- 修复了 `children` 的类型定义。[pull/7030](https://github.com/ant-design/ant-design/pull/7030) [@djyde](https://github.com/djyde)
|
||||
- 修复了 Collapse `onChange` 属性参数的类型定义。[pull/7084](https://github.com/ant-design/ant-design/pull/7084) [@davidctj](https://github.com/davidctj)
|
||||
- Dropdown
|
||||
- 修复了 Dropdown.Button 的对齐问题。[#7070](https://github.com/ant-design/ant-design/issues/7070)
|
||||
- 补充了文档中缺失的 `size` 属性。[pull/7071](https://github.com/ant-design/ant-design/pull/7071) [@hansnow](https://github.com/hansnow)
|
||||
- Input
|
||||
- 修复了 outline 被 addon 遮盖的问题。[commit/0f63c7](https://github.com/ant-design/ant-design/commit/0f63c7186ef3a5db36c01df9d9ebde9d5b3871ef)
|
||||
- 修复了 InputGroup 的示例问题。[pull/7089](https://github.com/ant-design/ant-design/pull/7089) [@jdz321](https://github.com/jdz321)
|
||||
- 修复了 InputNumber 格式化示例的报错问题。[pull/7098](https://github.com/ant-design/ant-design/pull/7098) [@tim-soft](https://github.com/tim-soft)
|
||||
- Menu
|
||||
- 修复了 Menu 折叠并缩起时的不正常表现。[#7048](https://github.com/ant-design/ant-design/issues/7048) [#7063](https://github.com/ant-design/ant-design/issues/7063)
|
||||
- 修复了子菜单被选中时 SubMenu 没有高亮的问题。[pull/7042](https://github.com/ant-design/ant-design/pull/7042) [@atomgao](https://github.com/atomgao)
|
||||
- 修复了 notification `type` 的类型定义。[#7073](https://github.com/ant-design/ant-design/issues/7073) [@marswong](https://github.com/marswong)
|
||||
- 修复了 Pagination `showTotal` 的类型定义。[#7054](https://github.com/ant-design/ant-design/issues/7054)
|
||||
- 修复了 RangePicker 在清空后的报错问题。[#7077](https://github.com/ant-design/ant-design/issues/7077)
|
||||
- 补充了 Select 缺失的 `onFocus` `onBlur` 类型定义。[pull/7082](https://github.com/ant-design/ant-design/pull/7082) [@troynt](https://github.com/troynt)
|
||||
- 修复了 Tabs 垂直模式下 `tabBarExtraContent` 样式错乱的问题。rc-tabs 升级到 9.0.2,对 TabBar 的 `extraContent` 的结构进行了重构。[#6578](https://github.com/ant-design/ant-design/issues/6578)
|
||||
- 修复了 TreeSelect 图标不能正常展示的问题。[#7020](https://github.com/ant-design/ant-design/issues/7020)
|
||||
- 修复了 `error TS7016: Could not find a declaration file for module 'rc-util/lib/Dom/addEventListener'` 的报错。[#7033](https://github.com/ant-design/ant-design/issues/7033) [@djyde](https://github.com/djyde)
|
||||
- 完成了『模式-列表』的文档翻译。[list](https://ant.design/docs/pattern/list) [@zachguo](https://github.com/zachguo)
|
||||
|
||||
## 2.12.3
|
||||
|
||||
`2017-07-30`
|
||||
|
||||
- 修复 Checkbox 半选状态禁用时的样式。
|
||||
- 修复 Card 会出现 `this.container` 不存在的问题。[#6976](https://github.com/ant-design/ant-design/pull/6976) [@neekey](https://github.com/neekey)
|
||||
- 修复基础字体改为 `14px` 时 Button 的对齐问题。[#7001](https://github.com/ant-design/ant-design/issues/7001)
|
||||
- 修复 Grid Card 的内边距。
|
||||
- Dropdown
|
||||
- 修复菜单可能被多次点击的问题。[#6314](https://github.com/ant-design/ant-design/issues/6314)
|
||||
- 修复在菜单显示前 hover 会导致菜单消失的问题。[#6949](https://github.com/ant-design/ant-design/issues/6949)
|
||||
- 修复菜单的错位问题。
|
||||
- 改进了 Menu 的动画效果。[#6955](https://github.com/ant-design/ant-design/pull/6955)
|
||||
- 调整了 DatePicker 中图标的位置。
|
||||
- 新增 less 变量。[e1a46cc](https://github.com/ant-design/ant-design/commit/e1a46cc419fb4975ae1782ba793b378c8e584057)
|
||||
- 修复了一些 TypeScript 定义问题。
|
||||
|
||||
## 2.12.2
|
||||
|
||||
`2017-07-22`
|
||||
|
||||
- 将 message 默认出现的时长从 1.5s 调整为 3s。
|
||||
- 重构了 Anchor,修复未滚动时链接没有高亮的问题。[#6473](https://github.com/ant-design/ant-design/issues/6473)
|
||||
- 修复 Input.TextArea 的失效样式。[#6858](https://github.com/ant-design/ant-design/pull/6858) [@lyz810](https://github.com/lyz810)
|
||||
- 修复 TimePicker 的失效样式。[#6918](https://github.com/ant-design/ant-design/issues/6918)
|
||||
- 修复 2.12.1 里再次出现的表单反馈图标和下拉图标重叠的问题。[#4431](https://github.com/ant-design/ant-design/issues/4431)
|
||||
- 修复垂直 Tabs 的切换箭头样式。[255eac9](https://github.com/ant-design/ant-design/commit/255eac907949ded5b79f216a29831dcf4afa9362)
|
||||
- 调整波兰语的文案。[#6869](https://github.com/ant-design/ant-design/pull/6869) [#6870](https://github.com/ant-design/ant-design/pull/6870) [#6871](https://github.com/ant-design/ant-design/pull/6871) [@imosapatryk](https://github.com/imosapatryk)
|
||||
- 修复源码中含有 http 的链接而被集团安全扫描工具报错的问题。[#6893](https://github.com/ant-design/ant-design/issues/6893)
|
||||
- 调整 Menu 的图标和文字对齐问题。
|
||||
- 修复一个 Tooltip 的 `overlay is marked as required` 的警告问题。[#6897](https://github.com/ant-design/ant-design/issues/6897)
|
||||
- 修复 Slider 在有色背景下的失效样式。[#6665](https://github.com/ant-design/ant-design/issues/6665)
|
||||
- 调整了 TreeSelect 选项的点击范围。
|
||||
- 修复了一些 TypeScript 定义问题。
|
||||
|
||||
## 2.12.1
|
||||
|
||||
`2017-07-17`
|
||||
|
||||
- 修复保加利亚语中的拼写错误。[#6788](https://github.com/ant-design/ant-design/pull/6788) [@NoHomey](https://github.com/NoHomey)
|
||||
- 修复 `<Avatar src="..." />` 无法加载图片时的样式问题。[#6804](https://github.com/ant-design/ant-design/issues/6804)
|
||||
- 修复 `Button.Group` 内使用 loading 状态的图标按钮时的样式问题。[#6822](https://github.com/ant-design/ant-design/issues/6822)
|
||||
- 修复 Checkbox TypeScript 定义问题。[#6768](https://github.com/ant-design/ant-design/issues/6768)
|
||||
- 修复 `Collapse.Panel[header]` 内容过长时的样式问题。[#6832](https://github.com/ant-design/ant-design/issues/6832)
|
||||
- Input
|
||||
- 修复 `className` 没有添加到 wrapper 上的问题。[#6809](https://github.com/ant-design/ant-design/issues/6809)
|
||||
- 修复 `Input.Search` 的 TypeScript 定义。[#6837](https://github.com/ant-design/ant-design/pull/6837) [@newraina](https://github.com/newraina)
|
||||
- 修复 `Input.TextArea` 的 value 无法被重置的问题。[#6776](https://github.com/ant-design/ant-design/issues/6776)
|
||||
- 修复 `Input.Group` 内使用 Select 组件时的 error 样式问题。
|
||||
|
||||
<img src="https://user-images.githubusercontent.com/507615/27983847-551ffe0a-63f9-11e7-81ba-8c3336ddafd0.png" />
|
||||
|
||||
- 修复 Layout 实现影响 Anchor、BackTop 的功能的问题。[#6817](https://github.com/ant-design/ant-design/issues/6817)
|
||||
- Menu
|
||||
- 修复折叠动画失效问题。
|
||||
- 修复 `Menu.Item` 边框样式问题。[46ffda9](https://github.com/ant-design/ant-design/commit/46ffda9c9385ec54e0c78594ed6c280d40ef035d)
|
||||
- 修复 RangePicker 设置了 `value|defaultValue` 后,浮层中的月份展示不对的问题。[#6764 point 3](https://github.com/ant-design/ant-design/issues/6764)
|
||||
- 修复 Tooltip 对齐问题。[#6830](https://github.com/ant-design/ant-design/issues/6830)
|
||||
|
||||
## 2.12.0
|
||||
|
||||
`2017-07-08`
|
||||
|
||||
- 新增 Card `noHovering` 属性以及 Card.Grid 组件。[pull/6748](https://github.com/ant-design/ant-design/pull/6748)
|
||||
- DatePicker、MonthPicker、RangePicker 支持 `className` 属性。[pull/6584](https://github.com/ant-design/ant-design/pull/6584) [@EnrikoLabriko](https://github.com/EnrikoLabriko)
|
||||
- 新增 Input.TextArea,原 Input[type='textArea'] 将被废弃。[pull/6138](https://github.com/ant-design/ant-design/pull/6138)
|
||||
- LocaleProvider 新增泰语支持。[pull/6721](https://github.com/ant-design/ant-design/pull/6721) [@koobitor](https://github.com/koobitor)
|
||||
- Mention 支持 `focus` 方法。[#6135](https://github.com/ant-design/ant-design/issues/6135)
|
||||
- Menu `inline` 模式下支持用 `inlineCollapsed` 属性缩起/展开,同时 Layout.Sider 使用 `context` 向 Menu 传递 `collapsed` 属性,无需再自己定制样式。[pull/6686](https://github.com/ant-design/ant-design/pull/6686)
|
||||
- 新增 Pagination `itemRender` 属性,用于自定义页码的结构。[25a603](https://github.com/ant-design/ant-design/commit/25a60322e5c6649522fb9f0d34919eba0ccb1f65)
|
||||
- 新增 Tooltip `autoAdjustOverflow` 属性,支持关闭自动调整位置的功能。[pull/6661](https://github.com/ant-design/ant-design/pull/6661) [@jdz321](https://github.com/jdz321)
|
||||
- 修复了 Avatar 错误的文档。[pull/6711](https://github.com/ant-design/ant-design/pull/6711) [@llaski](https://github.com/llaski)
|
||||
- DatePicker
|
||||
- 修复 `onOk` 类型定义。[pull/6619](https://github.com/ant-design/ant-design/pull/6619) [@newraina](https://github.com/newraina)
|
||||
- 优化了图标样式。[pull/6655](https://github.com/ant-design/ant-design/pull/6655) [@megawac](https://github.com/megawac)
|
||||
- Form
|
||||
- 修复 FormItem `extra` 文案的行高问题。[#6618](https://github.com/ant-design/ant-design/issues/6618)
|
||||
- 修复 FormItem `labelCol` `wrapperCol` 类型定义。[pull/6611](https://github.com/ant-design/ant-design/pull/6611) [@newraina](https://github.com/newraina)
|
||||
- 修复自适应高度的 Input 文本域出现滚动条的问题。[#6609](https://github.com/ant-design/ant-design/issues/6609)
|
||||
- 补充了 InputNumber 中缺失的 `precision` 类型定义。[#6715](https://github.com/ant-design/ant-design/issues/6715)
|
||||
- 修复 Select 样式溢出的问题。[#6621](https://github.com/ant-design/ant-design/issues/6621)
|
||||
- Slider
|
||||
- 优化了样式。[#6665](https://github.com/ant-design/ant-design/issues/6665)
|
||||
- rc-slider 升级至 8.2.0,新增 `dotStyle`,`activeDotStyle` 属性。[rc-slider/pull/292](https://github.com/react-component/slider/pull/292)
|
||||
- 修复 Spin 遮罩层被穿透的样式问题。[#6759](https://github.com/ant-design/ant-design/issues/6759)
|
||||
- 修复嵌套 Steps 的样式问题。[#6754](https://github.com/ant-design/ant-design/issues/6754)
|
||||
- Table
|
||||
- 修复了固定头部 Table 中展开区域的背景色样式问题。[#6657](https://github.com/ant-design/ant-design/issues/6657)
|
||||
- 补充了 Table 文档中缺失的 `onRowDoubleClick` 属性。[pull/6667](https://github.com/ant-design/ant-design/pull/6667) [@yurtaev](https://github.com/yurtaev)
|
||||
- 补充了 Table 文档中 `loading` 属性的说明。[pull/6763](https://github.com/ant-design/ant-design/pull/6763) [@hansnow](https://github.com/hansnow)
|
||||
- rc-table 升级至 5.4.0,新增对 `onRowMouseEnter`,`onRowMouseLeave` 的支持。[rc-table/0db582](https://github.com/react-component/table/commit/0db582a75dfa119715eb4db8a59eacfca744c5a0)
|
||||
- 优化了 TimePicker 的格式支持。[950c32](https://github.com/ant-design/ant-design/commit/950c321b25091ef31b130b83674478974590d7f3)
|
||||
- 对大量组件的样式进行了优化或微调,包括 [Checkbox](https://ant.design/components/checkbox/),[Radio](https://ant.design/components/radio/),[Tabs](https://ant.design/components/tabs/),[Card](https://ant.design/components/card/) 等等。
|
||||
- Demo 现在可以在 codepen 中打开。[#5140](https://github.com/ant-design/ant-design/issues/5140)
|
||||
|
||||
## 2.11.2
|
||||
|
||||
`2017-06-25`
|
||||
|
||||
- 修复 Dropdown.Button 不支持 `getPopupContainer` 方法的问题。[#6527](https://github.com/ant-design/ant-design/pull/6527)
|
||||
- 修复 Dropdown 子菜单 disabled 时的样式错误问题。[#6548](https://github.com/ant-design/ant-design/issues/6548)
|
||||
- 修复 Calendar 的背景颜色问题。 [aaf2a50](https://github.com/ant-design/ant-design/commit/aaf2a508bef96f81faf556036649b2a2fe5b635b)
|
||||
- Calender 的下拉菜单现在在 header 中显示。[#6479](https://github.com/ant-design/ant-design/pull/6479)
|
||||
- 修复 Input 和 Textarea 横向滚动的问题。[#6577](https://github.com/ant-design/ant-design/issues/6577)
|
||||
- 补充了 Checkbox 和 Radio 的 `disabled` 属性文档。[#6597](https://github.com/ant-design/ant-design/pull/6597)
|
||||
- 增大了 Table 的排序和过滤图标的可点击区域。[#6528](https://github.com/ant-design/ant-design/pull/6528)
|
||||
- 为 Table.props.onRowClick 函数增加了 event: Event 参数。[e2a99f5](https://github.com/ant-design/ant-design/commit/e2a99f53f7a27bd7de4adf99d0e1ee755b537c72)
|
||||
|
||||
## 2.11.1
|
||||
|
||||
`2017-06-18`
|
||||
|
||||
- 修复 Table 的分页设置 `className` 无效的问题。[#6416](https://github.com/ant-design/ant-design/issues/6416)
|
||||
- 修复 Tabs 嵌套使用时的样式问题。[#6431](https://github.com/ant-design/ant-design/issues/6431) [@sadmark](https://github.com/sadmark)
|
||||
- 修复 RadioButton 在小屏幕下会没有左侧边框的问题。[#6492](https://github.com/ant-design/ant-design/issues/6492) [@pierreneter](https://github.com/pierreneter)
|
||||
- 修复 RangePicker 底部会多一条边框的问题。
|
||||
- 完善 Dropdown.Button 类型定义。[#6482](https://github.com/ant-design/ant-design/pull/6482) [@newraina](https://github.com/newraina)
|
||||
|
||||
## 2.11.0
|
||||
|
||||
`2017-06-07`
|
||||
|
||||
- 新增头像组件 [Avatar](https://ant.design/components/avatar/)。🌝
|
||||
- LocaleProvider
|
||||
- 新增保加利亚语支持。[#6297](https://github.com/ant-design/ant-design/pull/6297) [@dimitrov-adrian](https://github.com/dimitrov-adrian)
|
||||
- 新增波兰语支持。[#6326](https://github.com/ant-design/ant-design/pull/6326) [@longersson](https://github.com/longersson)
|
||||
- 新增英式英语支持。[#6344](https://github.com/ant-design/ant-design/pull/6344) [@damiangreen](https://github.com/damiangreen)
|
||||
- 新增意大利语支持。[#6344](https://github.com/ant-design/ant-design/pull/6344) [@damiangreen](https://github.com/damiangreen)
|
||||
- 新增法语支持。[#6344](https://github.com/ant-design/ant-design/pull/6344) [@damiangreen](https://github.com/damiangreen)
|
||||
- 新增比利时语支持。[#6344](https://github.com/ant-design/ant-design/pull/6344) [@damiangreen](https://github.com/damiangreen)
|
||||
- Collapse.Panel 现在可以被禁用,禁用时无法通过用户交互改变面板打开/关闭状态。[#6119](https://github.com/ant-design/ant-design/issues/6119) [demo](https://ant.design/components/collapse/#components-collapse-demo-basic)
|
||||
- DatePicker 与 RangePicker 现在支持在弹层中渲染自定义 footer。[#6122](https://github.com/ant-design/ant-design/issues/6122) [#5188](https://github.com/ant-design/ant-design/issues/5188) [demo](https://ant.design/components/date-picker/#components-date-picker-demo-extra-footer)
|
||||
- InputNumber 现在可以通过 `precision` 单独设置精度,即精度与 `step` 可以不再绑定。[#5998](https://github.com/ant-design/ant-design/issues/5998)
|
||||
- TreeSelect 多选模式支持 `allowClear` 展示清除按钮。
|
||||
|
||||
- 优化 Pagination 对键盘操作的支持。[rc-pagination#83](https://github.com/react-component/pagination/pull/83) [@geramirez](https://github.com/geramirez)
|
||||
- 优化 Progress 样式。[#6354](https://github.com/ant-design/ant-design/issues/6354)
|
||||
- 优化 Slider 的可访问性支持。[#6301](https://github.com/ant-design/ant-design/pull/6301)
|
||||
|
||||
- 修复正在执行动画的元素可点击的问题。[#6314](https://github.com/ant-design/ant-design/issues/6314)
|
||||
- 修复时间类组件的 `Cannot read property '0' of undefined` 报错问题。[#6334](https://github.com/ant-design/ant-design/issues/6334)
|
||||
- DatePicker
|
||||
- 修复弹层错位的问题。[#6347](https://github.com/ant-design/ant-design/issues/6347)
|
||||
- 修复日期单元格 tooltip 的内容格式问题。[#5724](https://github.com/ant-design/ant-design/issues/5724) [@zefj](https://github.com/zefj)
|
||||
- 修复能通过键盘操作选择 disabled 日期的问题。[#6345](https://github.com/ant-design/ant-design/issues/6345)
|
||||
- 修复 Form `validateFieldsAndScroll` 不支持 nested fields 的问题。[#5410](https://github.com/ant-design/ant-design/issues/5410)
|
||||
- Input[addon]
|
||||
- 修复 style 属性失效的问题。[#6379](https://github.com/ant-design/ant-design/issues/6379)
|
||||
- 修复垂直对齐的问题。[#6403](https://github.com/ant-design/ant-design/issues/6403)
|
||||
- 修复 Modal.confirm onOk 返回的 Promise rejected 后用户无法重试的问题。[#6183](https://github.com/ant-design/ant-design/issues/6183)
|
||||
- 修复 Pagination 简单模式下输入框过小的问题。[#6339](https://github.com/ant-design/ant-design/issues/6339)
|
||||
- 修复 Select 在搜索模式下用户输入的内容被截断的问题。[#6382](https://github.com/ant-design/ant-design/issues/6382)
|
||||
- 修复 Spin 定时器没有被正确移除的问题。[#6383](https://github.com/ant-design/ant-design/issues/6383)
|
||||
- 修复 Switch 对 onClick 的支持。[#6373](https://github.com/ant-design/ant-design/issues/6373)
|
||||
- 修复 Table.Column TypeScript definition 导致 `error TS2304: Cannot find name 'T'` 的问题。[#6313](https://github.com/ant-design/ant-design/issues/6313)
|
||||
- 修复 Timeline.Item 和 Dropdown.Button 在 TypeScript 报 `does not have any construct or call signatures` 错中的问题。[#6356](https://github.com/ant-design/ant-design/issues/6356)
|
||||
- 修复 Tree、TreeSelect disabled 样式问题。[#6320](https://github.com/ant-design/ant-design/issues/6320)
|
||||
|
||||
## 2.10.4
|
||||
|
||||
`2017-06-01`
|
||||
|
||||
- 修正 `rc-util` 依赖。[#6310](https://github.com/ant-design/ant-design/pull/6311) [@bkniffler](https://github.com/bkniffler)
|
||||
- 修正 `es` 版本的语法错误。[#6310](https://github.com/ant-design/ant-design/issues/6310#issuecomment-305176273)
|
||||
|
||||
## 2.10.3
|
||||
|
||||
`2017-05-31`
|
||||
|
||||
- **Calendar**
|
||||
- 修复了样式问题以支持 disabledDate,补充了 Type 定义及文档。[#6074](https://github.com/ant-design/ant-design/issues/6074)
|
||||
- rc-calendar 依赖升级至 8.4.0,支持保加利亚语,支持首先选择结束日期。[commit/a4a6db](https://github.com/ant-design/ant-design/commit/a4a6db76de57ac2559a2be80208121ab5e168fbf)
|
||||
- **Alert** 去掉了默认的下边距。[commit/5ef482](https://github.com/ant-design/ant-design/commit/5ef48289747409b6d962f75627ddb11e2765f965)
|
||||
- **Tabs** 修复了隐藏标签下内容的表现问题。[#6237](https://github.com/ant-design/ant-design/issues/6237)
|
||||
- **Layout** 修复了折叠侧边栏中的内容不能自动隐藏的问题。[#6131](https://github.com/ant-design/ant-design/issues/6131)
|
||||
- **Table** 修复了 filter 被 Table 截断的问题。[#6245](https://github.com/ant-design/ant-design/issues/6245)
|
||||
- **InputNumber** 修复了配置 hasFeedback 时校验结果图标位置有误的问题。[#6289](https://github.com/ant-design/ant-design/issues/6289)
|
||||
- **Typescript**
|
||||
- typescript 升级至 2.3.x。[#6263](https://github.com/ant-design/ant-design/issues/6263)
|
||||
- 补充了 Table 的 type 定义. [commit/acdc56](https://github.com/ant-design/ant-design/commit/acdc563a547c49960521b2b48cd5c707ac1e4cf2) [pull/6291](https://github.com/ant-design/ant-design/pull/6291) [@jch254](https://github.com/jch254)
|
||||
- 修复了 Mention、Form 组件中错误的 type 定义. [pull/6268](https://github.com/ant-design/ant-design/pull/6268) [@jch254](https://github.com/jch254)
|
||||
- 修复了 Badge 组件中错误的 type 定义. [pull/6291](https://github.com/ant-design/ant-design/pull/6291) [@jch254](https://github.com/jch254)
|
||||
- 补充了 Input 相关组件的 type 定义。[pull/6276](https://github.com/ant-design/ant-design/pull/6276/commits/94901de2e8c0a2ed6f62f5aa50c98994aad71844) [@panjiesw](https://github.com/panjiesw) [commit/220264](https://github.com/ant-design/ant-design/commit/2202648d6e1c53409ade2141955232922b0040d6#diff-26cb6da96d10397e18e7dbd6c5d8f7a1L265) [@clinyong](https://github.com/clinyong)
|
||||
|
||||
## 2.10.2
|
||||
|
||||
`2017-05-23`
|
||||
|
||||
- 修复了 React 升级引起的 `prop-types` 相关的 warning 问题。[#5678](https://github.com/ant-design/ant-design/issues/5678)
|
||||
- 修复 DatePicker 和 RangePicker showTime 模式下 defaultValue 的问题。[#6160](https://github.com/ant-design/ant-design/pull/6160)
|
||||
- 修复 TreeSelect 的样式问题。[#6137](https://github.com/ant-design/ant-design/issues/6137)
|
||||
- 修复 包含 prefix 和 addon 的 Input 的样式问题。[#6144](https://github.com/ant-design/ant-design/issues/6144)
|
||||
- 修复 `notification.destroy` 的 Bug。[#6161](https://github.com/ant-design/ant-design/issues/6161)
|
||||
@@ -56,7 +427,7 @@ timeline: true
|
||||
- Checkbox.Group 可以内嵌 Checkbox,以支持更灵活的布局。[demo](http://ant.design/components/checkbox-cn/#components-checkbox-demo-layout)
|
||||
- Notification 现在可以自定义弹出框的样式和 className。[#5893](https://github.com/ant-design/ant-design/issues/5893) [@lixiaoyang1992](https://github.com/lixiaoyang1992)
|
||||
- TimePicker 的展开状态可以通过受控属性 `open` 控制。[#5913](https://github.com/ant-design/ant-design/pull/5913)
|
||||
- Upload[onRemove] 可以返回一个 promise 以异步控制移除逻辑。[#5973](https://github.com/ant-design/ant-design/issues/5973) [@shlice](https://github.com/shlice)
|
||||
- Upload `onRemove` 方法可以返回一个 Promise 用于异步控制移除逻辑。[#5973](https://github.com/ant-design/ant-design/issues/5973) [@shlice](https://github.com/shlice)
|
||||
- 调整 Dropdown 弹出层的边距。[#5088](https://github.com/ant-design/ant-design/issues/5088)
|
||||
- AutoComplete
|
||||
- 修复 dataSource 为 `Object[]` 时行为与 `String[]` 不一致的问题。[#5860](https://github.com/ant-design/ant-design/issues/5860)
|
||||
@@ -97,7 +468,6 @@ timeline: true
|
||||
- 优化了 RangePicker 的体验,rc-calendar 升级至 `~8.0.0`。[#4985](https://github.com/ant-design/ant-design/issues/4985)
|
||||
- 修复了 RangePicker 自定义高度后文字不能上下居中的问题。[pull/5718](https://github.com/ant-design/ant-design/pull/5718) [@leadream](https://github.com/leadream)
|
||||
- **Form** 增加样式变量来控制表单项标题冒号的展示。[pull/5855](https://github.com/ant-design/ant-design/pull/5855) [@megawac](https://github.com/megawac)
|
||||
- **Icon** 增加 displayName 属性。[pull/5643](https://github.com/ant-design/ant-design/pull/5643) [@handycode](https://github.com/handycode)
|
||||
- **Input**
|
||||
- 修复了 Input.Search 在 Input.Group 下的样式问题。[#5743](https://github.com/ant-design/ant-design/issues/5743)
|
||||
- 修复了 AutoComplete 在 Input.Group 下的样式问题。[#5832](https://github.com/ant-design/ant-design/issues/5832)
|
||||
@@ -192,7 +562,7 @@ timeline: true
|
||||
- 修复对俄语支持不完善的问题。[#5406](https://github.com/ant-design/ant-design/pull/5406) [@plandem](https://github.com/plandem)
|
||||
- 修复不支持 Upload 的问题。[#5388](https://github.com/ant-design/ant-design/pull/5388) [@natergj](https://github.com/natergj)
|
||||
- 修复 Menu 内 Icon 动画效果与文字不一致的问题。[#5495](https://github.com/ant-design/ant-design/issues/5495)
|
||||
- 修复 `Modale[footer]` 无法置空的问题。[#5462](https://github.com/ant-design/ant-design/issues/5462)
|
||||
- 修复 `Modal[footer]` 无法置空的问题。[#5462](https://github.com/ant-design/ant-design/issues/5462)
|
||||
- 修复 `2.8.2` 引入的 Pagination 在 `IE<=10` 下样式丢失的问题。[#5484](https://github.com/ant-design/ant-design/issues/5484)
|
||||
- 修复 Popover 内使用 Table 时会意外关闭的问题。[#5407](https://github.com/ant-design/ant-design/issues/5407)
|
||||
- 去掉 Radio 只能作为 Radio.Group 的直接后代的限制。[#5443](https://github.com/ant-design/ant-design/issues/5443)
|
||||
@@ -207,16 +577,16 @@ timeline: true
|
||||
`2017-03-19`
|
||||
|
||||
- 发布了新的 [设计基础文档](https://ant.design/docs/spec/colors-cn)。
|
||||
- 修复使用 Modal.confirm 时报错的问题。[#5269](https://github.com/ant-design/ant-design/issues/5269)。
|
||||
- 修复 Upload 的蒙层样式 [#5275](https://github.com/ant-design/ant-design/issues/5275)。
|
||||
- 修复 Upload 上传进度条不显示的问题 [#5323](https://github.com/ant-design/ant-design/issues/5323)。
|
||||
- 修复 Table 的分页的 showTotal 数据错误的问题 [#5259](https://github.com/ant-design/ant-design/issues/5259)。
|
||||
- 修复了 Popconfirm 与 Button 同时使用时的样式问题 [5301](https://github.com/ant-design/ant-design/issues/5301)。
|
||||
- 修复 Radio 的一个样式问题 [#5336](https://github.com/ant-design/ant-design/pull/5336)。
|
||||
- 修复 Message 的 getContainer 无法使用的问题 [#5380](https://github.com/ant-design/ant-design/issues/5380)。
|
||||
- 修复 Checkbox 和 Radio 标签的文字对齐 [696a3c0](https://github.com/ant-design/ant-design/commit/696a3c0e34156d78e87d629a3f0f8703af1f03ec)。
|
||||
- 调整了 Spin 的动画 [fa1e031](https://github.com/ant-design/ant-design/commit/fa1e031a7396c61fa9709a0c46fe63200c35d232)。
|
||||
- 调整了 Mention 的一些样式 [240a93c](https://github.com/ant-design/ant-design/commit/240a93cee25bc8c6ad4520cd907a14a7b22ed773)。
|
||||
- 修复使用 Modal.confirm 时报错的问题。[#5269](https://github.com/ant-design/ant-design/issues/5269)
|
||||
- 修复 Upload 的蒙层样式。[#5275](https://github.com/ant-design/ant-design/issues/5275)
|
||||
- 修复 Upload 上传进度条不显示的问题。[#5323](https://github.com/ant-design/ant-design/issues/5323)
|
||||
- 修复 Table 的分页的 showTotal 数据错误的问题。[#5259](https://github.com/ant-design/ant-design/issues/5259)
|
||||
- 修复了 Popconfirm 与 Button 同时使用时的样式问题。[#5301](https://github.com/ant-design/ant-design/issues/5301)
|
||||
- 修复 Radio 的一个样式问题。[#5336](https://github.com/ant-design/ant-design/pull/5336)
|
||||
- 修复 Message 的 getContainer 无法使用的问题。[#5380](https://github.com/ant-design/ant-design/issues/5380)
|
||||
- 修复 Checkbox 和 Radio 标签的文字对齐。 [696a3c0](https://github.com/ant-design/ant-design/commit/696a3c0e34156d78e87d629a3f0f8703af1f03ec)
|
||||
- 调整了 Spin 的动画。[fa1e031](https://github.com/ant-design/ant-design/commit/fa1e031a7396c61fa9709a0c46fe63200c35d232)
|
||||
- 调整了 Mention 的一些样式。[240a93c](https://github.com/ant-design/ant-design/commit/240a93cee25bc8c6ad4520cd907a14a7b22ed773)
|
||||
|
||||
## 2.8.1
|
||||
|
||||
@@ -315,7 +685,7 @@ timeline: true
|
||||
- 修复 `Cannot find module '../../package.json'` 的问题。[#4935](https://github.com/ant-design/ant-design/issues/4935)
|
||||
- 补充了 Table、RangePicker 和 Upload 的部分属性定义。
|
||||
- 修复了 Modal `onOk` `afterClose` 和 Popconfirm `onConfirm` `onCancel` 缺少点击 event 参数的问题。 [#4787](https://github.com/ant-design/ant-design/issues/4787)
|
||||
- 优化 Menu[inline] 和 Collapse 的折叠动画效果。
|
||||
- 优化 Menu inline 模式和 Collapse 的折叠动画效果。
|
||||
- 优化了 Checkbox 和 Radio 的垂直对齐样式。
|
||||
- Table
|
||||
- 修复固定列时列头样式错位的问题。[#4936](https://github.com/ant-design/ant-design/issues/4936)
|
||||
|
||||
46
CODE_OF_CONDUCT.md
Normal file
46
CODE_OF_CONDUCT.md
Normal file
@@ -0,0 +1,46 @@
|
||||
# Contributor Covenant Code of Conduct
|
||||
|
||||
## Our Pledge
|
||||
|
||||
In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
|
||||
|
||||
## Our Standards
|
||||
|
||||
Examples of behavior that contributes to creating a positive environment include:
|
||||
|
||||
* Using welcoming and inclusive language
|
||||
* Being respectful of differing viewpoints and experiences
|
||||
* Gracefully accepting constructive criticism
|
||||
* Focusing on what is best for the community
|
||||
* Showing empathy towards other community members
|
||||
|
||||
Examples of unacceptable behavior by participants include:
|
||||
|
||||
* The use of sexualized language or imagery and unwelcome sexual attention or advances
|
||||
* Trolling, insulting/derogatory comments, and personal or political attacks
|
||||
* Public or private harassment
|
||||
* Publishing others' private information, such as a physical or electronic address, without explicit permission
|
||||
* Other conduct which could reasonably be considered inappropriate in a professional setting
|
||||
|
||||
## Our Responsibilities
|
||||
|
||||
Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
|
||||
|
||||
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
|
||||
|
||||
## Scope
|
||||
|
||||
This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
|
||||
|
||||
## Enforcement
|
||||
|
||||
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at xingmin.zhu@alipay.com. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
|
||||
|
||||
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
|
||||
|
||||
## Attribution
|
||||
|
||||
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]
|
||||
|
||||
[homepage]: http://contributor-covenant.org
|
||||
[version]: http://contributor-covenant.org/version/1/4/
|
||||
@@ -56,7 +56,7 @@ ReactDOM.render(<DatePicker />, mountNode);
|
||||
import 'antd/dist/antd.css'; // or 'antd/dist/antd.less'
|
||||
```
|
||||
|
||||
按需加载可通过此写法 `import DatePicker from 'antd/lib/date-picker'` 或使用插件 [babel-plugin-import](https://github.com/ant-design/babel-plugin-import)。
|
||||
按需加载可通过此写法 `import DatePicker from 'antd/lib/date-picker'` 或使用 Babel 插件 [babel-plugin-import](https://github.com/ant-design/babel-plugin-import),或使用 TypeScript 插件 [ts-import-plugin](https://github.com/Brooooooklyn/ts-import-plugin)。
|
||||
|
||||
## TypeScript
|
||||
|
||||
@@ -112,7 +112,7 @@ $ npm start
|
||||
|
||||
在任何形式的参与前,请先阅读 [贡献者文档](https://github.com/ant-design/ant-design/blob/master/.github/CONTRIBUTING.md)。如果你希望参与贡献,欢迎 [Pull Request](https://github.com/ant-design/ant-design/pulls),或给我们 [报告 Bug](http://new-issue.ant.design/)。
|
||||
|
||||
> 强烈推荐阅读 [《提问的智慧》](https://github.com/ryanhanwu/How-To-Ask-Questions-The-Smart-Way)、[《如何向开源社区提问题》](https://github.com/seajs/seajs/issues/545) 和 [《如何有效地报告 Bug》](http://www.chiark.greenend.org.uk/%7Esgtatham/bugs-cn.html),更好的问题更容易获得帮助。
|
||||
> 强烈推荐阅读 [《提问的智慧》](https://github.com/ryanhanwu/How-To-Ask-Questions-The-Smart-Way)、[《如何向开源社区提问题》](https://github.com/seajs/seajs/issues/545) 和 [《如何有效地报告 Bug》](http://www.chiark.greenend.org.uk/%7Esgtatham/bugs-cn.html)、[《如何向开源项目提交无法解答的问题》](https://zhuanlan.zhihu.com/p/25795393),更好的问题更容易获得帮助。
|
||||
|
||||
## 社区互助
|
||||
|
||||
|
||||
39
README.md
39
README.md
@@ -29,13 +29,13 @@ An enterprise-class UI design language and React-based implementation.
|
||||
|
||||
## Environment Support
|
||||
|
||||
* Browser: Modern browsers and Internet Explorer 9+
|
||||
* Modern browsers and Internet Explorer 9+ (with [polyfills](https://ant.design/docs/react/getting-started#Compatibility))
|
||||
* Server-side Rendering
|
||||
* [Electron](http://electron.atom.io/)
|
||||
|
||||
## Let's build a better antd together [](http://makeapullrequest.com)
|
||||
|
||||
`antd` is an open source project, improvements are welcomed. If you are interested in contributing to `antd`, you can watch this repository, join in [discussion](https://github.com/ant-design/ant-design/issues?q=is%3Aopen+is%3Aissue+label%3ADiscussion), or try to implement some [features which have been accepted](https://github.com/ant-design/ant-design/issues?q=is%3Aopen+is%3Aissue+label%3A%22PR+welcome%22). Actually, there are [many ways](https://opensource.guide/how-to-contribute/) to contribute. And we are always happy to [offer collaborator permission](https://github.com/ant-design/ant-design/issues/3222) for some active contributors.
|
||||
`antd` is an open source project; improvements are welcomed. If you are interested in contributing to `antd`, you can watch this repository, join in [discussion](https://github.com/ant-design/ant-design/issues?q=is%3Aopen+is%3Aissue+label%3ADiscussion), or try to implement some [features which have been accepted](https://github.com/ant-design/ant-design/issues?q=is%3Aopen+is%3Aissue+label%3A%22PR+welcome%22). Actually, there are [many ways](https://opensource.guide/how-to-contribute/) to contribute. And we are always happy to [offer collaborator permission](https://github.com/ant-design/ant-design/issues/3222) for some active contributors.
|
||||
|
||||
## Install
|
||||
|
||||
@@ -58,7 +58,15 @@ import 'antd/dist/antd.css'; // or 'antd/dist/antd.less'
|
||||
|
||||
### Use modularized antd
|
||||
|
||||
- Use [babel-plugin-import](https://github.com/ant-design/babel-plugin-import) (Recommended)
|
||||
- Manually import
|
||||
|
||||
```jsx
|
||||
import DatePicker from 'antd/lib/date-picker'; // for js
|
||||
import 'antd/lib/date-picker/style/css'; // for css
|
||||
// import 'antd/lib/date-picker/style'; // that will import less
|
||||
```
|
||||
|
||||
- Use [babel-plugin-import](https://github.com/ant-design/babel-plugin-import)
|
||||
|
||||
```js
|
||||
// .babelrc or babel-loader option
|
||||
@@ -76,14 +84,6 @@ import 'antd/dist/antd.css'; // or 'antd/dist/antd.less'
|
||||
import { DatePicker } from 'antd';
|
||||
```
|
||||
|
||||
- Manually import
|
||||
|
||||
```jsx
|
||||
import DatePicker from 'antd/lib/date-picker'; // for js
|
||||
import 'antd/lib/date-picker/style/css'; // for css
|
||||
// import 'antd/lib/date-picker/style'; // that will import less
|
||||
```
|
||||
|
||||
### TypeScript
|
||||
|
||||
```js
|
||||
@@ -101,6 +101,19 @@ import 'antd/dist/antd.css'; // or 'antd/dist/antd.less'
|
||||
> - set `allowSyntheticDefaultImports` to prevent `error TS1192: Module 'react' has no default export`.
|
||||
> - Don't use @types/antd, antd provide a built-in ts definition already.
|
||||
|
||||
#### Use [ts-import-plugin](https://github.com/Brooooooklyn/ts-import-plugin) with modularized antd
|
||||
|
||||
```js
|
||||
{
|
||||
loader: "ts-loader", // or awesome-typescript-loader
|
||||
options {
|
||||
getCustomTransformers: () => ({
|
||||
before: [ tsImportPluginFactory({ libraryName: "antd", style: "css" }) ]
|
||||
})
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Internationalization
|
||||
|
||||
See [i18n](http://ant.design/docs/react/i18n).
|
||||
@@ -110,7 +123,7 @@ See [i18n](http://ant.design/docs/react/i18n).
|
||||
- [Home page](http://ant.design/)
|
||||
- [UI library](http://ant.design/docs/react/introduce)
|
||||
- [Change Log](CHANGELOG.en-US.md)
|
||||
- [Offcial Scaffold Tool](https://github.com/dvajs/dva-cli/)
|
||||
- [Official Scaffold Tool](https://github.com/dvajs/dva-cli/)
|
||||
- [Development Tool](http://ant-tool.github.io/)
|
||||
- [Scaffold Market](http://scaffold.ant.design)
|
||||
- [rc-components](http://react-component.github.io/)
|
||||
@@ -135,4 +148,4 @@ Open your browser and visit http://127.0.0.1:8001 , see more at https://github.c
|
||||
|
||||
## Contributing
|
||||
|
||||
We welcome all contributions, please read our [CONTRIBUTING.md](https://github.com/ant-design/ant-design/blob/master/.github/CONTRIBUTING.md) first. You can submit any ideas as [pull requests](https://github.com/ant-design/ant-design/pulls) or as [GitHub issues](https://github.com/ant-design/ant-design/issues). If you'd like to improve code, check out the [Development Instructions](https://github.com/ant-design/ant-design/wiki/Development) and have a good time! :)
|
||||
We welcome all contributions. Please read our [CONTRIBUTING.md](https://github.com/ant-design/ant-design/blob/master/.github/CONTRIBUTING.md) first. You can submit any ideas as [pull requests](https://github.com/ant-design/ant-design/pulls) or as [GitHub issues](https://github.com/ant-design/ant-design/issues). If you'd like to improve code, check out the [Development Instructions](https://github.com/ant-design/ant-design/wiki/Development) and have a good time! :)
|
||||
|
||||
@@ -6,6 +6,7 @@ Array [
|
||||
"Anchor",
|
||||
"AutoComplete",
|
||||
"Alert",
|
||||
"Avatar",
|
||||
"BackTop",
|
||||
"Badge",
|
||||
"Breadcrumb",
|
||||
|
||||
@@ -1,11 +1,22 @@
|
||||
import assign from 'object-assign';
|
||||
|
||||
export function getComponentLocale(props, context, componentName, getDefaultLocale) {
|
||||
const locale = context && context.antLocale && context.antLocale[componentName] ?
|
||||
context.antLocale[componentName] : getDefaultLocale();
|
||||
let locale: any = {};
|
||||
if (context && context.antLocale && context.antLocale[componentName]) {
|
||||
locale = context.antLocale[componentName];
|
||||
} else {
|
||||
const defaultLocale = getDefaultLocale();
|
||||
// TODO: make default lang of antd be English
|
||||
// https://github.com/ant-design/ant-design/issues/6334
|
||||
locale = defaultLocale.default || defaultLocale;
|
||||
}
|
||||
|
||||
const result = assign({}, locale, props.locale);
|
||||
result.lang = assign({}, locale.lang, props.locale.lang);
|
||||
const result = {
|
||||
...locale,
|
||||
...props.locale,
|
||||
};
|
||||
result.lang = {
|
||||
...locale.lang,
|
||||
...props.locale.lang,
|
||||
};
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,8 @@ export default function getRequestAnimationFrame() {
|
||||
return () => {};
|
||||
}
|
||||
if (window.requestAnimationFrame) {
|
||||
return window.requestAnimationFrame;
|
||||
// https://github.com/vuejs/vue/issues/4465
|
||||
return window.requestAnimationFrame.bind(window);
|
||||
}
|
||||
|
||||
const prefix = availablePrefixs.filter(key => `${key}RequestAnimationFrame` in window)[0];
|
||||
|
||||
@@ -4,7 +4,7 @@ type: Navigation
|
||||
title: Affix
|
||||
---
|
||||
|
||||
Make an element sticky to viewport.
|
||||
Make an element stick to viewport.
|
||||
|
||||
## When To Use
|
||||
|
||||
@@ -19,7 +19,7 @@ Please note that Affix should not cover other content on the page, especially wh
|
||||
| offsetTop | Pixels to offset from top when calculating position of scroll | number | 0 |
|
||||
| offsetBottom | Pixels to offset from bottom when calculating position of scroll | number | - |
|
||||
| target | specifies the scrollable area dom node | () => HTMLElement | () => window |
|
||||
| onChange | Callback when affix state is changed | Function(affixed) | - |
|
||||
| onChange | Callback for when affix state is changed | Function(affixed) | - |
|
||||
|
||||
**Note:** Children of `Affix` can not be `position: absolute`, but you can set `Affix` as `position: absolute`:
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ function noop() {}
|
||||
function getDefaultTarget() {
|
||||
return typeof window !== 'undefined' ?
|
||||
window : null;
|
||||
};
|
||||
}
|
||||
|
||||
// Affix
|
||||
export interface AffixProps {
|
||||
@@ -73,6 +73,18 @@ export default class Affix extends React.Component<AffixProps, any> {
|
||||
fixedNode: HTMLElement;
|
||||
};
|
||||
|
||||
events = [
|
||||
'resize',
|
||||
'scroll',
|
||||
'touchstart',
|
||||
'touchmove',
|
||||
'touchend',
|
||||
'pageshow',
|
||||
'load',
|
||||
];
|
||||
|
||||
eventHandlers = {};
|
||||
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
@@ -150,7 +162,7 @@ export default class Affix extends React.Component<AffixProps, any> {
|
||||
});
|
||||
this.setPlaceholderStyle({
|
||||
width,
|
||||
height: affixNode.offsetHeight,
|
||||
height: elemSize.height,
|
||||
});
|
||||
} else if (
|
||||
scrollTop < elemOffset.top + elemSize.height + (offsetBottom as number) - targetInnerHeight &&
|
||||
@@ -167,7 +179,7 @@ export default class Affix extends React.Component<AffixProps, any> {
|
||||
});
|
||||
this.setPlaceholderStyle({
|
||||
width,
|
||||
height: affixNode.offsetHeight,
|
||||
height: elemOffset.height,
|
||||
});
|
||||
} else {
|
||||
const { affixStyle } = this.state;
|
||||
@@ -190,7 +202,7 @@ export default class Affix extends React.Component<AffixProps, any> {
|
||||
|
||||
componentWillReceiveProps(nextProps) {
|
||||
if (this.props.target !== nextProps.target) {
|
||||
this.clearScrollEventListeners();
|
||||
this.clearEventListeners();
|
||||
this.setTargetEventListeners(nextProps.target);
|
||||
|
||||
// Mock Event object.
|
||||
@@ -199,7 +211,7 @@ export default class Affix extends React.Component<AffixProps, any> {
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
this.clearScrollEventListeners();
|
||||
this.clearEventListeners();
|
||||
clearTimeout(this.timeout);
|
||||
(this.updatePosition as any).cancel();
|
||||
}
|
||||
@@ -209,15 +221,18 @@ export default class Affix extends React.Component<AffixProps, any> {
|
||||
if (!target) {
|
||||
return;
|
||||
}
|
||||
this.clearScrollEventListeners();
|
||||
this.scrollEvent = addEventListener(target, 'scroll', this.updatePosition);
|
||||
this.resizeEvent = addEventListener(target, 'resize', this.updatePosition);
|
||||
this.clearEventListeners();
|
||||
|
||||
this.events.forEach(eventName => {
|
||||
this.eventHandlers[eventName] = addEventListener(target, eventName, this.updatePosition);
|
||||
});
|
||||
}
|
||||
|
||||
clearScrollEventListeners() {
|
||||
['scrollEvent', 'resizeEvent'].forEach((name) => {
|
||||
if (this[name]) {
|
||||
this[name].remove();
|
||||
clearEventListeners() {
|
||||
this.events.forEach(eventName => {
|
||||
const handler = this.eventHandlers[eventName];
|
||||
if (handler && handler.remove) {
|
||||
handler.remove();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -20,3 +20,9 @@ ReactDOM.render(
|
||||
<Alert message="Success Text" type="success" />
|
||||
, mountNode);
|
||||
````
|
||||
|
||||
<style>
|
||||
.ant-alert {
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -8,18 +8,18 @@ Alert component for feedback.
|
||||
|
||||
## When To Use
|
||||
|
||||
- When you need to show alert messages for users.
|
||||
- When you need to show alert messages to users.
|
||||
- When you need a persistent static container which is closable by user actions.
|
||||
|
||||
## API
|
||||
|
||||
| Property | Description | Type | Default |
|
||||
|----------- |--------------------------------------------------------- | ---------- |-------|
|
||||
| type | Type of Alert styles, options:`success`, `info`, `warning`, `error` | string | `info`, in `banner` mode it's `warning` |
|
||||
| type | Type of Alert styles, options: `success`, `info`, `warning`, `error` | string | `info`, in `banner` mode default is `warning` |
|
||||
| closable | Whether Alert can be closed | boolean | - |
|
||||
| closeText | Close text to show | string\|ReactNode | - |
|
||||
| message | Content of Alert | string\|ReactNode | - |
|
||||
| description | Additional content of Alert | string\|ReactNode | - |
|
||||
| onClose | Callback when close Alert | Function | - |
|
||||
| showIcon | Whether to show icon | boolean | false, in `banner` mode it's true |
|
||||
| onClose | Callback when Alert is closed | Function | - |
|
||||
| showIcon | Whether to show icon | boolean | false, in `banner` mode default is true |
|
||||
| banner | Whether to show as banner | boolean | false |
|
||||
|
||||
@@ -24,4 +24,3 @@ title: Alert
|
||||
| onClose | 关闭时触发的回调函数 | Function | 无 |
|
||||
| showIcon | 是否显示辅助图标 | boolean | false,`banner` 模式下默认值为 true |
|
||||
| banner | 是否用作顶部公告 | boolean | false |
|
||||
|
||||
|
||||
@@ -11,8 +11,7 @@
|
||||
border-radius: @border-radius-base;
|
||||
color: @alert-text-color;
|
||||
font-size: @font-size-base;
|
||||
line-height: 16px;
|
||||
margin-bottom: 10px;
|
||||
line-height: @line-height-base;
|
||||
|
||||
&&-no-icon {
|
||||
padding: 8px 48px 8px 16px;
|
||||
@@ -20,7 +19,7 @@
|
||||
|
||||
&-icon {
|
||||
font-size: @font-size-lg;
|
||||
top: 9.5px;
|
||||
top: 8px + @font-size-base * @line-height-base / 2 - @font-size-lg / 2;
|
||||
left: 16px;
|
||||
position: absolute;
|
||||
}
|
||||
@@ -91,7 +90,6 @@
|
||||
padding: 16px 16px 16px 60px;
|
||||
position: relative;
|
||||
border-radius: @border-radius-base;
|
||||
margin-bottom: 10px;
|
||||
color: @text-color;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
244
components/anchor/Anchor.tsx
Normal file
244
components/anchor/Anchor.tsx
Normal file
@@ -0,0 +1,244 @@
|
||||
import React from 'react';
|
||||
import ReactDOM from 'react-dom';
|
||||
import PropTypes from 'prop-types';
|
||||
import classNames from 'classnames';
|
||||
import addEventListener from 'rc-util/lib/Dom/addEventListener';
|
||||
import Affix from '../affix';
|
||||
import AnchorLink from './AnchorLink';
|
||||
import getScroll from '../_util/getScroll';
|
||||
import getRequestAnimationFrame from '../_util/getRequestAnimationFrame';
|
||||
|
||||
function getDefaultTarget() {
|
||||
return window;
|
||||
}
|
||||
|
||||
function getOffsetTop(element: HTMLElement): number {
|
||||
if (!element) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!element.getClientRects().length) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
const rect = element.getBoundingClientRect();
|
||||
|
||||
if (rect.width || rect.height) {
|
||||
const doc = element.ownerDocument;
|
||||
const docElem = doc.documentElement;
|
||||
return rect.top - docElem.clientTop;
|
||||
}
|
||||
|
||||
return rect.top;
|
||||
}
|
||||
|
||||
function easeInOutCubic(t: number, b: number, c: number, d: number) {
|
||||
const cc = c - b;
|
||||
t /= d / 2;
|
||||
if (t < 1) {
|
||||
return cc / 2 * t * t * t + b;
|
||||
}
|
||||
return cc / 2 * ((t -= 2) * t * t + 2) + b;
|
||||
}
|
||||
|
||||
const reqAnimFrame = getRequestAnimationFrame();
|
||||
function scrollTo(href: string, offsetTop = 0, target, callback = () => { }) {
|
||||
const scrollTop = getScroll(target(), true);
|
||||
const targetElement = document.getElementById(href.substring(1));
|
||||
if (!targetElement) {
|
||||
return;
|
||||
}
|
||||
const eleOffsetTop = getOffsetTop(targetElement);
|
||||
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));
|
||||
if (time < 450) {
|
||||
reqAnimFrame(frameFunc);
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
};
|
||||
reqAnimFrame(frameFunc);
|
||||
history.pushState(null, '', href);
|
||||
}
|
||||
|
||||
type Section = {
|
||||
link: String;
|
||||
top: number;
|
||||
};
|
||||
|
||||
export interface AnchorProps {
|
||||
prefixCls?: string;
|
||||
className?: string;
|
||||
style?: React.CSSProperties;
|
||||
children?: React.ReactNode;
|
||||
offsetTop?: number;
|
||||
bounds?: number;
|
||||
affix?: boolean;
|
||||
showInkInFixed?: boolean;
|
||||
target?: () => HTMLElement | Window;
|
||||
}
|
||||
|
||||
export default class Anchor extends React.Component<AnchorProps, any> {
|
||||
static Link: typeof AnchorLink;
|
||||
|
||||
static defaultProps = {
|
||||
prefixCls: 'ant-anchor',
|
||||
affix: true,
|
||||
showInkInFixed: false,
|
||||
};
|
||||
|
||||
static childContextTypes = {
|
||||
antAnchor: PropTypes.object,
|
||||
};
|
||||
|
||||
refs: {
|
||||
ink?: any;
|
||||
};
|
||||
|
||||
private links: String[];
|
||||
private scrollEvent: any;
|
||||
private animating: boolean;
|
||||
|
||||
constructor(props: AnchorProps) {
|
||||
super(props);
|
||||
this.state = {
|
||||
activeLink: null,
|
||||
};
|
||||
this.links = [];
|
||||
}
|
||||
|
||||
getChildContext() {
|
||||
return {
|
||||
antAnchor: {
|
||||
registerLink: (link: String) => {
|
||||
if (!this.links.includes(link)) {
|
||||
this.links.push(link);
|
||||
}
|
||||
},
|
||||
unregisterLink: (link: String) => {
|
||||
const index = this.links.indexOf(link);
|
||||
if (index !== -1) {
|
||||
this.links.splice(index, 1);
|
||||
}
|
||||
},
|
||||
activeLink: this.state.activeLink,
|
||||
scrollTo: this.handleScrollTo,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
const getTarget = this.props.target || getDefaultTarget;
|
||||
this.scrollEvent = addEventListener(getTarget(), 'scroll', this.handleScroll);
|
||||
this.handleScroll();
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
if (this.scrollEvent) {
|
||||
this.scrollEvent.remove();
|
||||
}
|
||||
}
|
||||
|
||||
componentDidUpdate() {
|
||||
this.updateInk();
|
||||
}
|
||||
|
||||
handleScroll = () => {
|
||||
if (this.animating) {
|
||||
return;
|
||||
}
|
||||
const { offsetTop, bounds } = this.props;
|
||||
this.setState({
|
||||
activeLink: this.getCurrentAnchor(offsetTop, bounds),
|
||||
});
|
||||
}
|
||||
|
||||
handleScrollTo = (link) => {
|
||||
const { offsetTop, target = getDefaultTarget } = this.props;
|
||||
this.animating = true;
|
||||
this.setState({ activeLink: link });
|
||||
scrollTo(link, offsetTop, target, () => {
|
||||
this.animating = false;
|
||||
});
|
||||
}
|
||||
|
||||
getCurrentAnchor(offsetTop = 0, bounds = 5) {
|
||||
let activeLink = '';
|
||||
if (typeof document === 'undefined') {
|
||||
return activeLink;
|
||||
}
|
||||
|
||||
const linkSections: Array<Section> = [];
|
||||
this.links.forEach(link => {
|
||||
const target = document.getElementById(link.substring(1));
|
||||
if (target && getOffsetTop(target) < offsetTop + bounds) {
|
||||
const top = getOffsetTop(target);
|
||||
linkSections.push({
|
||||
link,
|
||||
top,
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
if (linkSections.length) {
|
||||
const maxSection = linkSections.reduce((prev, curr) => curr.top > prev.top ? curr : prev);
|
||||
return maxSection.link;
|
||||
}
|
||||
return '';
|
||||
}
|
||||
|
||||
updateInk = () => {
|
||||
if (typeof document === 'undefined') {
|
||||
return;
|
||||
}
|
||||
const { prefixCls } = this.props;
|
||||
const linkNode = ReactDOM.findDOMNode(this as any).getElementsByClassName(`${prefixCls}-link-title-active`)[0];
|
||||
if (linkNode) {
|
||||
this.refs.ink.style.top = `${(linkNode as any).offsetTop + linkNode.clientHeight / 2 - 4.5}px`;
|
||||
}
|
||||
}
|
||||
|
||||
render() {
|
||||
const {
|
||||
prefixCls,
|
||||
className = '',
|
||||
style,
|
||||
offsetTop,
|
||||
affix,
|
||||
showInkInFixed,
|
||||
children,
|
||||
} = this.props;
|
||||
const { activeLink } = this.state;
|
||||
|
||||
const inkClass = classNames(`${prefixCls}-ink-ball`, {
|
||||
visible: activeLink,
|
||||
});
|
||||
|
||||
const wrapperClass = classNames(className, `${prefixCls}-wrapper`);
|
||||
|
||||
const anchorClass = classNames(prefixCls, {
|
||||
'fixed': !affix && !showInkInFixed,
|
||||
});
|
||||
|
||||
const anchorContent = (
|
||||
<div className={wrapperClass} style={style}>
|
||||
<div className={anchorClass}>
|
||||
<div className={`${prefixCls}-ink`} >
|
||||
<span className={inkClass} ref="ink" />
|
||||
</div>
|
||||
{children}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
||||
return !affix ? anchorContent : (
|
||||
<Affix offsetTop={offsetTop}>
|
||||
{anchorContent}
|
||||
</Affix>
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,108 +1,65 @@
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import classNames from 'classnames';
|
||||
import AnchorHelper, { scrollTo } from './anchorHelper';
|
||||
|
||||
export interface AnchorLinkProps {
|
||||
href: string;
|
||||
onClick?: (href: string, component: Element) => void;
|
||||
active?: boolean;
|
||||
prefixCls?: string;
|
||||
children?: any;
|
||||
href: string;
|
||||
title: React.ReactNode;
|
||||
offsetTop?: number;
|
||||
bounds?: number;
|
||||
target?: () => HTMLElement | Window;
|
||||
affix?: boolean;
|
||||
children?: any;
|
||||
}
|
||||
|
||||
export default class AnchorLink extends React.Component<AnchorLinkProps, any> {
|
||||
static __ANT_ANCHOR_LINK = true;
|
||||
static contextTypes = {
|
||||
anchorHelper: PropTypes.any,
|
||||
static defaultProps = {
|
||||
prefixCls: 'ant-anchor',
|
||||
href: '#',
|
||||
};
|
||||
|
||||
static defaultProps = {
|
||||
href: '#',
|
||||
prefixCls: 'ant-anchor',
|
||||
static contextTypes = {
|
||||
antAnchor: PropTypes.object,
|
||||
};
|
||||
|
||||
context: {
|
||||
anchorHelper: AnchorHelper;
|
||||
antAnchor: any;
|
||||
};
|
||||
|
||||
private _component: HTMLAnchorElement;
|
||||
|
||||
setActiveAnchor() {
|
||||
const { bounds, offsetTop, href, affix } = this.props;
|
||||
const { anchorHelper } = this.context;
|
||||
const active = affix && anchorHelper && anchorHelper.getCurrentAnchor(offsetTop, bounds) === href;
|
||||
if (active && anchorHelper) {
|
||||
anchorHelper.setActiveAnchor(this._component);
|
||||
}
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
this.setActiveAnchor();
|
||||
this.context.antAnchor.registerLink(this.props.href);
|
||||
}
|
||||
|
||||
componentDidUpdate() {
|
||||
this.setActiveAnchor();
|
||||
componentWillUnmount() {
|
||||
this.context.antAnchor.unregisterLink(this.props.href);
|
||||
}
|
||||
|
||||
renderAnchorLink = (child: React.ReactChild) => {
|
||||
// Here child is a ReactChild type
|
||||
if (typeof child !== 'string' && typeof child !== 'number') {
|
||||
const { href } = child.props;
|
||||
if (href) {
|
||||
this.context.anchorHelper.addLink(href);
|
||||
return React.cloneElement(child, {
|
||||
onClick: this.props.onClick,
|
||||
prefixCls: this.props.prefixCls,
|
||||
affix: this.props.affix,
|
||||
offsetTop: this.props.offsetTop,
|
||||
});
|
||||
}
|
||||
}
|
||||
return child;
|
||||
}
|
||||
|
||||
refsTo = (component: HTMLAnchorElement) => {
|
||||
this._component = component;
|
||||
}
|
||||
|
||||
scrollTo = (e: React.MouseEvent<HTMLAnchorElement>) => {
|
||||
e.preventDefault();
|
||||
const { onClick, href } = this.props;
|
||||
const { anchorHelper } = this.context;
|
||||
if (onClick) {
|
||||
onClick(href, this._component);
|
||||
} else {
|
||||
const scrollToFn = anchorHelper ? anchorHelper.scrollTo : scrollTo;
|
||||
scrollToFn(href, this.props.offsetTop);
|
||||
}
|
||||
handleClick = () => {
|
||||
this.context.antAnchor.scrollTo(this.props.href);
|
||||
}
|
||||
|
||||
render() {
|
||||
const { prefixCls, href, children, title, bounds, offsetTop, affix } = this.props;
|
||||
const { anchorHelper } = this.context;
|
||||
const active = affix && anchorHelper && anchorHelper.getCurrentAnchor(offsetTop, bounds) === href;
|
||||
const cls = classNames({
|
||||
[`${prefixCls}-link`]: true,
|
||||
const {
|
||||
prefixCls,
|
||||
href,
|
||||
title,
|
||||
children,
|
||||
} = this.props;
|
||||
const active = this.context.antAnchor.activeLink === href;
|
||||
const wrapperClassName = classNames(`${prefixCls}-link`, {
|
||||
[`${prefixCls}-link-active`]: active,
|
||||
});
|
||||
const titleClassName = classNames(`${prefixCls}-link-title`, {
|
||||
[`${prefixCls}-link-title-active`]: active,
|
||||
});
|
||||
return (
|
||||
<div className={cls}>
|
||||
<div className={wrapperClassName}>
|
||||
<a
|
||||
ref={this.refsTo}
|
||||
className={`${prefixCls}-link-title`}
|
||||
onClick={this.scrollTo}
|
||||
className={titleClassName}
|
||||
href={href}
|
||||
title={typeof title === 'string' ? title : ''}
|
||||
onClick={this.handleClick}
|
||||
>
|
||||
{title}
|
||||
</a>
|
||||
{React.Children.map(children, this.renderAnchorLink)}
|
||||
{children}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ exports[`renders ./components/anchor/demo/basic.md correctly 1`] = `
|
||||
class="ant-anchor-ink"
|
||||
>
|
||||
<span
|
||||
class="ant-anchor-ink-ball animated"
|
||||
class="ant-anchor-ink-ball"
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
@@ -90,7 +90,7 @@ exports[`renders ./components/anchor/demo/fixed.md correctly 1`] = `
|
||||
class="ant-anchor-ink"
|
||||
>
|
||||
<span
|
||||
class="ant-anchor-ink-ball animated"
|
||||
class="ant-anchor-ink-ball"
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
|
||||
@@ -1,129 +0,0 @@
|
||||
import getScroll from '../_util/getScroll';
|
||||
import getRequestAnimationFrame from '../_util/getRequestAnimationFrame';
|
||||
|
||||
export const reqAnimFrame = getRequestAnimationFrame();
|
||||
|
||||
export const easeInOutCubic = (t: number, b: number, c: number, d: number) => {
|
||||
const cc = c - b;
|
||||
t /= d / 2;
|
||||
if (t < 1) {
|
||||
return cc / 2 * t * t * t + b;
|
||||
}
|
||||
return cc / 2 * ((t -= 2) * t * t + 2) + b;
|
||||
};
|
||||
|
||||
export function getDefaultTarget() {
|
||||
return typeof window !== 'undefined' ?
|
||||
window : null;
|
||||
}
|
||||
|
||||
export function getOffsetTop(element: HTMLElement): number {
|
||||
if (!element) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!element.getClientRects().length) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
const rect = element.getBoundingClientRect();
|
||||
|
||||
if (rect.width || rect.height) {
|
||||
const doc = element.ownerDocument;
|
||||
const docElem = doc.documentElement;
|
||||
return rect.top - docElem.clientTop;
|
||||
}
|
||||
|
||||
return rect.top;
|
||||
}
|
||||
|
||||
export type Section = {
|
||||
top: number;
|
||||
bottom: number;
|
||||
section: any;
|
||||
};
|
||||
|
||||
export function scrollTo(href: string, offsetTop = 0, target = getDefaultTarget, callback = () => { }) {
|
||||
const scrollTop = getScroll(target(), true);
|
||||
const targetElement = document.getElementById(href.substring(1));
|
||||
if (!targetElement) {
|
||||
return;
|
||||
}
|
||||
const eleOffsetTop = getOffsetTop(targetElement);
|
||||
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));
|
||||
if (time < 450) {
|
||||
reqAnimFrame(frameFunc);
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
};
|
||||
reqAnimFrame(frameFunc);
|
||||
history.pushState(null, '', href);
|
||||
}
|
||||
|
||||
class AnchorHelper {
|
||||
private links: Array<string>;
|
||||
private currentAnchor: HTMLAnchorElement | null;
|
||||
private _activeAnchor: string;
|
||||
|
||||
constructor() {
|
||||
this.links = [];
|
||||
this.currentAnchor = null;
|
||||
this._activeAnchor = '';
|
||||
}
|
||||
|
||||
addLink(link: string) {
|
||||
if (this.links.indexOf(link) === -1) {
|
||||
this.links.push(link);
|
||||
}
|
||||
}
|
||||
|
||||
getCurrentActiveAnchor(): HTMLAnchorElement | null {
|
||||
return this.currentAnchor;
|
||||
}
|
||||
|
||||
setActiveAnchor(component: HTMLAnchorElement) {
|
||||
this.currentAnchor = component;
|
||||
}
|
||||
|
||||
getCurrentAnchor(offsetTop: number = 0, bounds = 5) {
|
||||
let activeAnchor = '';
|
||||
if (typeof document === 'undefined') {
|
||||
return activeAnchor;
|
||||
}
|
||||
|
||||
const linksPositions = (this.links
|
||||
.map(section => {
|
||||
const target = document.getElementById(section.substring(1));
|
||||
if (target && getOffsetTop(target) < offsetTop + bounds) {
|
||||
const top = getOffsetTop(target);
|
||||
if (top <= offsetTop + bounds) {
|
||||
return {
|
||||
section,
|
||||
top,
|
||||
bottom: top + target.clientHeight,
|
||||
};
|
||||
}
|
||||
}
|
||||
return null;
|
||||
})
|
||||
.filter(section => section !== null) as Array<Section>);
|
||||
|
||||
if (linksPositions.length) {
|
||||
const maxSection = linksPositions.reduce((prev, curr) => curr.top > prev.top ? curr : prev);
|
||||
return maxSection.section;
|
||||
}
|
||||
return '';
|
||||
}
|
||||
|
||||
scrollTo(href: string, offsetTop: number | undefined, target = getDefaultTarget, callback = () => { }) {
|
||||
scrollTo(href, offsetTop, target, callback);
|
||||
}
|
||||
}
|
||||
|
||||
export default AnchorHelper;
|
||||
@@ -1,146 +1,5 @@
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import classNames from 'classnames';
|
||||
import addEventListener from 'rc-util/lib/Dom/addEventListener';
|
||||
import Anchor from './Anchor';
|
||||
import AnchorLink from './AnchorLink';
|
||||
import Affix from '../affix';
|
||||
import AnchorHelper, { getDefaultTarget } from './anchorHelper';
|
||||
|
||||
export interface AnchorProps {
|
||||
target?: () => HTMLElement | Window;
|
||||
children?: React.ReactNode;
|
||||
prefixCls?: string;
|
||||
offsetTop?: number;
|
||||
bounds?: number;
|
||||
className?: string;
|
||||
style?: React.CSSProperties;
|
||||
affix?: boolean;
|
||||
showInkInFixed?: boolean;
|
||||
}
|
||||
|
||||
export default class Anchor extends React.Component<AnchorProps, any> {
|
||||
static Link = AnchorLink;
|
||||
|
||||
static defaultProps = {
|
||||
prefixCls: 'ant-anchor',
|
||||
affix: true,
|
||||
showInkInFixed: false,
|
||||
};
|
||||
|
||||
static childContextTypes = {
|
||||
anchorHelper: PropTypes.any,
|
||||
};
|
||||
|
||||
refs: {
|
||||
ink?: any;
|
||||
};
|
||||
|
||||
private scrollEvent: any;
|
||||
private anchorHelper: AnchorHelper;
|
||||
private _avoidInk: boolean;
|
||||
|
||||
constructor(props: AnchorProps) {
|
||||
super(props);
|
||||
this.state = {
|
||||
activeAnchor: null,
|
||||
animated: true,
|
||||
};
|
||||
this.anchorHelper = new AnchorHelper();
|
||||
}
|
||||
|
||||
handleScroll = () => {
|
||||
this.setState({
|
||||
activeAnchor: this.anchorHelper.getCurrentAnchor(this.props.offsetTop, this.props.bounds),
|
||||
});
|
||||
}
|
||||
|
||||
getChildContext() {
|
||||
return {
|
||||
anchorHelper: this.anchorHelper,
|
||||
};
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
this.handleScroll();
|
||||
this.updateInk();
|
||||
this.scrollEvent = addEventListener((this.props.target || getDefaultTarget)(), 'scroll', this.handleScroll);
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
if (this.scrollEvent) {
|
||||
this.scrollEvent.remove();
|
||||
}
|
||||
}
|
||||
|
||||
componentDidUpdate() {
|
||||
if (!this._avoidInk) {
|
||||
this.updateInk();
|
||||
}
|
||||
}
|
||||
|
||||
updateInk = () => {
|
||||
const activeAnchor = this.anchorHelper.getCurrentActiveAnchor();
|
||||
if (activeAnchor) {
|
||||
this.refs.ink.style.top = `${activeAnchor.offsetTop + activeAnchor.clientHeight / 2 - 4.5}px`;
|
||||
}
|
||||
}
|
||||
|
||||
clickAnchorLink = (href: string, component: HTMLElement) => {
|
||||
this._avoidInk = true;
|
||||
this.refs.ink.style.top = `${component.offsetTop + component.clientHeight / 2 - 4.5}px`;
|
||||
this.anchorHelper.scrollTo(href, this.props.offsetTop, getDefaultTarget, () => {
|
||||
this._avoidInk = false;
|
||||
});
|
||||
}
|
||||
|
||||
renderAnchorLink = (child: React.ReactElement<any>) => {
|
||||
const { href } = child.props;
|
||||
const { type } = child as any;
|
||||
if (type.__ANT_ANCHOR_LINK && href) {
|
||||
this.anchorHelper.addLink(href);
|
||||
return React.cloneElement(child, {
|
||||
onClick: this.clickAnchorLink,
|
||||
prefixCls: this.props.prefixCls,
|
||||
bounds: this.props.bounds,
|
||||
affix: this.props.affix || this.props.showInkInFixed,
|
||||
offsetTop: this.props.offsetTop,
|
||||
});
|
||||
}
|
||||
return child;
|
||||
}
|
||||
|
||||
render() {
|
||||
const { prefixCls, offsetTop, style, className = '', affix, showInkInFixed } = this.props;
|
||||
const { activeAnchor, animated } = this.state;
|
||||
const inkClass = classNames({
|
||||
[`${prefixCls}-ink-ball`]: true,
|
||||
animated,
|
||||
visible: !!activeAnchor,
|
||||
});
|
||||
|
||||
const wrapperClass = classNames({
|
||||
[`${prefixCls}-wrapper`]: true,
|
||||
}, className);
|
||||
|
||||
const anchorClass = classNames(prefixCls, {
|
||||
'fixed': !affix && !showInkInFixed,
|
||||
});
|
||||
|
||||
const anchorContent = (
|
||||
<div className={wrapperClass} style={style}>
|
||||
<div className={anchorClass}>
|
||||
<div className={`${prefixCls}-ink`} >
|
||||
<span className={inkClass} ref="ink" />
|
||||
</div>
|
||||
{React.Children.toArray(this.props.children).map(this.renderAnchorLink)}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
||||
return !affix ? anchorContent : (
|
||||
<Affix offsetTop={offsetTop}>
|
||||
{anchorContent}
|
||||
</Affix>
|
||||
);
|
||||
}
|
||||
}
|
||||
Anchor.Link = AnchorLink;
|
||||
export default Anchor;
|
||||
|
||||
@@ -1,57 +1,50 @@
|
||||
@import "../../style/themes/default";
|
||||
|
||||
.@{ant-prefix} {
|
||||
&-anchor {
|
||||
position: relative;
|
||||
&-wrapper {
|
||||
background-color: @component-background;
|
||||
}
|
||||
.@{ant-prefix}-anchor {
|
||||
position: relative;
|
||||
&-wrapper {
|
||||
background-color: @component-background;
|
||||
}
|
||||
|
||||
&-ink {
|
||||
position: absolute;
|
||||
&-ink {
|
||||
position: absolute;
|
||||
height: 100%;
|
||||
left: 0;
|
||||
top: 0;
|
||||
&:before {
|
||||
content: ' ';
|
||||
position: relative;
|
||||
width: 2px;
|
||||
height: 100%;
|
||||
left: 0;
|
||||
top: 0;
|
||||
&:before {
|
||||
content: ' ';
|
||||
position: relative;
|
||||
width: 2px;
|
||||
height: 100%;
|
||||
display: block;
|
||||
background-color: @border-color-split;
|
||||
margin: 0 auto;
|
||||
}
|
||||
&-ball {
|
||||
display: none;
|
||||
position: absolute;
|
||||
width: 9px;
|
||||
height: 9px;
|
||||
border-radius: 9px;
|
||||
border: 3px solid @primary-color;
|
||||
background-color: @component-background;
|
||||
left: 50%;
|
||||
transition: top .3s ease-in-out;
|
||||
transform: translateX(-50%);
|
||||
&.visible {
|
||||
display: inline-block;
|
||||
}
|
||||
}
|
||||
display: block;
|
||||
background-color: @border-color-split;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
&.fixed &-ink &-ink-ball {
|
||||
&-ball {
|
||||
display: none;
|
||||
position: absolute;
|
||||
width: 9px;
|
||||
height: 9px;
|
||||
border-radius: 9px;
|
||||
border: 3px solid @primary-color;
|
||||
background-color: @component-background;
|
||||
left: 50%;
|
||||
transition: top .3s ease-in-out;
|
||||
transform: translateX(-50%);
|
||||
&.visible {
|
||||
display: inline-block;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&-anchor-link {
|
||||
&.fixed &-ink &-ink-ball {
|
||||
display: none;
|
||||
}
|
||||
|
||||
&-link {
|
||||
padding: 8px 0 8px 18px;
|
||||
line-height: 1;
|
||||
|
||||
& & {
|
||||
padding-top: 6px;
|
||||
padding-bottom: 6px;
|
||||
}
|
||||
|
||||
&-title {
|
||||
display: block;
|
||||
position: relative;
|
||||
@@ -61,18 +54,19 @@
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
&-title:only-child {
|
||||
margin-bottom: 0;
|
||||
&:only-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
}
|
||||
|
||||
&-active > &-title {
|
||||
color: @primary-color;
|
||||
}
|
||||
}
|
||||
|
||||
& > & {
|
||||
font-size: @font-size-base;
|
||||
}
|
||||
&-link &-link {
|
||||
padding-top: 6px;
|
||||
padding-bottom: 6px;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,10 +10,17 @@ export default class InputElement extends React.Component<any, any> {
|
||||
blur = () => {
|
||||
this.ele.blur ? this.ele.blur() : (findDOMNode(this.ele) as HTMLInputElement).blur();
|
||||
}
|
||||
saveRef = (ele: HTMLInputElement) => {
|
||||
this.ele = ele;
|
||||
const childRef = this.props.children.ref;
|
||||
if (typeof childRef === 'function') {
|
||||
childRef(ele);
|
||||
}
|
||||
}
|
||||
render() {
|
||||
return React.cloneElement(this.props.children, {
|
||||
...this.props,
|
||||
ref: ele => this.ele = (ele as HTMLInputElement),
|
||||
ref: this.saveRef,
|
||||
}, null);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -85,7 +85,7 @@ exports[`renders ./components/auto-complete/demo/basic.md correctly 1`] = `
|
||||
class="ant-select-search__field__wrap"
|
||||
>
|
||||
<input
|
||||
class="ant-input ant-input ant-select-search__field"
|
||||
class="ant-input ant-select-search__field"
|
||||
type="text"
|
||||
value=""
|
||||
/>
|
||||
@@ -144,10 +144,10 @@ exports[`renders ./components/auto-complete/demo/certain-category.md correctly 1
|
||||
class="ant-select-search__field__wrap"
|
||||
>
|
||||
<span
|
||||
class="ant-input-affix-wrapper"
|
||||
class="ant-select-search__field ant-input-affix-wrapper"
|
||||
>
|
||||
<input
|
||||
class="ant-input ant-input ant-select-search__field"
|
||||
class="ant-input"
|
||||
type="text"
|
||||
value=""
|
||||
/>
|
||||
@@ -211,7 +211,7 @@ exports[`renders ./components/auto-complete/demo/non-case-sensitive.md correctly
|
||||
class="ant-select-search__field__wrap"
|
||||
>
|
||||
<input
|
||||
class="ant-input ant-input ant-select-search__field"
|
||||
class="ant-input ant-select-search__field"
|
||||
type="text"
|
||||
value=""
|
||||
/>
|
||||
@@ -266,7 +266,7 @@ exports[`renders ./components/auto-complete/demo/options.md correctly 1`] = `
|
||||
class="ant-select-search__field__wrap"
|
||||
>
|
||||
<input
|
||||
class="ant-input ant-input ant-select-search__field"
|
||||
class="ant-input ant-select-search__field"
|
||||
type="text"
|
||||
value=""
|
||||
/>
|
||||
@@ -325,10 +325,10 @@ exports[`renders ./components/auto-complete/demo/uncertain-category.md correctly
|
||||
class="ant-select-search__field__wrap"
|
||||
>
|
||||
<span
|
||||
class="ant-input-affix-wrapper"
|
||||
class="ant-select-search__field ant-input-affix-wrapper"
|
||||
>
|
||||
<input
|
||||
class="ant-input ant-input ant-select-search__field"
|
||||
class="ant-input"
|
||||
type="text"
|
||||
value=""
|
||||
/>
|
||||
@@ -336,7 +336,7 @@ exports[`renders ./components/auto-complete/demo/uncertain-category.md correctly
|
||||
class="ant-input-suffix"
|
||||
>
|
||||
<button
|
||||
class="ant-btn ant-btn-primary ant-btn-lg search-btn"
|
||||
class="ant-btn search-btn ant-btn-primary ant-btn-lg"
|
||||
type="button"
|
||||
>
|
||||
<i
|
||||
|
||||
@@ -17,4 +17,14 @@ describe('AutoComplete with Custom Input Element Render', () => {
|
||||
// should not filter data source defaultly
|
||||
expect(dropdownWrapper.find('MenuItem').length).toBe(3);
|
||||
});
|
||||
|
||||
it('child.ref should work', () => {
|
||||
const mockRef = jest.fn();
|
||||
mount(
|
||||
<AutoComplete dataSource={[]}>
|
||||
<input ref={mockRef} />
|
||||
</AutoComplete>
|
||||
);
|
||||
expect(mockRef).toHaveBeenCalled();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -14,7 +14,8 @@ title:
|
||||
Customize Input Component
|
||||
|
||||
````jsx
|
||||
import { AutoComplete } from 'antd';
|
||||
import { AutoComplete, Input } from 'antd';
|
||||
const { TextArea } = Input;
|
||||
|
||||
function onSelect(value) {
|
||||
console.log('onSelect', value);
|
||||
@@ -49,7 +50,7 @@ class Complete extends React.Component {
|
||||
onSearch={this.handleSearch}
|
||||
placeholder="input here"
|
||||
>
|
||||
<textarea onKeyPress={this.handleKeyPress} style={{ height: 50 }} />
|
||||
<TextArea onKeyPress={this.handleKeyPress} style={{ height: 50 }} />
|
||||
</AutoComplete>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -34,3 +34,4 @@ const dataSource = ['12345', '23456', '34567'];
|
||||
| children (for customize input element) | customize input element | HTMLInputElement / HTMLTextAreaElement / React.ReactElement<InputProps> | `<Input />` |
|
||||
| optionLabelProp | Which prop value of option will render as content of select. | string | `children` |
|
||||
| filterOption | If true, filter options by input, if function, filter options against it. The function will receive two arguments, `inputValue` and `option`, if the function returns `true`, the option will be included in the filtered set; Otherwise, it will be excluded. | boolean or function(inputValue, option) | true |
|
||||
| backfill | backfill selected item the input when using keyboard | boolean | false |
|
||||
|
||||
@@ -5,7 +5,7 @@ import Select, { AbstractSelectProps, SelectValue, OptionProps, OptGroupProps }
|
||||
import Input from '../input';
|
||||
import InputElement from './InputElement';
|
||||
|
||||
export interface DataSourceItemObject { value: string; text: string; };
|
||||
export interface DataSourceItemObject { value: string; text: string; }
|
||||
export type DataSourceItemType = string | DataSourceItemObject;
|
||||
|
||||
export interface InputProps {
|
||||
@@ -50,15 +50,9 @@ export default class AutoComplete extends React.Component<AutoCompleteProps, any
|
||||
getInputElement = () => {
|
||||
const { children } = this.props;
|
||||
const element = children && React.isValidElement(children) && children.type !== Option ?
|
||||
React.Children.only(this.props.children) :
|
||||
<Input/>;
|
||||
React.Children.only(this.props.children) : <Input />;
|
||||
return (
|
||||
<InputElement
|
||||
{...element.props}
|
||||
className={classNames('ant-input', element.props.className)}
|
||||
>
|
||||
{element}
|
||||
</InputElement>
|
||||
<InputElement>{element}</InputElement>
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -35,3 +35,4 @@ const dataSource = ['12345', '23456', '34567'];
|
||||
| children (自定义输入框) | 自定义输入框 | HTMLInputElement / HTMLTextAreaElement / React.ReactElement<InputProps> | `<Input />` |
|
||||
| optionLabelProp | 回填到选择框的 Option 的属性值,默认是 Option 的子元素。比如在子元素需要高亮效果时,此值可以设为 `value`。 | string | `children` |
|
||||
| filterOption | 是否根据输入项进行筛选。当其为一个函数时,会接收 `inputValue` `option` 两个参数,当 `option` 符合筛选条件时,应返回 `true`,反之则返回 `false`。 | boolean or function(inputValue, option) | true |
|
||||
| backfill | 使用键盘选择选项的时候把选中项回填到输入框中 | boolean | false |
|
||||
|
||||
@@ -16,11 +16,11 @@
|
||||
margin-left: 0;
|
||||
margin-right: 0;
|
||||
height: 100%;
|
||||
line-height: @input-height-base;
|
||||
}
|
||||
&__placeholder {
|
||||
margin-left: 8px;
|
||||
margin-right: 8px;
|
||||
top: @input-height-base / 2;
|
||||
margin-left: (@input-padding-horizontal + 1px);
|
||||
margin-right: (@input-padding-horizontal + 1px);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -33,11 +33,17 @@
|
||||
|
||||
.@{input-prefix-cls} {
|
||||
background: transparent;
|
||||
border-width: @border-width-base;
|
||||
line-height: @line-height-base;
|
||||
&:focus,
|
||||
&:hover {
|
||||
.hover;
|
||||
}
|
||||
}
|
||||
|
||||
&-lg {
|
||||
.@{select-prefix-cls}-selection__placeholder {
|
||||
top: @input-height-lg / 2;
|
||||
.@{select-prefix-cls}-selection__rendered {
|
||||
line-height: @input-height-lg;
|
||||
}
|
||||
.@{input-prefix-cls} {
|
||||
.input-lg();
|
||||
@@ -45,20 +51,12 @@
|
||||
}
|
||||
|
||||
&-sm {
|
||||
.@{select-prefix-cls}-selection__placeholder {
|
||||
top: @input-height-sm / 2;
|
||||
.@{select-prefix-cls}-selection__rendered {
|
||||
line-height: @input-height-sm;
|
||||
}
|
||||
.@{input-prefix-cls} {
|
||||
.input-sm();
|
||||
}
|
||||
}
|
||||
|
||||
.@{input-prefix-cls} {
|
||||
border-width: @border-width-base;
|
||||
&:focus,
|
||||
&:hover {
|
||||
.hover;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
11
components/avatar/__tests__/Avatar.test.js
Normal file
11
components/avatar/__tests__/Avatar.test.js
Normal file
@@ -0,0 +1,11 @@
|
||||
import React from 'react';
|
||||
import { mount } from 'enzyme';
|
||||
import Avatar from '..';
|
||||
|
||||
describe('Avatar Render', () => {
|
||||
it('Render long string correctly', () => {
|
||||
const wrapper = mount(<Avatar>TestString</Avatar>);
|
||||
const children = wrapper.find('.ant-avatar-string');
|
||||
expect(children.length).toBe(1);
|
||||
});
|
||||
});
|
||||
329
components/avatar/__tests__/__snapshots__/demo.test.js.snap
Normal file
329
components/avatar/__tests__/__snapshots__/demo.test.js.snap
Normal file
@@ -0,0 +1,329 @@
|
||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`renders ./components/avatar/demo/badge.md correctly 1`] = `
|
||||
<div>
|
||||
<span
|
||||
style="margin-right:24px;"
|
||||
>
|
||||
<span
|
||||
class="ant-badge"
|
||||
>
|
||||
<span
|
||||
class="ant-avatar ant-avatar-square ant-avatar-icon"
|
||||
>
|
||||
<i
|
||||
class="anticon anticon-user"
|
||||
/>
|
||||
</span>
|
||||
<sup
|
||||
class="ant-scroll-number ant-badge-count"
|
||||
data-show="true"
|
||||
title="1"
|
||||
>
|
||||
<span
|
||||
class="ant-scroll-number-only"
|
||||
style="transition:none;-ms-transform:translateY(-1100%);-webkit-transform:translateY(-1100%);transform:translateY(-1100%);"
|
||||
>
|
||||
<p
|
||||
class=""
|
||||
>
|
||||
0
|
||||
</p>
|
||||
<p
|
||||
class=""
|
||||
>
|
||||
1
|
||||
</p>
|
||||
<p
|
||||
class=""
|
||||
>
|
||||
2
|
||||
</p>
|
||||
<p
|
||||
class=""
|
||||
>
|
||||
3
|
||||
</p>
|
||||
<p
|
||||
class=""
|
||||
>
|
||||
4
|
||||
</p>
|
||||
<p
|
||||
class=""
|
||||
>
|
||||
5
|
||||
</p>
|
||||
<p
|
||||
class=""
|
||||
>
|
||||
6
|
||||
</p>
|
||||
<p
|
||||
class=""
|
||||
>
|
||||
7
|
||||
</p>
|
||||
<p
|
||||
class=""
|
||||
>
|
||||
8
|
||||
</p>
|
||||
<p
|
||||
class=""
|
||||
>
|
||||
9
|
||||
</p>
|
||||
<p
|
||||
class=""
|
||||
>
|
||||
0
|
||||
</p>
|
||||
<p
|
||||
class="current"
|
||||
>
|
||||
1
|
||||
</p>
|
||||
<p
|
||||
class=""
|
||||
>
|
||||
2
|
||||
</p>
|
||||
<p
|
||||
class=""
|
||||
>
|
||||
3
|
||||
</p>
|
||||
<p
|
||||
class=""
|
||||
>
|
||||
4
|
||||
</p>
|
||||
<p
|
||||
class=""
|
||||
>
|
||||
5
|
||||
</p>
|
||||
<p
|
||||
class=""
|
||||
>
|
||||
6
|
||||
</p>
|
||||
<p
|
||||
class=""
|
||||
>
|
||||
7
|
||||
</p>
|
||||
<p
|
||||
class=""
|
||||
>
|
||||
8
|
||||
</p>
|
||||
<p
|
||||
class=""
|
||||
>
|
||||
9
|
||||
</p>
|
||||
<p
|
||||
class=""
|
||||
>
|
||||
0
|
||||
</p>
|
||||
<p
|
||||
class=""
|
||||
>
|
||||
1
|
||||
</p>
|
||||
<p
|
||||
class=""
|
||||
>
|
||||
2
|
||||
</p>
|
||||
<p
|
||||
class=""
|
||||
>
|
||||
3
|
||||
</p>
|
||||
<p
|
||||
class=""
|
||||
>
|
||||
4
|
||||
</p>
|
||||
<p
|
||||
class=""
|
||||
>
|
||||
5
|
||||
</p>
|
||||
<p
|
||||
class=""
|
||||
>
|
||||
6
|
||||
</p>
|
||||
<p
|
||||
class=""
|
||||
>
|
||||
7
|
||||
</p>
|
||||
<p
|
||||
class=""
|
||||
>
|
||||
8
|
||||
</p>
|
||||
<p
|
||||
class=""
|
||||
>
|
||||
9
|
||||
</p>
|
||||
</span>
|
||||
</sup>
|
||||
</span>
|
||||
</span>
|
||||
<span>
|
||||
<span
|
||||
class="ant-badge"
|
||||
>
|
||||
<span
|
||||
class="ant-avatar ant-avatar-square ant-avatar-icon"
|
||||
>
|
||||
<i
|
||||
class="anticon anticon-user"
|
||||
/>
|
||||
</span>
|
||||
<sup
|
||||
class="ant-scroll-number ant-badge-dot"
|
||||
data-show="true"
|
||||
/>
|
||||
</span>
|
||||
</span>
|
||||
</div>
|
||||
`;
|
||||
|
||||
exports[`renders ./components/avatar/demo/basic.md correctly 1`] = `
|
||||
<div>
|
||||
<div>
|
||||
<span
|
||||
class="ant-avatar ant-avatar-lg ant-avatar-circle ant-avatar-icon"
|
||||
>
|
||||
<i
|
||||
class="anticon anticon-user"
|
||||
/>
|
||||
</span>
|
||||
<span
|
||||
class="ant-avatar ant-avatar-circle ant-avatar-icon"
|
||||
>
|
||||
<i
|
||||
class="anticon anticon-user"
|
||||
/>
|
||||
</span>
|
||||
<span
|
||||
class="ant-avatar ant-avatar-sm ant-avatar-circle ant-avatar-icon"
|
||||
>
|
||||
<i
|
||||
class="anticon anticon-user"
|
||||
/>
|
||||
</span>
|
||||
</div>
|
||||
<div>
|
||||
<span
|
||||
class="ant-avatar ant-avatar-lg ant-avatar-square ant-avatar-icon"
|
||||
>
|
||||
<i
|
||||
class="anticon anticon-user"
|
||||
/>
|
||||
</span>
|
||||
<span
|
||||
class="ant-avatar ant-avatar-square ant-avatar-icon"
|
||||
>
|
||||
<i
|
||||
class="anticon anticon-user"
|
||||
/>
|
||||
</span>
|
||||
<span
|
||||
class="ant-avatar ant-avatar-sm ant-avatar-square ant-avatar-icon"
|
||||
>
|
||||
<i
|
||||
class="anticon anticon-user"
|
||||
/>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
|
||||
exports[`renders ./components/avatar/demo/dynamic.md correctly 1`] = `
|
||||
<div>
|
||||
<span
|
||||
class="ant-avatar ant-avatar-lg ant-avatar-circle"
|
||||
style="background-color:#f56a00;"
|
||||
>
|
||||
<span
|
||||
class="ant-avatar-string"
|
||||
>
|
||||
U
|
||||
</span>
|
||||
</span>
|
||||
<button
|
||||
class="ant-btn ant-btn-sm"
|
||||
style="margin-left:16px;"
|
||||
type="button"
|
||||
>
|
||||
<span>
|
||||
Change
|
||||
</span>
|
||||
</button>
|
||||
</div>
|
||||
`;
|
||||
|
||||
exports[`renders ./components/avatar/demo/type.md correctly 1`] = `
|
||||
<div>
|
||||
<span
|
||||
class="ant-avatar ant-avatar-circle ant-avatar-icon"
|
||||
>
|
||||
<i
|
||||
class="anticon anticon-user"
|
||||
/>
|
||||
</span>
|
||||
<span
|
||||
class="ant-avatar ant-avatar-circle"
|
||||
>
|
||||
<span
|
||||
class="ant-avatar-string"
|
||||
>
|
||||
U
|
||||
</span>
|
||||
</span>
|
||||
<span
|
||||
class="ant-avatar ant-avatar-circle"
|
||||
>
|
||||
<span
|
||||
class="ant-avatar-string"
|
||||
>
|
||||
USER
|
||||
</span>
|
||||
</span>
|
||||
<span
|
||||
class="ant-avatar ant-avatar-circle ant-avatar-image"
|
||||
>
|
||||
<img
|
||||
src="https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png"
|
||||
/>
|
||||
</span>
|
||||
<span
|
||||
class="ant-avatar ant-avatar-circle"
|
||||
style="color:#f56a00;background-color:#fde3cf;"
|
||||
>
|
||||
<span
|
||||
class="ant-avatar-string"
|
||||
>
|
||||
U
|
||||
</span>
|
||||
</span>
|
||||
<span
|
||||
class="ant-avatar ant-avatar-circle ant-avatar-icon"
|
||||
style="background-color:#87d068;"
|
||||
>
|
||||
<i
|
||||
class="anticon anticon-user"
|
||||
/>
|
||||
</span>
|
||||
</div>
|
||||
`;
|
||||
3
components/avatar/__tests__/demo.test.js
Normal file
3
components/avatar/__tests__/demo.test.js
Normal file
@@ -0,0 +1,3 @@
|
||||
import demoTest from '../../../tests/shared/demoTest';
|
||||
|
||||
demoTest('avatar');
|
||||
29
components/avatar/demo/badge.md
Normal file
29
components/avatar/demo/badge.md
Normal file
@@ -0,0 +1,29 @@
|
||||
---
|
||||
order: 3
|
||||
title:
|
||||
zh-CN: 带徽标的头像
|
||||
en-US: With Badge
|
||||
---
|
||||
|
||||
## zh-CN
|
||||
|
||||
通常用于消息提示。
|
||||
|
||||
## en-US
|
||||
|
||||
Usually used for messages remind.
|
||||
|
||||
````jsx
|
||||
import { Avatar, Badge } from 'antd';
|
||||
|
||||
ReactDOM.render(
|
||||
<div>
|
||||
<span style={{ marginRight: 24 }}>
|
||||
<Badge count={1}><Avatar shape="square" icon="user" /></Badge>
|
||||
</span>
|
||||
<span>
|
||||
<Badge dot><Avatar shape="square" icon="user" /></Badge>
|
||||
</span>
|
||||
</div>
|
||||
, mountNode);
|
||||
````
|
||||
40
components/avatar/demo/basic.md
Normal file
40
components/avatar/demo/basic.md
Normal file
@@ -0,0 +1,40 @@
|
||||
---
|
||||
order: 0
|
||||
title:
|
||||
zh-CN: 基本
|
||||
en-US: Basic
|
||||
---
|
||||
|
||||
## zh-CN
|
||||
|
||||
头像有三种尺寸,两种形状可选。
|
||||
|
||||
## en-US
|
||||
|
||||
Three sizes and two shapes are available.
|
||||
|
||||
````jsx
|
||||
import { Avatar } from 'antd';
|
||||
|
||||
ReactDOM.render(
|
||||
<div>
|
||||
<div>
|
||||
<Avatar size="large" icon="user" />
|
||||
<Avatar icon="user" />
|
||||
<Avatar size="small" icon="user" />
|
||||
</div>
|
||||
<div>
|
||||
<Avatar shape="square" size="large" icon="user" />
|
||||
<Avatar shape="square" icon="user" />
|
||||
<Avatar shape="square" size="small" icon="user" />
|
||||
</div>
|
||||
</div>
|
||||
, mountNode);
|
||||
````
|
||||
|
||||
<style>
|
||||
#components-avatar-demo-basic .ant-avatar {
|
||||
margin-top: 16px;
|
||||
margin-right: 16px;
|
||||
}
|
||||
</style>
|
||||
49
components/avatar/demo/dynamic.md
Normal file
49
components/avatar/demo/dynamic.md
Normal file
@@ -0,0 +1,49 @@
|
||||
---
|
||||
order: 2
|
||||
title:
|
||||
zh-CN: 自动调整字符大小
|
||||
en-US: Autoset Font Size
|
||||
---
|
||||
|
||||
## zh-CN
|
||||
|
||||
对于字符型的头像,当字符串较长时,字体大小可以根据头像宽度自动调整。
|
||||
|
||||
## en-US
|
||||
|
||||
For letter type Avatar, when the letters are too long to display, the font size can be automatically adjusted according to the width of the Avatar.
|
||||
|
||||
````jsx
|
||||
import { Avatar, Button } from 'antd';
|
||||
|
||||
const UserList = ['U', 'Lucy', 'Tom', 'Edward'];
|
||||
const colorList = ['#f56a00', '#7265e6', '#ffbf00', '#00a2ae'];
|
||||
|
||||
class Autoset extends React.Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
user: UserList[0],
|
||||
color: colorList[0],
|
||||
};
|
||||
}
|
||||
changeUser = () => {
|
||||
const index = UserList.indexOf(this.state.user);
|
||||
this.setState({
|
||||
user: index < UserList.length - 1 ? UserList[index + 1] : UserList[0],
|
||||
color: index < colorList.length - 1 ? colorList[index + 1] : colorList[0],
|
||||
});
|
||||
}
|
||||
render() {
|
||||
return (
|
||||
<div>
|
||||
<Avatar style={{ backgroundColor: this.state.color }} size="large">{this.state.user}</Avatar>
|
||||
<Button size="small" style={{ marginLeft: 16 }} onClick={this.changeUser}>Change</Button>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
ReactDOM.render(<Autoset />
|
||||
, mountNode);
|
||||
````
|
||||
36
components/avatar/demo/type.md
Normal file
36
components/avatar/demo/type.md
Normal file
@@ -0,0 +1,36 @@
|
||||
---
|
||||
order: 1
|
||||
title:
|
||||
zh-CN: 类型
|
||||
en-US: Type
|
||||
---
|
||||
|
||||
## zh-CN
|
||||
|
||||
支持三种类型:图片、Icon 以及字符,其中 Icon 和字符型可以自定义图标颜色及背景色。
|
||||
|
||||
## en-US
|
||||
|
||||
Image, Icon and letter are supported, and the latter two kinds avatar can have custom colors and background colors.
|
||||
|
||||
````jsx
|
||||
import { Avatar } from 'antd';
|
||||
|
||||
ReactDOM.render(
|
||||
<div>
|
||||
<Avatar icon="user" />
|
||||
<Avatar>U</Avatar>
|
||||
<Avatar>USER</Avatar>
|
||||
<Avatar src="https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png" />
|
||||
<Avatar style={{ color: '#f56a00', backgroundColor: '#fde3cf' }}>U</Avatar>
|
||||
<Avatar style={{ backgroundColor: '#87d068' }} icon="user" />
|
||||
</div>
|
||||
, mountNode);
|
||||
````
|
||||
|
||||
<style>
|
||||
#components-avatar-demo-type .ant-avatar {
|
||||
margin-top: 16px;
|
||||
margin-right: 16px;
|
||||
}
|
||||
</style>
|
||||
16
components/avatar/index.en-US.md
Normal file
16
components/avatar/index.en-US.md
Normal file
@@ -0,0 +1,16 @@
|
||||
---
|
||||
category: Components
|
||||
type: Data Display
|
||||
title: Avatar
|
||||
---
|
||||
|
||||
Avatars can be used to represent people or objects. It supports images, `Icon`s, or letters.
|
||||
|
||||
## API
|
||||
|
||||
| Property | Description | Type | Default |
|
||||
|----------- |--------------------------------------------------------- | ---------- |-------|
|
||||
| shape | the shape of avatar | `circle` \| `square` | `circle` |
|
||||
| size | the size of the avatar | `large` \| `small` \| `default` | `default` |
|
||||
| src | the address of the image for an image avatar | string | - |
|
||||
| icon | the `Icon` type for an icon avatar, see `Icon` Component | string | - |
|
||||
137
components/avatar/index.tsx
Normal file
137
components/avatar/index.tsx
Normal file
@@ -0,0 +1,137 @@
|
||||
import React from 'react';
|
||||
import ReactDOM from 'react-dom';
|
||||
import Icon from '../icon';
|
||||
import classNames from 'classnames';
|
||||
|
||||
export interface AvatarProps {
|
||||
/** Shape of avatar, options:`circle`, `square` */
|
||||
shape?: 'circle' | 'square';
|
||||
/** Size of avatar, options:`large`, `small`, `default` */
|
||||
size?: 'large' | 'small' | 'default';
|
||||
/** Src of image avatar */
|
||||
src?: string;
|
||||
/** Type of the Icon to be used in avatar */
|
||||
icon?: string;
|
||||
style?: React.CSSProperties;
|
||||
prefixCls?: string;
|
||||
className?: string;
|
||||
children?: any;
|
||||
}
|
||||
|
||||
export interface AvatarState {
|
||||
scale: number;
|
||||
isImgExist: boolean;
|
||||
}
|
||||
|
||||
export default class Avatar extends React.Component<AvatarProps, AvatarState> {
|
||||
static defaultProps = {
|
||||
prefixCls: 'ant-avatar',
|
||||
shape: 'circle',
|
||||
size: 'default',
|
||||
};
|
||||
|
||||
private avatarChildren: any;
|
||||
|
||||
constructor(props: AvatarProps) {
|
||||
super(props);
|
||||
this.state = {
|
||||
scale: 1,
|
||||
isImgExist: true,
|
||||
};
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
this.setScale();
|
||||
}
|
||||
|
||||
componentDidUpdate(prevProps: AvatarProps, prevState: AvatarState) {
|
||||
if (prevProps.children !== this.props.children
|
||||
|| (prevState.scale !== this.state.scale && this.state.scale === 1)) {
|
||||
this.setScale();
|
||||
}
|
||||
}
|
||||
|
||||
setScale = () => {
|
||||
const childrenNode = this.avatarChildren;
|
||||
if (childrenNode) {
|
||||
const childrenWidth = childrenNode.offsetWidth;
|
||||
const avatarWidth = ReactDOM.findDOMNode(this).getBoundingClientRect().width;
|
||||
// add 4px gap for each side to get better performance
|
||||
if (avatarWidth - 8 < childrenWidth) {
|
||||
this.setState({
|
||||
scale: (avatarWidth - 8) / childrenWidth,
|
||||
});
|
||||
} else {
|
||||
this.setState({
|
||||
scale: 1,
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
handleImgLoadError = () => this.setState({ isImgExist: false });
|
||||
|
||||
render() {
|
||||
const {
|
||||
prefixCls, shape, size, src, icon, className, ...others,
|
||||
} = this.props;
|
||||
|
||||
const sizeCls = classNames({
|
||||
[`${prefixCls}-lg`]: size === 'large',
|
||||
[`${prefixCls}-sm`]: size === 'small',
|
||||
});
|
||||
|
||||
const classString = classNames(prefixCls, className, sizeCls, {
|
||||
[`${prefixCls}-${shape}`]: shape,
|
||||
[`${prefixCls}-image`]: src,
|
||||
[`${prefixCls}-icon`]: icon,
|
||||
});
|
||||
|
||||
let children = this.props.children;
|
||||
if (src && this.state.isImgExist) {
|
||||
children = (
|
||||
<img
|
||||
src={src}
|
||||
onError={this.handleImgLoadError}
|
||||
/>
|
||||
);
|
||||
} else if (icon) {
|
||||
children = <Icon type={icon} />;
|
||||
} else {
|
||||
const childrenNode = this.avatarChildren;
|
||||
if (childrenNode || this.state.scale !== 1) {
|
||||
const childrenStyle: React.CSSProperties = {
|
||||
msTransform: `scale(${this.state.scale})`,
|
||||
WebkitTransform: `scale(${this.state.scale})`,
|
||||
transform: `scale(${this.state.scale})`,
|
||||
position: 'absolute',
|
||||
display: 'inline-block',
|
||||
left: `calc(50% - ${Math.round(childrenNode.offsetWidth / 2)}px)`,
|
||||
};
|
||||
children = (
|
||||
<span
|
||||
className={`${prefixCls}-string`}
|
||||
ref={span => this.avatarChildren = span}
|
||||
style={childrenStyle}
|
||||
>
|
||||
{children}
|
||||
</span>
|
||||
);
|
||||
} else {
|
||||
children = (
|
||||
<span
|
||||
className={`${prefixCls}-string`}
|
||||
ref={span => this.avatarChildren = span}
|
||||
>
|
||||
{children}
|
||||
</span>
|
||||
);
|
||||
}
|
||||
}
|
||||
return (
|
||||
<span {...others} className={classString}>
|
||||
{children}
|
||||
</span>
|
||||
);
|
||||
}
|
||||
}
|
||||
17
components/avatar/index.zh-CN.md
Normal file
17
components/avatar/index.zh-CN.md
Normal file
@@ -0,0 +1,17 @@
|
||||
---
|
||||
category: Components
|
||||
subtitle: 头像
|
||||
type: Data Display
|
||||
title: Avatar
|
||||
---
|
||||
|
||||
用来代表用户或事物,支持图片、图标或字符展示。
|
||||
|
||||
## API
|
||||
|
||||
| 参数 | 说明 | 类型 | 默认值 |
|
||||
|----------- |--------------------------------------------------------- | ---------- | ------- |
|
||||
| shape | 指定头像的形状 | Enum{ 'circle', 'square' } | `circle` |
|
||||
| size | 设置头像的大小 | Enum{ 'large', 'small', 'default' } | `default` |
|
||||
| src | 图片类头像的资源地址 | string | - |
|
||||
| icon | 设置头像的图标类型,参考 `Icon` 组件 | string | - |
|
||||
47
components/avatar/style/index.less
Normal file
47
components/avatar/style/index.less
Normal file
@@ -0,0 +1,47 @@
|
||||
@import "../../style/themes/default";
|
||||
|
||||
@avatar-prefix-cls: ~"@{ant-prefix}-avatar";
|
||||
|
||||
.@{avatar-prefix-cls} {
|
||||
display: inline-block;
|
||||
text-align: center;
|
||||
background: @avatar-bg;
|
||||
color: @avatar-color;
|
||||
white-space: nowrap;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
|
||||
.avatar-size(@avatar-size-base, @avatar-font-size-base);
|
||||
|
||||
&-lg {
|
||||
.avatar-size(@avatar-size-lg, @avatar-font-size-lg);
|
||||
}
|
||||
|
||||
&-sm {
|
||||
.avatar-size(@avatar-size-sm, @avatar-font-size-sm);
|
||||
}
|
||||
|
||||
&-square {
|
||||
border-radius: @avatar-border-radius;
|
||||
}
|
||||
|
||||
& > img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.avatar-size(@size, @font-size) {
|
||||
width: @size;
|
||||
height: @size;
|
||||
line-height: @size;
|
||||
border-radius: @size / 2;
|
||||
|
||||
& > * {
|
||||
line-height: @size;
|
||||
}
|
||||
|
||||
&.@{avatar-prefix-cls}-icon {
|
||||
font-size: @font-size;
|
||||
}
|
||||
}
|
||||
2
components/avatar/style/index.tsx
Normal file
2
components/avatar/style/index.tsx
Normal file
@@ -0,0 +1,2 @@
|
||||
import '../../style/index.less';
|
||||
import './index.less';
|
||||
18
components/back-top/__tests__/index.test.js
Normal file
18
components/back-top/__tests__/index.test.js
Normal file
@@ -0,0 +1,18 @@
|
||||
import React from 'react';
|
||||
import { mount } from 'enzyme';
|
||||
import BackTop from '..';
|
||||
|
||||
const delay = timeout => new Promise(resolve => setTimeout(resolve, timeout));
|
||||
|
||||
describe('BackTop', () => {
|
||||
it('should scroll to top after click it', async () => {
|
||||
const wrapper = mount(<BackTop visibilityHeight={-1} />);
|
||||
document.documentElement.scrollTop = 400;
|
||||
// trigger scroll manually
|
||||
wrapper.node.handleScroll();
|
||||
await delay(500);
|
||||
wrapper.find('.ant-back-top').simulate('click');
|
||||
await delay(500);
|
||||
expect(Math.round(document.documentElement.scrollTop)).toBe(0);
|
||||
});
|
||||
});
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
category: Components
|
||||
type: Navigation
|
||||
type: Other
|
||||
title: BackTop
|
||||
---
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ import getRequestAnimationFrame from '../_util/getRequestAnimationFrame';
|
||||
|
||||
const reqAnimFrame = getRequestAnimationFrame();
|
||||
|
||||
const easeInOutCubic = (t, b, c, d) => {
|
||||
const easeInOutCubic = (t: number, b: number, c: number, d: number) => {
|
||||
const cc = c - b;
|
||||
t /= d / 2;
|
||||
if (t < 1) {
|
||||
@@ -19,11 +19,10 @@ const easeInOutCubic = (t, b, c, d) => {
|
||||
}
|
||||
};
|
||||
|
||||
function noop() {}
|
||||
function noop() { }
|
||||
|
||||
function getDefaultTarget() {
|
||||
return typeof window !== 'undefined' ?
|
||||
window : null;
|
||||
return window;
|
||||
}
|
||||
|
||||
export interface BackTopProps {
|
||||
@@ -42,7 +41,7 @@ export default class BackTop extends React.Component<BackTopProps, any> {
|
||||
|
||||
scrollEvent: any;
|
||||
|
||||
constructor(props) {
|
||||
constructor(props: BackTopProps) {
|
||||
super(props);
|
||||
this.state = {
|
||||
visible: false,
|
||||
@@ -50,14 +49,15 @@ export default class BackTop extends React.Component<BackTopProps, any> {
|
||||
}
|
||||
|
||||
getCurrentScrollTop = () => {
|
||||
const targetNode = (this.props.target || getDefaultTarget)();
|
||||
const getTarget = this.props.target || getDefaultTarget;
|
||||
const targetNode = getTarget();
|
||||
if (targetNode === window) {
|
||||
return window.pageYOffset || document.body.scrollTop || document.documentElement.scrollTop;
|
||||
}
|
||||
return (targetNode as HTMLElement).scrollTop;
|
||||
}
|
||||
|
||||
scrollToTop = (e) => {
|
||||
scrollToTop = (e: React.MouseEvent<HTMLDivElement>) => {
|
||||
const scrollTop = this.getCurrentScrollTop();
|
||||
const startTime = Date.now();
|
||||
const frameFunc = () => {
|
||||
@@ -72,8 +72,9 @@ export default class BackTop extends React.Component<BackTopProps, any> {
|
||||
(this.props.onClick || noop)(e);
|
||||
}
|
||||
|
||||
setScrollTop(value) {
|
||||
const targetNode = (this.props.target || getDefaultTarget)();
|
||||
setScrollTop(value: number) {
|
||||
const getTarget = this.props.target || getDefaultTarget;
|
||||
const targetNode = getTarget();
|
||||
if (targetNode === window) {
|
||||
document.body.scrollTop = value;
|
||||
document.documentElement.scrollTop = value;
|
||||
@@ -91,8 +92,9 @@ export default class BackTop extends React.Component<BackTopProps, any> {
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
const getTarget = this.props.target || getDefaultTarget;
|
||||
this.scrollEvent = addEventListener(getTarget(), 'scroll', this.handleScroll);
|
||||
this.handleScroll();
|
||||
this.scrollEvent = addEventListener((this.props.target || getDefaultTarget)(), 'scroll', this.handleScroll);
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
category: Components
|
||||
type: Navigation
|
||||
type: Other
|
||||
subtitle: 回到顶部
|
||||
title: BackTop
|
||||
---
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import React from 'react';
|
||||
import { createElement, Component } from 'react';
|
||||
import assign from 'object-assign';
|
||||
import omit from 'omit.js';
|
||||
import classNames from 'classnames';
|
||||
|
||||
function getNumberArray(num) {
|
||||
return num ?
|
||||
@@ -18,6 +18,7 @@ export interface ScrollNumberProps {
|
||||
component?: string;
|
||||
onAnimated?: Function;
|
||||
style?: React.CSSProperties;
|
||||
title?: string | number;
|
||||
}
|
||||
|
||||
export default class ScrollNumber extends Component<ScrollNumberProps, any> {
|
||||
@@ -119,24 +120,28 @@ export default class ScrollNumber extends Component<ScrollNumberProps, any> {
|
||||
}
|
||||
|
||||
render() {
|
||||
const { prefixCls, className, style, title, component = 'sup' } = this.props;
|
||||
// fix https://fb.me/react-unknown-prop
|
||||
const props = assign({}, omit(this.props, [
|
||||
const restProps = omit(this.props, [
|
||||
'count',
|
||||
'onAnimated',
|
||||
'component',
|
||||
'prefixCls',
|
||||
]), {
|
||||
className: `${this.props.prefixCls} ${this.props.className}`,
|
||||
});
|
||||
]);
|
||||
const newProps = {
|
||||
...restProps,
|
||||
className: classNames(prefixCls, className),
|
||||
title: title as string,
|
||||
};
|
||||
// allow specify the border
|
||||
// mock border-color by box-shadow for compatible with old usage:
|
||||
// <Badge count={4} style={{ backgroundColor: '#fff', color: '#999', borderColor: '#d9d9d9' }} />
|
||||
if (props.style && props.style.borderColor) {
|
||||
props.style.boxShadow = `0 0 0 1px ${props.style.borderColor} inset`;
|
||||
if (style && style.borderColor) {
|
||||
newProps.style.boxShadow = `0 0 0 1px ${style.borderColor} inset`;
|
||||
}
|
||||
return createElement(
|
||||
this.props.component || 'sup',
|
||||
props,
|
||||
component as any,
|
||||
newProps,
|
||||
this.renderNumberElement(),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -4,7 +4,6 @@ exports[`renders ./components/badge/demo/basic.md correctly 1`] = `
|
||||
<div>
|
||||
<span
|
||||
class="ant-badge"
|
||||
title="5"
|
||||
>
|
||||
<a
|
||||
class="head-example"
|
||||
@@ -13,6 +12,7 @@ exports[`renders ./components/badge/demo/basic.md correctly 1`] = `
|
||||
<sup
|
||||
class="ant-scroll-number ant-badge-count"
|
||||
data-show="true"
|
||||
title="5"
|
||||
>
|
||||
<span
|
||||
class="ant-scroll-number-only"
|
||||
@@ -173,7 +173,6 @@ exports[`renders ./components/badge/demo/basic.md correctly 1`] = `
|
||||
</span>
|
||||
<span
|
||||
class="ant-badge"
|
||||
title="0"
|
||||
>
|
||||
<a
|
||||
class="head-example"
|
||||
@@ -182,6 +181,7 @@ exports[`renders ./components/badge/demo/basic.md correctly 1`] = `
|
||||
<sup
|
||||
class="ant-scroll-number ant-badge-count"
|
||||
data-show="true"
|
||||
title="0"
|
||||
>
|
||||
0
|
||||
</sup>
|
||||
@@ -194,7 +194,6 @@ exports[`renders ./components/badge/demo/change.md correctly 1`] = `
|
||||
<div>
|
||||
<span
|
||||
class="ant-badge"
|
||||
title="5"
|
||||
>
|
||||
<a
|
||||
class="head-example"
|
||||
@@ -203,6 +202,7 @@ exports[`renders ./components/badge/demo/change.md correctly 1`] = `
|
||||
<sup
|
||||
class="ant-scroll-number ant-badge-count"
|
||||
data-show="true"
|
||||
title="5"
|
||||
>
|
||||
<span
|
||||
class="ant-scroll-number-only"
|
||||
@@ -398,7 +398,8 @@ exports[`renders ./components/badge/demo/change.md correctly 1`] = `
|
||||
/>
|
||||
</span>
|
||||
<span
|
||||
class="ant-switch"
|
||||
checked=""
|
||||
class="ant-switch ant-switch-checked"
|
||||
tabindex="0"
|
||||
>
|
||||
<span
|
||||
@@ -444,7 +445,6 @@ exports[`renders ./components/badge/demo/link.md correctly 1`] = `
|
||||
>
|
||||
<span
|
||||
class="ant-badge"
|
||||
title="5"
|
||||
>
|
||||
<span
|
||||
class="head-example"
|
||||
@@ -452,6 +452,7 @@ exports[`renders ./components/badge/demo/link.md correctly 1`] = `
|
||||
<sup
|
||||
class="ant-scroll-number ant-badge-count"
|
||||
data-show="true"
|
||||
title="5"
|
||||
>
|
||||
<span
|
||||
class="ant-scroll-number-only"
|
||||
@@ -617,11 +618,11 @@ exports[`renders ./components/badge/demo/no-wrapper.md correctly 1`] = `
|
||||
<div>
|
||||
<span
|
||||
class="ant-badge ant-badge-not-a-wrapper"
|
||||
title="25"
|
||||
>
|
||||
<sup
|
||||
class="ant-scroll-number ant-badge-count"
|
||||
data-show="true"
|
||||
title="25"
|
||||
>
|
||||
<span
|
||||
class="ant-scroll-number-only"
|
||||
@@ -937,12 +938,12 @@ exports[`renders ./components/badge/demo/no-wrapper.md correctly 1`] = `
|
||||
</span>
|
||||
<span
|
||||
class="ant-badge ant-badge-not-a-wrapper"
|
||||
title="4"
|
||||
>
|
||||
<sup
|
||||
class="ant-scroll-number ant-badge-count"
|
||||
data-show="true"
|
||||
style="background-color:#fff;color:#999;box-shadow:0 0 0 1px #d9d9d9 inset;"
|
||||
title="4"
|
||||
>
|
||||
<span
|
||||
class="ant-scroll-number-only"
|
||||
@@ -1103,12 +1104,12 @@ exports[`renders ./components/badge/demo/no-wrapper.md correctly 1`] = `
|
||||
</span>
|
||||
<span
|
||||
class="ant-badge ant-badge-not-a-wrapper"
|
||||
title="109"
|
||||
>
|
||||
<sup
|
||||
class="ant-scroll-number ant-badge-count"
|
||||
data-show="true"
|
||||
style="background-color:#87d068;"
|
||||
title="109"
|
||||
>
|
||||
99+
|
||||
</sup>
|
||||
@@ -1120,7 +1121,6 @@ exports[`renders ./components/badge/demo/overflow.md correctly 1`] = `
|
||||
<div>
|
||||
<span
|
||||
class="ant-badge"
|
||||
title="99"
|
||||
>
|
||||
<a
|
||||
class="head-example"
|
||||
@@ -1129,6 +1129,7 @@ exports[`renders ./components/badge/demo/overflow.md correctly 1`] = `
|
||||
<sup
|
||||
class="ant-scroll-number ant-badge-count"
|
||||
data-show="true"
|
||||
title="99"
|
||||
>
|
||||
<span
|
||||
class="ant-scroll-number-only"
|
||||
@@ -1444,7 +1445,6 @@ exports[`renders ./components/badge/demo/overflow.md correctly 1`] = `
|
||||
</span>
|
||||
<span
|
||||
class="ant-badge"
|
||||
title="100"
|
||||
>
|
||||
<a
|
||||
class="head-example"
|
||||
@@ -1453,13 +1453,13 @@ exports[`renders ./components/badge/demo/overflow.md correctly 1`] = `
|
||||
<sup
|
||||
class="ant-scroll-number ant-badge-count"
|
||||
data-show="true"
|
||||
title="100"
|
||||
>
|
||||
99+
|
||||
</sup>
|
||||
</span>
|
||||
<span
|
||||
class="ant-badge"
|
||||
title="99"
|
||||
>
|
||||
<a
|
||||
class="head-example"
|
||||
@@ -1468,13 +1468,13 @@ exports[`renders ./components/badge/demo/overflow.md correctly 1`] = `
|
||||
<sup
|
||||
class="ant-scroll-number ant-badge-count"
|
||||
data-show="true"
|
||||
title="99"
|
||||
>
|
||||
10+
|
||||
</sup>
|
||||
</span>
|
||||
<span
|
||||
class="ant-badge"
|
||||
title="1000"
|
||||
>
|
||||
<a
|
||||
class="head-example"
|
||||
@@ -1483,6 +1483,7 @@ exports[`renders ./components/badge/demo/overflow.md correctly 1`] = `
|
||||
<sup
|
||||
class="ant-scroll-number ant-badge-count"
|
||||
data-show="true"
|
||||
title="1000"
|
||||
>
|
||||
999+
|
||||
</sup>
|
||||
|
||||
@@ -60,7 +60,7 @@ class Demo extends React.Component {
|
||||
<Badge dot={this.state.show}>
|
||||
<a href="#" className="head-example" />
|
||||
</Badge>
|
||||
<Switch onChange={this.onChange} />
|
||||
<Switch onChange={this.onChange} checked={this.state.show} />
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -4,11 +4,11 @@ type: Data Display
|
||||
title: Badge
|
||||
---
|
||||
|
||||
Small numerical value or status descriptors for UI elements.
|
||||
Small numerical value or status descriptor for UI elements.
|
||||
|
||||
## When To Use
|
||||
|
||||
Badge normally appears in proximity to notification or head picture with eye-catching appeal, typically displaying unread messages count.
|
||||
Badge normally appears in proximity to notifications or user avatars with eye-catching appeal, typically displaying unread messages count.
|
||||
|
||||
## API
|
||||
|
||||
@@ -27,7 +27,7 @@ Badge normally appears in proximity to notification or head picture with eye-cat
|
||||
|----------------|-------------------------|------------|---------|
|
||||
| count | Number to show in badge | number | |
|
||||
| overflowCount | Max count to show | number | 99 |
|
||||
| showZero | Whether to show badge when `count` is zero | boolean | false |
|
||||
| dot | Whether to show red dot without number | boolean | false |
|
||||
| status | Set Badge as a status dot | Enum{ 'success', 'processing, 'default', 'error', 'warning' } | '' |
|
||||
| text | If `status` is set, `text` is to set the text of status dot | string | '' |
|
||||
| showZero | Whether to show badge when `count` is zero | boolean | `false` |
|
||||
| dot | Whether to display a red dot instead of `count` | boolean | `false` |
|
||||
| status | Set Badge as a status dot | `success` \| `processing` \| `default` \| `error` \| `warning` | `''` |
|
||||
| text | If `status` is set, `text` sets the display text of the status `dot` | string | `''` |
|
||||
|
||||
@@ -7,7 +7,7 @@ import warning from '../_util/warning';
|
||||
|
||||
export interface BadgeProps {
|
||||
/** Number to show in badge */
|
||||
count: number | string;
|
||||
count?: number | string;
|
||||
showZero?: boolean;
|
||||
/** Max count to show */
|
||||
overflowCount?: number;
|
||||
@@ -54,7 +54,7 @@ export default class Badge extends React.Component<BadgeProps, any> {
|
||||
...restProps,
|
||||
} = this.props;
|
||||
const isDot = dot || status;
|
||||
let displayCount = count > (overflowCount as number) ? `${overflowCount}+` : count;
|
||||
let displayCount = (count as number) > (overflowCount as number) ? `${overflowCount}+` : count;
|
||||
// dot mode don't need count
|
||||
if (isDot) {
|
||||
displayCount = '';
|
||||
@@ -95,6 +95,7 @@ export default class Badge extends React.Component<BadgeProps, any> {
|
||||
data-show={!hidden}
|
||||
className={scrollNumberCls}
|
||||
count={displayCount}
|
||||
title={count}
|
||||
style={style}
|
||||
/>
|
||||
);
|
||||
@@ -104,7 +105,7 @@ export default class Badge extends React.Component<BadgeProps, any> {
|
||||
);
|
||||
|
||||
return (
|
||||
<span {...restProps} className={badgeCls} title={count as string}>
|
||||
<span {...restProps} className={badgeCls}>
|
||||
{children}
|
||||
<Animate
|
||||
component=""
|
||||
|
||||
@@ -21,11 +21,10 @@
|
||||
line-height: @badge-height;
|
||||
text-align: center;
|
||||
padding: 0 6px;
|
||||
font-size: @font-size-base;
|
||||
font-size: @badge-font-size;
|
||||
white-space: nowrap;
|
||||
transform-origin: -10% center;
|
||||
font-family: tahoma;
|
||||
box-shadow: 0 0 0 1px #fff;
|
||||
a,
|
||||
a:hover {
|
||||
color: #fff;
|
||||
@@ -104,7 +103,7 @@
|
||||
top: auto;
|
||||
display: block;
|
||||
position: relative;
|
||||
transform: none!important;
|
||||
transform: none !important;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ export interface BreadcrumbProps {
|
||||
itemRender?: (route: any, params: any, routes: Array<any>, paths: Array<string>) => React.ReactNode;
|
||||
style?: React.CSSProperties;
|
||||
className?: string;
|
||||
};
|
||||
}
|
||||
|
||||
function getBreadcrumbName(route, params) {
|
||||
if (!route.breadcrumbName) {
|
||||
@@ -57,7 +57,7 @@ export default class Breadcrumb extends React.Component<BreadcrumbProps, any> {
|
||||
warning(
|
||||
!('linkRender' in props || 'nameRender' in props),
|
||||
'`linkRender` and `nameRender` are removed, please use `itemRender` instead, ' +
|
||||
'see: http://u.ant.design/item-render.',
|
||||
'see: https://u.ant.design/item-render.',
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ describe('Breadcrumb', () => {
|
||||
});
|
||||
|
||||
// https://github.com/airbnb/enzyme/issues/875
|
||||
xit('warns on non-Breadcrumb.Item children', () => {
|
||||
it('warns on non-Breadcrumb.Item children', () => {
|
||||
const MyCom = () => <div>foo</div>;
|
||||
mount(
|
||||
<Breadcrumb>
|
||||
|
||||
@@ -117,6 +117,45 @@ exports[`renders ./components/breadcrumb/demo/router.md correctly 1`] = `
|
||||
</div>
|
||||
`;
|
||||
|
||||
exports[`renders ./components/breadcrumb/demo/router-4.md correctly 1`] = `
|
||||
<div
|
||||
class="demo"
|
||||
>
|
||||
<div
|
||||
class="demo-nav"
|
||||
>
|
||||
<a
|
||||
href="#/"
|
||||
>
|
||||
Home
|
||||
</a>
|
||||
<a
|
||||
href="#/apps"
|
||||
>
|
||||
Application List
|
||||
</a>
|
||||
</div>
|
||||
Home Page
|
||||
<div
|
||||
class="ant-alert ant-alert-info ant-alert-no-icon"
|
||||
data-show="true"
|
||||
style="margin:16px 0;"
|
||||
>
|
||||
<span
|
||||
class="ant-alert-message"
|
||||
>
|
||||
Click the navigation above to switch:
|
||||
</span>
|
||||
<span
|
||||
class="ant-alert-description"
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
class="ant-breadcrumb"
|
||||
/>
|
||||
</div>
|
||||
`;
|
||||
|
||||
exports[`renders ./components/breadcrumb/demo/separator.md correctly 1`] = `
|
||||
<div
|
||||
class="ant-breadcrumb"
|
||||
|
||||
@@ -2,7 +2,7 @@ import { render } from 'enzyme';
|
||||
import demoTest from '../../../tests/shared/demoTest';
|
||||
import routerDemo from '../demo/router.md';
|
||||
|
||||
demoTest('breadcrumb', { skip: ['router.md'] });
|
||||
demoTest('breadcrumb', { skip: ['router.md', 'router-4.md'] });
|
||||
|
||||
const testMethod = typeof window !== 'undefined' ? test : test.skip;
|
||||
testMethod('renders ./components/breadcrumb/demo/router.md correctly', () => {
|
||||
|
||||
100
components/breadcrumb/demo/router-4.md
Normal file
100
components/breadcrumb/demo/router-4.md
Normal file
@@ -0,0 +1,100 @@
|
||||
---
|
||||
order: 3
|
||||
iframe: 200
|
||||
reactRouter: react-router-dom
|
||||
title:
|
||||
zh-CN: 其它路由
|
||||
en-US: Other Router Integration
|
||||
---
|
||||
|
||||
## zh-CN
|
||||
|
||||
和 `react-router@4`,或其他路由进行结合使用。
|
||||
|
||||
## en-US
|
||||
|
||||
Used together with `react-router@4` or other router.
|
||||
|
||||
````jsx
|
||||
import { HashRouter as Router, Route, Switch, Link, withRouter } from 'react-router-dom';
|
||||
import { Breadcrumb, Alert } from 'antd';
|
||||
|
||||
const Apps = () => (
|
||||
<ul className="app-list">
|
||||
<li>
|
||||
<Link to="/apps/1">Application1</Link>:<Link to="/apps/1/detail">Detail</Link>
|
||||
</li>
|
||||
<li>
|
||||
<Link to="/apps/2">Application2</Link>:<Link to="/apps/2/detail">Detail</Link>
|
||||
</li>
|
||||
</ul>
|
||||
);
|
||||
|
||||
const breadcrumbNameMap = {
|
||||
'/apps': 'Application List',
|
||||
'/apps/1': 'Application1',
|
||||
'/apps/2': 'Application2',
|
||||
'/apps/1/detail': 'Detail',
|
||||
'/apps/2/detail': 'Detail',
|
||||
};
|
||||
const Home = withRouter((props) => {
|
||||
const { location } = props;
|
||||
const pathSnippets = location.pathname.split('/').filter(i => i);
|
||||
const extraBreadcrumbItems = pathSnippets.map((_, index) => {
|
||||
const url = `/${pathSnippets.slice(0, index + 1).join('/')}`;
|
||||
return (
|
||||
<Breadcrumb.Item key={url}>
|
||||
<Link to={url}>
|
||||
{breadcrumbNameMap[url]}
|
||||
</Link>
|
||||
</Breadcrumb.Item>
|
||||
);
|
||||
});
|
||||
const breadcrumbItems = [(
|
||||
<Breadcrumb.Item key="home">
|
||||
<Link to="/">Home</Link>
|
||||
</Breadcrumb.Item>
|
||||
)].concat(extraBreadcrumbItems);
|
||||
return (
|
||||
<div className="demo">
|
||||
<div className="demo-nav">
|
||||
<Link to="/">Home</Link>
|
||||
<Link to="/apps">Application List</Link>
|
||||
</div>
|
||||
<Switch>
|
||||
<Route path="/apps" component={Apps} />
|
||||
<Route render={() => <span>Home Page</span>} />
|
||||
</Switch>
|
||||
<Alert style={{ margin: '16px 0' }} message="Click the navigation above to switch:" />
|
||||
<Breadcrumb>
|
||||
{breadcrumbItems}
|
||||
</Breadcrumb>
|
||||
</div>
|
||||
);
|
||||
});
|
||||
|
||||
ReactDOM.render(
|
||||
<Router>
|
||||
<Home />
|
||||
</Router>
|
||||
, mountNode);
|
||||
````
|
||||
|
||||
````css
|
||||
.demo {
|
||||
margin: 16px;
|
||||
}
|
||||
.demo-nav {
|
||||
height: 30px;
|
||||
line-height: 30px;
|
||||
margin-bottom: 16px;
|
||||
background: #f8f8f8;
|
||||
}
|
||||
.demo-nav a {
|
||||
line-height: 30px;
|
||||
padding: 0 8px;
|
||||
}
|
||||
.app-list {
|
||||
margin-top: 16px;
|
||||
}
|
||||
````
|
||||
@@ -1,18 +1,19 @@
|
||||
---
|
||||
order: 2
|
||||
iframe: 200
|
||||
reactRouter: react-router
|
||||
title:
|
||||
zh-CN: 路由
|
||||
zh-CN: react-router
|
||||
en-US: React Router Integration
|
||||
---
|
||||
|
||||
## zh-CN
|
||||
|
||||
和 `react-router@2+` 进行结合使用。
|
||||
和 `react-router@2` `react-router@3` 进行结合使用。
|
||||
|
||||
## en-US
|
||||
|
||||
Used together with `react-router@2+`.
|
||||
Used together with `react-router@2` `react-router@3`.
|
||||
|
||||
````jsx
|
||||
import { Router, Route, Link, hashHistory } from 'react-router';
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
order: 3
|
||||
order: 4
|
||||
title:
|
||||
zh-CN: 分隔符
|
||||
en-US: Configuring the Separator
|
||||
|
||||
@@ -18,15 +18,15 @@ A breadcrumb displays the current location within a hierarchy. It allows going b
|
||||
| Property | Description | Type | Optional | Default |
|
||||
|-----------|-----------------------------------|-----------------|---------|--------|
|
||||
| routes | The routing stack information of router | object[] | | - |
|
||||
| params | Routing parameter | object | | - |
|
||||
| separator | Custom separator | string\|ReactNode | | '/' |
|
||||
| params | Routing parameters | object | | - |
|
||||
| separator | Custom separator | string\|ReactNode | | `/` |
|
||||
| itemRender | Custom item renderer | (route, params, routes, paths) => ReactNode | | - |
|
||||
|
||||
> `linkRender` and `nameRender` were removed after `antd@2.0`, please use `itemRender` instead.
|
||||
|
||||
### Use with browserHistory
|
||||
|
||||
The link of Breadcrumb item contain `#` defaultly, you can use `itemRender` to make `browserHistory` Link.
|
||||
The link of Breadcrumb item targets `#` by default, you can use `itemRender` to make a `browserHistory` Link.
|
||||
|
||||
```jsx
|
||||
import { Link } from 'react-router';
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
}
|
||||
|
||||
& > span:last-child {
|
||||
font-weight: bold;
|
||||
font-weight: 500;
|
||||
color: @text-color;
|
||||
}
|
||||
|
||||
|
||||
@@ -480,12 +480,13 @@ exports[`renders ./components/button/demo/size.md correctly 1`] = `
|
||||
class="ant-radio-group"
|
||||
>
|
||||
<label
|
||||
class="ant-radio-button-wrapper"
|
||||
class="ant-radio-button-wrapper ant-radio-button-wrapper-checked"
|
||||
>
|
||||
<span
|
||||
class="ant-radio-button"
|
||||
class="ant-radio-button ant-radio-button-checked"
|
||||
>
|
||||
<input
|
||||
checked=""
|
||||
class="ant-radio-button-input"
|
||||
type="radio"
|
||||
/>
|
||||
@@ -498,13 +499,12 @@ exports[`renders ./components/button/demo/size.md correctly 1`] = `
|
||||
</span>
|
||||
</label>
|
||||
<label
|
||||
class="ant-radio-button-wrapper ant-radio-button-wrapper-checked"
|
||||
class="ant-radio-button-wrapper"
|
||||
>
|
||||
<span
|
||||
class="ant-radio-button ant-radio-button-checked"
|
||||
class="ant-radio-button"
|
||||
>
|
||||
<input
|
||||
checked=""
|
||||
class="ant-radio-button-input"
|
||||
type="radio"
|
||||
/>
|
||||
@@ -538,7 +538,40 @@ exports[`renders ./components/button/demo/size.md correctly 1`] = `
|
||||
<br />
|
||||
<br />
|
||||
<button
|
||||
class="ant-btn ant-btn-primary ant-btn-circle ant-btn-icon-only"
|
||||
class="ant-btn ant-btn-primary ant-btn-lg"
|
||||
type="button"
|
||||
>
|
||||
<span>
|
||||
Primary
|
||||
</span>
|
||||
</button>
|
||||
<button
|
||||
class="ant-btn ant-btn-lg"
|
||||
type="button"
|
||||
>
|
||||
<span>
|
||||
Normal
|
||||
</span>
|
||||
</button>
|
||||
<button
|
||||
class="ant-btn ant-btn-dashed ant-btn-lg"
|
||||
type="button"
|
||||
>
|
||||
<span>
|
||||
Dashed
|
||||
</span>
|
||||
</button>
|
||||
<button
|
||||
class="ant-btn ant-btn-danger ant-btn-lg"
|
||||
type="button"
|
||||
>
|
||||
<span>
|
||||
Danger
|
||||
</span>
|
||||
</button>
|
||||
<br />
|
||||
<button
|
||||
class="ant-btn ant-btn-primary ant-btn-circle ant-btn-lg ant-btn-icon-only"
|
||||
type="button"
|
||||
>
|
||||
<i
|
||||
@@ -546,7 +579,7 @@ exports[`renders ./components/button/demo/size.md correctly 1`] = `
|
||||
/>
|
||||
</button>
|
||||
<button
|
||||
class="ant-btn ant-btn-primary"
|
||||
class="ant-btn ant-btn-primary ant-btn-lg"
|
||||
type="button"
|
||||
>
|
||||
<i
|
||||
@@ -556,17 +589,9 @@ exports[`renders ./components/button/demo/size.md correctly 1`] = `
|
||||
Download
|
||||
</span>
|
||||
</button>
|
||||
<button
|
||||
class="ant-btn ant-btn-primary"
|
||||
type="button"
|
||||
>
|
||||
<span>
|
||||
Normal
|
||||
</span>
|
||||
</button>
|
||||
<br />
|
||||
<div
|
||||
class="ant-btn-group"
|
||||
class="ant-btn-group ant-btn-group-lg"
|
||||
>
|
||||
<button
|
||||
class="ant-btn ant-btn-primary"
|
||||
|
||||
@@ -10,7 +10,7 @@ export interface ButtonGroupProps {
|
||||
prefixCls?: string;
|
||||
}
|
||||
|
||||
export default function ButtonGroup(props: ButtonGroupProps) {
|
||||
const ButtonGroup: React.SFC<ButtonGroupProps> = (props) => {
|
||||
const { prefixCls = 'ant-btn-group', size = '', className, ...others } = props;
|
||||
|
||||
// large => lg
|
||||
@@ -31,4 +31,6 @@ export default function ButtonGroup(props: ButtonGroupProps) {
|
||||
}, className);
|
||||
|
||||
return <div {...others} className={classes} />;
|
||||
}
|
||||
};
|
||||
|
||||
export default ButtonGroup;
|
||||
|
||||
@@ -122,13 +122,6 @@ export default class Button extends React.Component<ButtonProps, any> {
|
||||
}
|
||||
}
|
||||
|
||||
// Handle auto focus when click button in Chrome
|
||||
handleMouseUp = (e: React.MouseEvent<HTMLButtonElement>) => {
|
||||
if (this.props.onMouseUp) {
|
||||
this.props.onMouseUp(e);
|
||||
}
|
||||
}
|
||||
|
||||
render() {
|
||||
const {
|
||||
type, shape, size = '', className, htmlType, children, icon, prefixCls, ghost, ...others,
|
||||
@@ -149,7 +142,7 @@ export default class Button extends React.Component<ButtonProps, any> {
|
||||
break;
|
||||
}
|
||||
|
||||
const classes = classNames(prefixCls, {
|
||||
const classes = classNames(prefixCls, className, {
|
||||
[`${prefixCls}-${type}`]: type,
|
||||
[`${prefixCls}-${shape}`]: shape,
|
||||
[`${prefixCls}-${sizeCls}`]: sizeCls,
|
||||
@@ -157,11 +150,11 @@ export default class Button extends React.Component<ButtonProps, any> {
|
||||
[`${prefixCls}-loading`]: loading,
|
||||
[`${prefixCls}-clicked`]: clicked,
|
||||
[`${prefixCls}-background-ghost`]: ghost,
|
||||
}, className);
|
||||
});
|
||||
|
||||
const iconType = loading ? 'loading' : icon;
|
||||
const iconNode = iconType ? <Icon type={iconType} /> : null;
|
||||
const needInserted = React.Children.count(children) === 1 && !iconType;
|
||||
const needInserted = React.Children.count(children) === 1 && (!iconType || iconType === 'loading');
|
||||
const kids = React.Children.map(children, child => insertSpace(child, needInserted));
|
||||
|
||||
return (
|
||||
@@ -169,7 +162,6 @@ export default class Button extends React.Component<ButtonProps, any> {
|
||||
{...omit(others, ['loading', 'clicked'])}
|
||||
type={htmlType || 'button'}
|
||||
className={classes}
|
||||
onMouseUp={this.handleMouseUp}
|
||||
onClick={this.handleClick}
|
||||
>
|
||||
{iconNode}{kids}
|
||||
|
||||
@@ -22,7 +22,7 @@ import { Button, Radio, Icon } from 'antd';
|
||||
|
||||
class ButtonSize extends React.Component {
|
||||
state = {
|
||||
size: 'default',
|
||||
size: 'large',
|
||||
};
|
||||
|
||||
handleSizeChange = (e) => {
|
||||
@@ -39,9 +39,13 @@ class ButtonSize extends React.Component {
|
||||
<Radio.Button value="small">Small</Radio.Button>
|
||||
</Radio.Group>
|
||||
<br /><br />
|
||||
<Button type="primary" size={size}>Primary</Button>
|
||||
<Button size={size}>Normal</Button>
|
||||
<Button type="dashed" size={size}>Dashed</Button>
|
||||
<Button type="danger" size={size}>Danger</Button>
|
||||
<br />
|
||||
<Button type="primary" shape="circle" icon="download" size={size} />
|
||||
<Button type="primary" icon="download" size={size}>Download</Button>
|
||||
<Button type="primary" size={size}>Normal</Button>
|
||||
<br />
|
||||
<Button.Group size={size}>
|
||||
<Button type="primary">
|
||||
|
||||
@@ -16,14 +16,14 @@ To get a customized button, just set `type`/`shape`/`size`/`loading`/`disabled`.
|
||||
|
||||
Property | Description | Type | Default
|
||||
-----|-----|-----|------
|
||||
type | can be set to `primary` `dashed` `danger`(added in 2.7) or omitted | string | 'default'
|
||||
htmlType | to set the original `type` of `button`, see: [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#attr-type) | string | `button`
|
||||
type | can be set to `primary` `ghost` `dashed` `danger`(added in 2.7) or omitted (meaning `default`) | string | `default`
|
||||
htmlType | set the original html `type` of `button`, see: [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#attr-type) | string | `button`
|
||||
icon | set the icon of button, see: Icon component | string | -
|
||||
shape | can be set to `circle` or omitted | string | -
|
||||
size | can be set to `small` `large` or omitted | string | `default`
|
||||
loading | to set the loading status of button | boolean \| { delay: number } | `false`
|
||||
loading | set the loading status of button | boolean \| { delay: number } | false
|
||||
onClick | set the handler to handle `click` event | function | -
|
||||
ghost | make background transparent and invert text and border color, added in 2.7 | boolean | false
|
||||
ghost | make background transparent and invert text and border colors, added in 2.7 | boolean | false
|
||||
|
||||
`<Button>Hello world!</Button>` will be rendered into `<button>Hello world!</button>`, and all the properties which are not listed above will be transferred to the `<button>` tag.
|
||||
|
||||
|
||||
@@ -5,9 +5,9 @@
|
||||
@btn-prefix-cls: ~"@{ant-prefix}-btn";
|
||||
|
||||
// for compatibile
|
||||
@btn-ghost-color : @text-color;
|
||||
@btn-ghost-bg : transparent;
|
||||
@btn-ghost-border : @border-color-base;
|
||||
@btn-ghost-color: @text-color;
|
||||
@btn-ghost-bg: transparent;
|
||||
@btn-ghost-border: @border-color-base;
|
||||
|
||||
// Button styles
|
||||
// -----------------------------
|
||||
@@ -15,6 +15,13 @@
|
||||
.btn;
|
||||
.btn-default;
|
||||
|
||||
// Make sure that the target of Button's click event always be `button`
|
||||
// Ref: https://github.com/ant-design/ant-design/issues/7034
|
||||
> i,
|
||||
> span {
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
&-primary {
|
||||
.btn-primary;
|
||||
|
||||
@@ -86,7 +93,7 @@
|
||||
display: block;
|
||||
}
|
||||
|
||||
&&-loading:not(&-circle):not(&-circle-outline) {
|
||||
&&-loading:not(&-circle):not(&-circle-outline):not(&-icon-only) {
|
||||
padding-left: 29px;
|
||||
pointer-events: none;
|
||||
position: relative;
|
||||
@@ -95,7 +102,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
&-sm&-loading:not(&-circle):not(&-circle-outline) {
|
||||
&-sm&-loading:not(&-circle):not(&-circle-outline):not(&-icon-only) {
|
||||
padding-left: 24px;
|
||||
.@{iconfont-css-prefix} {
|
||||
margin-left: -17px;
|
||||
@@ -142,7 +149,7 @@
|
||||
}
|
||||
|
||||
&-background-ghost {
|
||||
background: transparent!important;
|
||||
background: transparent !important;
|
||||
border-color: #fff;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
@@ -147,7 +147,7 @@
|
||||
background-image: none;
|
||||
border: @border-width-base @border-style-base transparent;
|
||||
white-space: nowrap;
|
||||
line-height: @line-height-base;
|
||||
line-height: 1.15; // https://github.com/ant-design/ant-design/issues/7070
|
||||
.button-size(@btn-height-base; @btn-padding-base; @font-size-base; @btn-border-radius-base);
|
||||
user-select: none;
|
||||
transition: all .3s @ease-in-out;
|
||||
@@ -224,11 +224,11 @@
|
||||
// circle button: the content only contains icon
|
||||
.btn-circle(@btnClassName: btn) {
|
||||
.square(@btn-circle-size);
|
||||
.button-size(@btn-circle-size; 0; @font-size-base + 2; 50%);
|
||||
.button-size(@btn-circle-size; 0; @font-size-base + 2px; 50%);
|
||||
|
||||
&.@{btnClassName}-lg {
|
||||
.square(@btn-circle-size-lg);
|
||||
.button-size(@btn-circle-size-lg; 0; @btn-font-size-lg + 2; 50%);
|
||||
.button-size(@btn-circle-size-lg; 0; @btn-font-size-lg + 2px; 50%);
|
||||
}
|
||||
|
||||
&.@{btnClassName}-sm {
|
||||
|
||||
@@ -24,6 +24,8 @@ export default class Header extends React.Component<HeaderProps, any> {
|
||||
yearSelectTotal: 20,
|
||||
};
|
||||
|
||||
calenderHeaderNode: any;
|
||||
|
||||
getYearSelectElement(year) {
|
||||
const { yearSelectOffset, yearSelectTotal, locale, prefixCls, fullscreen } = this.props;
|
||||
const start = year - (yearSelectOffset as number);
|
||||
@@ -41,6 +43,7 @@ export default class Header extends React.Component<HeaderProps, any> {
|
||||
className={`${prefixCls}-year-select`}
|
||||
onChange={this.onYearChange}
|
||||
value={String(year)}
|
||||
getPopupContainer={() => this.calenderHeaderNode}
|
||||
>
|
||||
{options}
|
||||
</Select>
|
||||
@@ -74,6 +77,7 @@ export default class Header extends React.Component<HeaderProps, any> {
|
||||
className={`${prefixCls}-month-select`}
|
||||
value={String(month)}
|
||||
onChange={this.onMonthChange}
|
||||
getPopupContainer={() => this.calenderHeaderNode}
|
||||
>
|
||||
{options}
|
||||
</Select>
|
||||
@@ -106,6 +110,10 @@ export default class Header extends React.Component<HeaderProps, any> {
|
||||
}
|
||||
}
|
||||
|
||||
getCalenderHeaderNode = (node) => {
|
||||
this.calenderHeaderNode = node;
|
||||
}
|
||||
|
||||
render() {
|
||||
const { type, value, prefixCls, locale, fullscreen } = this.props;
|
||||
const yearSelect = this.getYearSelectElement(value.year());
|
||||
@@ -120,7 +128,7 @@ export default class Header extends React.Component<HeaderProps, any> {
|
||||
);
|
||||
|
||||
return (
|
||||
<div className={`${prefixCls}-header`}>
|
||||
<div className={`${prefixCls}-header`} ref={this.getCalenderHeaderNode}>
|
||||
{yearSelect}
|
||||
{monthSelect}
|
||||
{typeSwitch}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -9,11 +9,11 @@ Container for displaying data in calendar form.
|
||||
|
||||
## When To Use
|
||||
|
||||
When data is in the form of date, such as schedule, timetable, prices calendar, Lunar calendar. This component also supports Year/Month switch.
|
||||
When data is in the form of dates, such as schedules, timetables, prices calendar, lunar calendar. This component also supports Year/Month switch.
|
||||
|
||||
## API
|
||||
|
||||
**Note:** Part of locale of Calendar is read from value. So, please set the locale of moment correctly.
|
||||
**Note:** Part of the Calendar's locale is read from `value`. So, please set the locale of `moment` correctly.
|
||||
|
||||
```jsx
|
||||
import moment from 'moment';
|
||||
@@ -32,14 +32,15 @@ moment.locale('zh-cn');
|
||||
|
||||
| Property | Description | Type | Default |
|
||||
|--------------|----------------|----------|--------------|
|
||||
| value | set date | [moment](http://momentjs.com/) | current date |
|
||||
| defaultValue | set default date | [moment](http://momentjs.com/) | default date |
|
||||
| mode | can be set to month or year | string | month |
|
||||
| fullscreen | to set whether full-screen display | boolean | true |
|
||||
| dateCellRender | to set the way of renderer the date cell, the returned content will be appended to the cell | function(date: moment): ReactNode | - |
|
||||
| monthCellRender | to set the way of renderer the month cell, the returned content will be appended to the cell | function(date: moment): ReactNode | - |
|
||||
| dateFullCellRender | to set the way of renderer the date cell,the returned content will override the cell | function(date: moment): ReactNode | - |
|
||||
| monthFullCellRender | to set the way of renderer the month cell,the returned content will override the cell | function(date: moment): ReactNode | - |
|
||||
| locale | set locale | object | [default](https://github.com/ant-design/ant-design/blob/master/components/date-picker/locale/example.json) |
|
||||
| onPanelChange| callback when panel change | function(date: moment, mode: string) | - |
|
||||
| onSelect | callback when select date | function(date: moment) | - |
|
||||
| value | The current selected date | [moment](http://momentjs.com/) | current date |
|
||||
| defaultValue | The date selected by default | [moment](http://momentjs.com/) | default date |
|
||||
| mode | The display mode of the calendar | `month` \| `year` | `month` |
|
||||
| fullscreen | Whether to display in full-screen | boolean | `true` |
|
||||
| dateCellRender | Customize the display of the date cell, the returned content will be appended to the cell | function(date: moment): ReactNode | - |
|
||||
| monthCellRender | Customize the display of the month cell, the returned content will be appended to the cell | function(date: moment): ReactNode | - |
|
||||
| dateFullCellRender | Customize the display of the date cell, the returned content will override the cell | function(date: moment): ReactNode | - |
|
||||
| monthFullCellRender | Customize the display of the month cell, the returned content will override the cell | function(date: moment): ReactNode | - |
|
||||
| locale | The calendar's locale | object | [default](https://github.com/ant-design/ant-design/blob/master/components/date-picker/locale/example.json) |
|
||||
| onPanelChange| Callback for when panel changes | function(date: moment, mode: string) | - |
|
||||
| onSelect | Callback for when a date is selected | function(date: moment) | - |
|
||||
| disabledDate | Function that specifies the dates that cannot be selected | (currentDate: moment) => boolean | - |
|
||||
|
||||
@@ -39,6 +39,7 @@ export interface CalendarProps {
|
||||
style?: React.CSSProperties;
|
||||
onPanelChange?: (date?: moment.Moment, mode?: CalendarMode) => void;
|
||||
onSelect?: (date?: moment.Moment) => void;
|
||||
disabledDate?: (current: moment.Moment) => boolean;
|
||||
}
|
||||
|
||||
export interface CalendarState {
|
||||
@@ -86,7 +87,7 @@ export default class Calendar extends React.Component<CalendarProps, CalendarSta
|
||||
if (!moment.isMoment(value)) {
|
||||
throw new Error(
|
||||
'The value/defaultValue of Calendar must be a moment object after `antd@2.0`, ' +
|
||||
'see: http://u.ant.design/calendar-value',
|
||||
'see: https://u.ant.design/calendar-value',
|
||||
);
|
||||
}
|
||||
this.state = {
|
||||
|
||||
@@ -45,3 +45,4 @@ moment.locale('zh-cn');
|
||||
| locale | 国际化配置 | object | [默认配置](https://github.com/ant-design/ant-design/blob/master/components/date-picker/locale/example.json) |
|
||||
| onPanelChange| 日期面板变化回调 | function(date: moment, mode: string) | 无 |
|
||||
| onSelect | 点击选择日期回调 | function(date: moment) | 无 |
|
||||
| disabledDate | 不可选择的日期 | (currentDate: moment) => boolean | 无 |
|
||||
|
||||
2
components/calendar/locale/bg_BG.tsx
Normal file
2
components/calendar/locale/bg_BG.tsx
Normal file
@@ -0,0 +1,2 @@
|
||||
import bg_BG from '../../date-picker/locale/bg_BG';
|
||||
export default bg_BG;
|
||||
2
components/calendar/locale/el_GR.tsx
Normal file
2
components/calendar/locale/el_GR.tsx
Normal file
@@ -0,0 +1,2 @@
|
||||
import el_GR from '../../date-picker/locale/el_GR';
|
||||
export default el_GR;
|
||||
2
components/calendar/locale/en_GB.tsx
Normal file
2
components/calendar/locale/en_GB.tsx
Normal file
@@ -0,0 +1,2 @@
|
||||
import en_GB from '../../date-picker/locale/en_GB';
|
||||
export default en_GB;
|
||||
2
components/calendar/locale/fa_IR.tsx
Normal file
2
components/calendar/locale/fa_IR.tsx
Normal file
@@ -0,0 +1,2 @@
|
||||
import fa_IR from '../../date-picker/locale/fa_IR';
|
||||
export default fa_IR;
|
||||
2
components/calendar/locale/fr_FR.tsx
Normal file
2
components/calendar/locale/fr_FR.tsx
Normal file
@@ -0,0 +1,2 @@
|
||||
import fr_FR from '../../date-picker/locale/fr_FR';
|
||||
export default fr_FR;
|
||||
2
components/calendar/locale/it_IT.tsx
Normal file
2
components/calendar/locale/it_IT.tsx
Normal file
@@ -0,0 +1,2 @@
|
||||
import it_IT from '../../date-picker/locale/it_IT';
|
||||
export default it_IT;
|
||||
2
components/calendar/locale/nb_NO.tsx
Normal file
2
components/calendar/locale/nb_NO.tsx
Normal file
@@ -0,0 +1,2 @@
|
||||
import nb_NO from '../../date-picker/locale/nb_NO';
|
||||
export default nb_NO;
|
||||
2
components/calendar/locale/nl_BE.tsx
Normal file
2
components/calendar/locale/nl_BE.tsx
Normal file
@@ -0,0 +1,2 @@
|
||||
import nl_BE from '../../date-picker/locale/nl_BE';
|
||||
export default nl_BE;
|
||||
2
components/calendar/locale/pl_PL.tsx
Normal file
2
components/calendar/locale/pl_PL.tsx
Normal file
@@ -0,0 +1,2 @@
|
||||
import pl_PL from '../../date-picker/locale/pl_PL';
|
||||
export default pl_PL;
|
||||
2
components/calendar/locale/pt_PT.tsx
Normal file
2
components/calendar/locale/pt_PT.tsx
Normal file
@@ -0,0 +1,2 @@
|
||||
import pt_PT from '../../date-picker/locale/pt_PT';
|
||||
export default pt_PT;
|
||||
2
components/calendar/locale/sr_RS.tsx
Normal file
2
components/calendar/locale/sr_RS.tsx
Normal file
@@ -0,0 +1,2 @@
|
||||
import sr_RS from '../../date-picker/locale/sr_RS';
|
||||
export default sr_RS;
|
||||
2
components/calendar/locale/th_TH.tsx
Normal file
2
components/calendar/locale/th_TH.tsx
Normal file
@@ -0,0 +1,2 @@
|
||||
import th_TH from '../../date-picker/locale/th_TH';
|
||||
export default th_TH;
|
||||
@@ -16,7 +16,7 @@
|
||||
padding: 11px 16px 11px 0;
|
||||
text-align: right;
|
||||
|
||||
.@{ant-prefix}-select {
|
||||
.@{ant-prefix}-select-dropdown {
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
@@ -125,18 +125,6 @@
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
&-disabled-cell &-value {
|
||||
cursor: not-allowed;
|
||||
color: @disabled-color;
|
||||
background: @disabled-bg;
|
||||
border-radius: 0;
|
||||
width: auto;
|
||||
|
||||
&:hover {
|
||||
background: @disabled-bg;
|
||||
}
|
||||
}
|
||||
|
||||
&-disabled-cell-first-of-row &-value {
|
||||
border-top-left-radius: @border-radius-base;
|
||||
border-bottom-left-radius: @border-radius-base;
|
||||
@@ -254,4 +242,25 @@
|
||||
left: auto;
|
||||
bottom: auto;
|
||||
}
|
||||
|
||||
&-disabled-cell &-date {
|
||||
&,
|
||||
&:hover {
|
||||
cursor: not-allowed;
|
||||
}
|
||||
}
|
||||
|
||||
&-disabled-cell:not(&-today) &-date {
|
||||
&,
|
||||
&:hover {
|
||||
background: transparent;
|
||||
}
|
||||
}
|
||||
|
||||
&-disabled-cell &-value {
|
||||
color: @disabled-color;
|
||||
border-radius: 0;
|
||||
width: auto;
|
||||
cursor: not-allowed;
|
||||
}
|
||||
}
|
||||
|
||||
14
components/card/Grid.tsx
Normal file
14
components/card/Grid.tsx
Normal file
@@ -0,0 +1,14 @@
|
||||
import React from 'react';
|
||||
import classNames from 'classnames';
|
||||
|
||||
export interface CardGridProps {
|
||||
prefixCls?: string;
|
||||
style?: React.CSSProperties;
|
||||
className?: string;
|
||||
}
|
||||
|
||||
export default (props: CardGridProps) => {
|
||||
const { prefixCls = 'ant-card', className, ...others } = props;
|
||||
const classString = classNames(`${prefixCls}-grid`, className);
|
||||
return <div {...others} className={classString} />;
|
||||
};
|
||||
@@ -8,20 +8,20 @@ exports[`renders ./components/card/demo/basic.md correctly 1`] = `
|
||||
<div
|
||||
class="ant-card-head"
|
||||
>
|
||||
<h3
|
||||
<div
|
||||
class="ant-card-head-title"
|
||||
>
|
||||
Card title
|
||||
</h3>
|
||||
</div>
|
||||
<div
|
||||
class="ant-card-extra"
|
||||
>
|
||||
<a
|
||||
href="#"
|
||||
</div>
|
||||
<div
|
||||
class="ant-card-extra"
|
||||
>
|
||||
More
|
||||
</a>
|
||||
<a
|
||||
href="#"
|
||||
>
|
||||
More
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
class="ant-card-body"
|
||||
@@ -50,11 +50,11 @@ exports[`renders ./components/card/demo/border-less.md correctly 1`] = `
|
||||
<div
|
||||
class="ant-card-head"
|
||||
>
|
||||
<h3
|
||||
<div
|
||||
class="ant-card-head-title"
|
||||
>
|
||||
Card title
|
||||
</h3>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
class="ant-card-body"
|
||||
@@ -73,15 +73,79 @@ exports[`renders ./components/card/demo/border-less.md correctly 1`] = `
|
||||
</div>
|
||||
`;
|
||||
|
||||
exports[`renders ./components/card/demo/grid.md correctly 1`] = `
|
||||
exports[`renders ./components/card/demo/grid-card.md correctly 1`] = `
|
||||
<div
|
||||
class="ant-card ant-card-bordered ant-card-no-hovering ant-card-contain-grid"
|
||||
>
|
||||
<div
|
||||
class="ant-card-head"
|
||||
>
|
||||
<div
|
||||
class="ant-card-head-title"
|
||||
>
|
||||
Card Title
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
class="ant-card-body"
|
||||
>
|
||||
<div
|
||||
class="ant-card-grid"
|
||||
style="width:25%;text-align:center;"
|
||||
>
|
||||
Content
|
||||
</div>
|
||||
<div
|
||||
class="ant-card-grid"
|
||||
style="width:25%;text-align:center;"
|
||||
>
|
||||
Content
|
||||
</div>
|
||||
<div
|
||||
class="ant-card-grid"
|
||||
style="width:25%;text-align:center;"
|
||||
>
|
||||
Content
|
||||
</div>
|
||||
<div
|
||||
class="ant-card-grid"
|
||||
style="width:25%;text-align:center;"
|
||||
>
|
||||
Content
|
||||
</div>
|
||||
<div
|
||||
class="ant-card-grid"
|
||||
style="width:25%;text-align:center;"
|
||||
>
|
||||
Content
|
||||
</div>
|
||||
<div
|
||||
class="ant-card-grid"
|
||||
style="width:25%;text-align:center;"
|
||||
>
|
||||
Content
|
||||
</div>
|
||||
<div
|
||||
class="ant-card-grid"
|
||||
style="width:25%;text-align:center;"
|
||||
>
|
||||
Content
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
|
||||
exports[`renders ./components/card/demo/in-column.md correctly 1`] = `
|
||||
<div
|
||||
style="background:#ECECEC;padding:30px;"
|
||||
>
|
||||
<div
|
||||
class="ant-row"
|
||||
style="margin-left:-8px;margin-right:-8px;"
|
||||
>
|
||||
<div
|
||||
class="ant-col-8"
|
||||
style="padding-left:8px;padding-right:8px;"
|
||||
>
|
||||
<div
|
||||
class="ant-card"
|
||||
@@ -89,11 +153,11 @@ exports[`renders ./components/card/demo/grid.md correctly 1`] = `
|
||||
<div
|
||||
class="ant-card-head"
|
||||
>
|
||||
<h3
|
||||
<div
|
||||
class="ant-card-head-title"
|
||||
>
|
||||
Card title
|
||||
</h3>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
class="ant-card-body"
|
||||
@@ -104,6 +168,7 @@ exports[`renders ./components/card/demo/grid.md correctly 1`] = `
|
||||
</div>
|
||||
<div
|
||||
class="ant-col-8"
|
||||
style="padding-left:8px;padding-right:8px;"
|
||||
>
|
||||
<div
|
||||
class="ant-card"
|
||||
@@ -111,11 +176,11 @@ exports[`renders ./components/card/demo/grid.md correctly 1`] = `
|
||||
<div
|
||||
class="ant-card-head"
|
||||
>
|
||||
<h3
|
||||
<div
|
||||
class="ant-card-head-title"
|
||||
>
|
||||
Card title
|
||||
</h3>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
class="ant-card-body"
|
||||
@@ -126,6 +191,7 @@ exports[`renders ./components/card/demo/grid.md correctly 1`] = `
|
||||
</div>
|
||||
<div
|
||||
class="ant-col-8"
|
||||
style="padding-left:8px;padding-right:8px;"
|
||||
>
|
||||
<div
|
||||
class="ant-card"
|
||||
@@ -133,11 +199,11 @@ exports[`renders ./components/card/demo/grid.md correctly 1`] = `
|
||||
<div
|
||||
class="ant-card-head"
|
||||
>
|
||||
<h3
|
||||
<div
|
||||
class="ant-card-head-title"
|
||||
>
|
||||
Card title
|
||||
</h3>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
class="ant-card-body"
|
||||
@@ -158,16 +224,18 @@ exports[`renders ./components/card/demo/loading.md correctly 1`] = `
|
||||
<div
|
||||
class="ant-card-head"
|
||||
>
|
||||
<h3
|
||||
<div
|
||||
class="ant-card-head-title"
|
||||
>
|
||||
Card title
|
||||
</h3>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
class="ant-card-body"
|
||||
>
|
||||
<div>
|
||||
<div
|
||||
class="ant-card-loading-content"
|
||||
>
|
||||
<p
|
||||
class="ant-card-loading-block"
|
||||
style="width:94%;"
|
||||
|
||||
28
components/card/__tests__/index.test.js
Normal file
28
components/card/__tests__/index.test.js
Normal file
@@ -0,0 +1,28 @@
|
||||
import React from 'react';
|
||||
import { mount } from 'enzyme';
|
||||
import Card from '../index';
|
||||
|
||||
const delay = timeout => new Promise(resolve => setTimeout(resolve, timeout));
|
||||
const testMethod = typeof window !== 'undefined' ? it : xit;
|
||||
|
||||
describe('Card', () => {
|
||||
function fakeResizeWindowTo(wrapper, width) {
|
||||
Object.defineProperties(wrapper.node.container, {
|
||||
offsetWidth: {
|
||||
get() { return width; },
|
||||
configurable: true,
|
||||
},
|
||||
});
|
||||
window.resizeTo(width);
|
||||
}
|
||||
|
||||
testMethod('resize card will trigger different padding', async () => {
|
||||
const wrapper = mount(<Card title="xxx">xxx</Card>);
|
||||
fakeResizeWindowTo(wrapper, 1000);
|
||||
await delay(0);
|
||||
expect(wrapper.hasClass('ant-card-wider-padding')).toBe(true);
|
||||
fakeResizeWindowTo(wrapper, 800);
|
||||
await delay(0);
|
||||
expect(wrapper.hasClass('ant-card-wider-padding')).toBe(false);
|
||||
});
|
||||
});
|
||||
35
components/card/demo/grid-card.md
Normal file
35
components/card/demo/grid-card.md
Normal file
@@ -0,0 +1,35 @@
|
||||
---
|
||||
order: 6
|
||||
title:
|
||||
zh-CN: 网格型内嵌卡片
|
||||
en-US: Grid card
|
||||
---
|
||||
|
||||
## zh-CN
|
||||
|
||||
一种常见的卡片内容区隔模式。
|
||||
|
||||
## en-US
|
||||
|
||||
Grid style card content.
|
||||
|
||||
````jsx
|
||||
import { Card } from 'antd';
|
||||
|
||||
const gridStyle = {
|
||||
width: '25%',
|
||||
textAlign: 'center',
|
||||
};
|
||||
|
||||
ReactDOM.render(
|
||||
<Card title="Card Title" noHovering>
|
||||
<Card.Grid style={gridStyle}>Content</Card.Grid>
|
||||
<Card.Grid style={gridStyle}>Content</Card.Grid>
|
||||
<Card.Grid style={gridStyle}>Content</Card.Grid>
|
||||
<Card.Grid style={gridStyle}>Content</Card.Grid>
|
||||
<Card.Grid style={gridStyle}>Content</Card.Grid>
|
||||
<Card.Grid style={gridStyle}>Content</Card.Grid>
|
||||
<Card.Grid style={gridStyle}>Content</Card.Grid>
|
||||
</Card>
|
||||
, mountNode);
|
||||
````
|
||||
@@ -2,7 +2,7 @@
|
||||
order: 4
|
||||
title:
|
||||
zh-CN: 栅格卡片
|
||||
en-US: Grid card
|
||||
en-US: Card in column
|
||||
---
|
||||
|
||||
## zh-CN
|
||||
@@ -11,35 +11,24 @@ title:
|
||||
|
||||
## en-US
|
||||
|
||||
Cards usually cooperate with grid layout in overview page.
|
||||
Cards usually cooperate with grid column layout in overview page.
|
||||
|
||||
````jsx
|
||||
import { Card, Col, Row } from 'antd';
|
||||
|
||||
ReactDOM.render(
|
||||
<div style={{ background: '#ECECEC', padding: '30px' }}>
|
||||
<Row>
|
||||
<Col span="8">
|
||||
<Row gutter={16}>
|
||||
<Col span={8}>
|
||||
<Card title="Card title" bordered={false}>Card content</Card>
|
||||
</Col>
|
||||
<Col span="8">
|
||||
<Col span={8}>
|
||||
<Card title="Card title" bordered={false}>Card content</Card>
|
||||
</Col>
|
||||
<Col span="8">
|
||||
<Col span={8}>
|
||||
<Card title="Card title" bordered={false}>Card content</Card>
|
||||
</Col>
|
||||
</Row>
|
||||
</div>
|
||||
, mountNode);
|
||||
````
|
||||
|
||||
````css
|
||||
/* Increase grid spacing of 16px */
|
||||
.code-box-demo .ant-row {
|
||||
margin-left: -8px;
|
||||
margin-right: -8px;
|
||||
}
|
||||
.code-box-demo .ant-row > div {
|
||||
padding: 0 8px;
|
||||
}
|
||||
````
|
||||
@@ -5,11 +5,11 @@ title: Card
|
||||
cols: 1
|
||||
---
|
||||
|
||||
Simple rectangular container
|
||||
Simple rectangular container.
|
||||
|
||||
## When To Use
|
||||
|
||||
A card can be used to display content related to a single subject. The content can consist of multiple elements of varying type and size.
|
||||
A card can be used to display content related to a single subject. The content can consist of multiple elements of varying types and sizes.
|
||||
|
||||
## API
|
||||
|
||||
@@ -17,10 +17,20 @@ A card can be used to display content related to a single subject. The content c
|
||||
<Card title="Card title">Card content</Card>
|
||||
```
|
||||
|
||||
### Card
|
||||
|
||||
| Property | Description | Type | Default |
|
||||
|----------|----------------|----------|--------------|
|
||||
| title | Card title | string\|ReactNode | - |
|
||||
| extra | Content to render in the top-right corner of the card | string\|ReactNode | - |
|
||||
| bordered | Toggles rendering of the border around the card | boolean | true |
|
||||
| bordered | Toggles rendering of the border around the card | boolean | `true` |
|
||||
| bodyStyle | Inline style to apply to the card content | object | - |
|
||||
| loading | Shows a loading indicator while the contents of the card are being fetched | boolean | false |
|
||||
| noHovering | Whether to disable hover effect on mouse over | boolean | `false` |
|
||||
| loading | Shows a loading indicator while the contents of the card are being fetched | boolean | `false` |
|
||||
|
||||
### Card.Grid
|
||||
|
||||
Property | Description | Type | Default
|
||||
---------|-------------|------|---------
|
||||
className | className of container | string | -
|
||||
style | style object of container | object | -
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user