From 47d43e579f3a18145e14fa0c1efe47558e8f99b9 Mon Sep 17 00:00:00 2001 From: Benjamin Kniffler Date: Wed, 31 May 2017 14:56:56 +0200 Subject: [PATCH 01/34] Bump rc-util to 4.0.4 (#6311) --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 3b9c7abeb..395c80ede 100644 --- a/package.json +++ b/package.json @@ -72,7 +72,7 @@ "rc-tree": "~1.5.0", "rc-tree-select": "~1.9.0", "rc-upload": "~2.3.0", - "rc-util": "^4.0.1", + "rc-util": "^4.0.4", "react-lazy-load": "^3.0.10", "react-slick": "~0.14.2", "shallowequal": "^0.2.2", From 0080b6ddf5bae47531f3429d4680c37d45513d37 Mon Sep 17 00:00:00 2001 From: Wei Zhu Date: Wed, 31 May 2017 22:33:33 +0800 Subject: [PATCH 02/34] Bump version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 395c80ede..5587e022d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "antd", - "version": "2.10.3", + "version": "2.10.4", "title": "Ant Design", "description": "An enterprise-class UI design language and React-based implementation", "homepage": "http://ant.design/", From cf8aa16761f9edf824454d6ebfc569dd340df40b Mon Sep 17 00:00:00 2001 From: Leon Date: Thu, 1 Jun 2017 09:24:21 +0800 Subject: [PATCH 03/34] docs: change a reference link in docs (#6307) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 更改链接路径 原文路径不对,页面不存在,更改好可以~ * change reference link add 'docs/' to make reference link right --- docs/spec/direct.en-US.md | 2 +- docs/spec/direct.zh-CN.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/spec/direct.en-US.md b/docs/spec/direct.en-US.md index 79d614206..978088730 100644 --- a/docs/spec/direct.en-US.md +++ b/docs/spec/direct.en-US.md @@ -29,7 +29,7 @@ If the priority is given to 『readability』 and the 『editability』 of opera Multi-Field Inline Edit ->Note:In『Multi-Field Inline Edit』,there are huge different between the content and required field,So it is more needed to use the [『Explain What Just Happened』](../spec/transition#解释刚刚发生了什么) in 『Use Transition』to eliminate this visual effects. +>Note:In『Multi-Field Inline Edit』,there are huge different between the content and required field,So it is more needed to use the [『Explain What Just Happened』](../docs/spec/transition#解释刚刚发生了什么) in 『Use Transition』to eliminate this visual effects.
diff --git a/docs/spec/direct.zh-CN.md b/docs/spec/direct.zh-CN.md index 1a231caae..294d113b4 100644 --- a/docs/spec/direct.zh-CN.md +++ b/docs/spec/direct.zh-CN.md @@ -28,7 +28,7 @@ title: 直截了当 多字段行内编辑 ->注:在『多字段行内编辑』的情况下,显示的内容和编辑时所需的字段会存在比较大的差异,所以更需要『巧用过渡』原则中的[『解释刚刚发生了什么』](../spec/transition#解释刚刚发生了什么)来消除这种视觉影响。 +>注:在『多字段行内编辑』的情况下,显示的内容和编辑时所需的字段会存在比较大的差异,所以更需要『巧用过渡』原则中的[『解释刚刚发生了什么』](../docs/spec/transition#解释刚刚发生了什么)来消除这种视觉影响。
From f4312895d66c168407323824c5ee4566c70ec0b4 Mon Sep 17 00:00:00 2001 From: Leo Date: Thu, 1 Jun 2017 09:25:32 +0800 Subject: [PATCH 04/34] chore: componentDecorator return specific type instead of any (#6308) --- components/form/Form.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/form/Form.tsx b/components/form/Form.tsx index 1419a226b..d1f7c5186 100755 --- a/components/form/Form.tsx +++ b/components/form/Form.tsx @@ -111,7 +111,7 @@ export interface FormComponentProps { // https://github.com/DefinitelyTyped/DefinitelyTyped/issues/9951 export interface ComponentDecorator { - (component: React.ComponentClass): any; + (component: React.ComponentClass): React.ComponentClass; } export default class Form extends React.Component { From d629086c74d4e6750f58b2839876b28514852ae1 Mon Sep 17 00:00:00 2001 From: Adrian Dimitrov Date: Thu, 1 Jun 2017 05:32:10 +0300 Subject: [PATCH 05/34] feat: added Bulgarian translation (#6297) * Added Bulgarian translation * Update bg_BG.tsx --- components/calendar/locale/bg_BG.tsx | 2 ++ components/date-picker/locale/bg_BG.tsx | 17 +++++++++ components/locale-provider/bg_BG.tsx | 47 +++++++++++++++++++++++++ components/time-picker/locale/bg_BG.tsx | 5 +++ 4 files changed, 71 insertions(+) create mode 100644 components/calendar/locale/bg_BG.tsx create mode 100644 components/date-picker/locale/bg_BG.tsx create mode 100644 components/locale-provider/bg_BG.tsx create mode 100644 components/time-picker/locale/bg_BG.tsx diff --git a/components/calendar/locale/bg_BG.tsx b/components/calendar/locale/bg_BG.tsx new file mode 100644 index 000000000..c9dd46118 --- /dev/null +++ b/components/calendar/locale/bg_BG.tsx @@ -0,0 +1,2 @@ +import bg_BG from '../../date-picker/locale/bg_BG'; +export default bg_BG; diff --git a/components/date-picker/locale/bg_BG.tsx b/components/date-picker/locale/bg_BG.tsx new file mode 100644 index 000000000..4961f7866 --- /dev/null +++ b/components/date-picker/locale/bg_BG.tsx @@ -0,0 +1,17 @@ +import CalendarLocale from 'rc-calendar/lib/locale/bg_BG'; +import TimePickerLocale from '../../time-picker/locale/bg_BG'; +import assign from 'object-assign'; + +// Merge into a locale object +const locale = { + lang: assign({ + placeholder: 'Избор на дата', + rangePlaceholder: ['Начална', 'Крайна'], + }, CalendarLocale), + timePickerLocale: assign({}, TimePickerLocale), +}; + +// All settings at: +// https://github.com/ant-design/ant-design/blob/master/components/date-picker/locale/example.json + +export default locale; diff --git a/components/locale-provider/bg_BG.tsx b/components/locale-provider/bg_BG.tsx new file mode 100644 index 000000000..7ce6cf1f4 --- /dev/null +++ b/components/locale-provider/bg_BG.tsx @@ -0,0 +1,47 @@ +import moment from 'moment'; +moment.locale('bg'); + +import Pagination from 'rc-pagination/lib/locale/bg_BG'; +import DatePicker from '../date-picker/locale/bg_BG'; +import TimePicker from '../time-picker/locale/bg_BG'; +import Calendar from '../calendar/locale/bg_BG'; + +export default { + locale: 'bg', + Pagination, + DatePicker, + TimePicker, + Calendar, + Table: { + filterTitle: 'Филтриране', + filterConfirm: 'Добре', + filterReset: 'Нулриане', + emptyText: 'Няма данни', + selectAll: 'Избор на текуща страница', + selectInvert: 'Обръщане', + }, + Modal: { + okText: 'Дибре', + cancelText: 'Отказ', + justOkText: 'Дибре', + }, + Popconfirm: { + okText: 'Дибре', + cancelText: 'Отказ', + }, + Transfer: { + notFoundContent: 'Няма намерени', + searchPlaceholder: 'Търсене', + itemUnit: 'избор', + itemsUnit: 'избори', + }, + Select: { + notFoundContent: 'Няма намерени', + }, + Upload: { + uploading: 'Качване...', + removeFile: 'Премахване', + uploadError: 'Грешка при качването', + previewFile: 'Преглед', + }, +}; diff --git a/components/time-picker/locale/bg_BG.tsx b/components/time-picker/locale/bg_BG.tsx new file mode 100644 index 000000000..e6896fe4a --- /dev/null +++ b/components/time-picker/locale/bg_BG.tsx @@ -0,0 +1,5 @@ +const locale = { + placeholder: 'Избор на час', +}; + +export default locale; From 4e75347d353eeab9c2d05f4af18fa42bf2c5bed1 Mon Sep 17 00:00:00 2001 From: Benjy Cui Date: Thu, 1 Jun 2017 10:44:00 +0800 Subject: [PATCH 06/34] deps: upgrade rc-pagination --- .../__tests__/__snapshots__/demo.test.js.snap | 14 +++ .../locale-provider/__tests__/index.test.js | 3 +- .../__tests__/__snapshots__/demo.test.js.snap | 80 +++++++++++++++++ .../Table.pagination.test.js.snap | 4 + .../__tests__/__snapshots__/demo.test.js.snap | 87 +++++++++++++++++++ package.json | 2 +- 6 files changed, 188 insertions(+), 2 deletions(-) diff --git a/components/locale-provider/__tests__/__snapshots__/demo.test.js.snap b/components/locale-provider/__tests__/__snapshots__/demo.test.js.snap index 84f41cf63..90c2903d2 100644 --- a/components/locale-provider/__tests__/__snapshots__/demo.test.js.snap +++ b/components/locale-provider/__tests__/__snapshots__/demo.test.js.snap @@ -65,12 +65,14 @@ exports[`renders ./components/locale-provider/demo/all.md correctly 1`] = `
  • @@ -79,6 +81,7 @@ exports[`renders ./components/locale-provider/demo/all.md correctly 1`] = `
  • @@ -87,6 +90,7 @@ exports[`renders ./components/locale-provider/demo/all.md correctly 1`] = `
  • @@ -95,6 +99,7 @@ exports[`renders ./components/locale-provider/demo/all.md correctly 1`] = `
  • @@ -103,6 +108,7 @@ exports[`renders ./components/locale-provider/demo/all.md correctly 1`] = `
  • @@ -112,6 +118,7 @@ exports[`renders ./components/locale-provider/demo/all.md correctly 1`] = `
  • @@ -1541,12 +1548,14 @@ exports[`renders ./components/locale-provider/demo/basic.md correctly 1`] = `
  • @@ -1555,6 +1564,7 @@ exports[`renders ./components/locale-provider/demo/basic.md correctly 1`] = `
  • @@ -1563,6 +1573,7 @@ exports[`renders ./components/locale-provider/demo/basic.md correctly 1`] = `
  • @@ -1571,6 +1582,7 @@ exports[`renders ./components/locale-provider/demo/basic.md correctly 1`] = `
  • @@ -1579,6 +1591,7 @@ exports[`renders ./components/locale-provider/demo/basic.md correctly 1`] = `
  • @@ -1588,6 +1601,7 @@ exports[`renders ./components/locale-provider/demo/basic.md correctly 1`] = `
  • diff --git a/components/locale-provider/__tests__/index.test.js b/components/locale-provider/__tests__/index.test.js index 280eef88f..6b142fc65 100644 --- a/components/locale-provider/__tests__/index.test.js +++ b/components/locale-provider/__tests__/index.test.js @@ -20,8 +20,9 @@ import jaJP from '../ja_JP'; import trTR from '../tr_TR'; import zhTW from '../zh_TW'; import fiFI from '../fi_FI'; +import bgBG from '../bg_BG'; -const locales = [enUS, ptBR, ruRU, esES, svSE, frBE, deDE, nlNL, caES, csCZ, koKR, etEE, skSK, jaJP, trTR, zhTW, fiFI]; +const locales = [enUS, ptBR, ruRU, esES, svSE, frBE, deDE, nlNL, caES, csCZ, koKR, etEE, skSK, jaJP, trTR, zhTW, fiFI, bgBG]; const Option = Select.Option; const RangePicker = DatePicker.RangePicker; diff --git a/components/pagination/__tests__/__snapshots__/demo.test.js.snap b/components/pagination/__tests__/__snapshots__/demo.test.js.snap index 74882c235..19961552d 100644 --- a/components/pagination/__tests__/__snapshots__/demo.test.js.snap +++ b/components/pagination/__tests__/__snapshots__/demo.test.js.snap @@ -8,12 +8,14 @@ exports[`renders ./components/pagination/demo/basic.md correctly 1`] = `
  • @@ -22,6 +24,7 @@ exports[`renders ./components/pagination/demo/basic.md correctly 1`] = `
  • @@ -30,6 +33,7 @@ exports[`renders ./components/pagination/demo/basic.md correctly 1`] = `
  • @@ -38,6 +42,7 @@ exports[`renders ./components/pagination/demo/basic.md correctly 1`] = `
  • @@ -46,6 +51,7 @@ exports[`renders ./components/pagination/demo/basic.md correctly 1`] = `
  • @@ -55,6 +61,7 @@ exports[`renders ./components/pagination/demo/basic.md correctly 1`] = `
  • @@ -70,12 +77,14 @@ exports[`renders ./components/pagination/demo/changer.md correctly 1`] = `
  • @@ -84,6 +93,7 @@ exports[`renders ./components/pagination/demo/changer.md correctly 1`] = `
  • @@ -92,6 +102,7 @@ exports[`renders ./components/pagination/demo/changer.md correctly 1`] = `
  • @@ -100,6 +111,7 @@ exports[`renders ./components/pagination/demo/changer.md correctly 1`] = `
  • @@ -108,6 +120,7 @@ exports[`renders ./components/pagination/demo/changer.md correctly 1`] = `
  • @@ -116,12 +129,14 @@ exports[`renders ./components/pagination/demo/changer.md correctly 1`] = `
  • @@ -131,6 +146,7 @@ exports[`renders ./components/pagination/demo/changer.md correctly 1`] = `
  • @@ -182,12 +198,14 @@ exports[`renders ./components/pagination/demo/controlled.md correctly 1`] = `
  • @@ -196,6 +214,7 @@ exports[`renders ./components/pagination/demo/controlled.md correctly 1`] = `
  • @@ -204,6 +223,7 @@ exports[`renders ./components/pagination/demo/controlled.md correctly 1`] = `
  • @@ -212,6 +232,7 @@ exports[`renders ./components/pagination/demo/controlled.md correctly 1`] = `
  • @@ -220,6 +241,7 @@ exports[`renders ./components/pagination/demo/controlled.md correctly 1`] = `
  • @@ -229,6 +251,7 @@ exports[`renders ./components/pagination/demo/controlled.md correctly 1`] = `
  • @@ -244,12 +267,14 @@ exports[`renders ./components/pagination/demo/jump.md correctly 1`] = `
  • @@ -258,6 +283,7 @@ exports[`renders ./components/pagination/demo/jump.md correctly 1`] = `
  • @@ -266,6 +292,7 @@ exports[`renders ./components/pagination/demo/jump.md correctly 1`] = `
  • @@ -274,6 +301,7 @@ exports[`renders ./components/pagination/demo/jump.md correctly 1`] = `
  • @@ -282,6 +310,7 @@ exports[`renders ./components/pagination/demo/jump.md correctly 1`] = `
  • @@ -290,12 +319,14 @@ exports[`renders ./components/pagination/demo/jump.md correctly 1`] = `
  • @@ -305,6 +336,7 @@ exports[`renders ./components/pagination/demo/jump.md correctly 1`] = `
  • @@ -335,12 +367,14 @@ exports[`renders ./components/pagination/demo/mini.md correctly 1`] = `
  • @@ -349,6 +383,7 @@ exports[`renders ./components/pagination/demo/mini.md correctly 1`] = `
  • @@ -357,6 +392,7 @@ exports[`renders ./components/pagination/demo/mini.md correctly 1`] = `
  • @@ -365,6 +401,7 @@ exports[`renders ./components/pagination/demo/mini.md correctly 1`] = `
  • @@ -373,6 +410,7 @@ exports[`renders ./components/pagination/demo/mini.md correctly 1`] = `
  • @@ -382,6 +420,7 @@ exports[`renders ./components/pagination/demo/mini.md correctly 1`] = `
  • @@ -394,12 +433,14 @@ exports[`renders ./components/pagination/demo/mini.md correctly 1`] = `
  • @@ -408,6 +449,7 @@ exports[`renders ./components/pagination/demo/mini.md correctly 1`] = `
  • @@ -416,6 +458,7 @@ exports[`renders ./components/pagination/demo/mini.md correctly 1`] = `
  • @@ -424,6 +467,7 @@ exports[`renders ./components/pagination/demo/mini.md correctly 1`] = `
  • @@ -432,6 +476,7 @@ exports[`renders ./components/pagination/demo/mini.md correctly 1`] = `
  • @@ -441,6 +486,7 @@ exports[`renders ./components/pagination/demo/mini.md correctly 1`] = `
  • @@ -504,12 +550,14 @@ exports[`renders ./components/pagination/demo/mini.md correctly 1`] = `
  • @@ -518,6 +566,7 @@ exports[`renders ./components/pagination/demo/mini.md correctly 1`] = `
  • @@ -526,6 +575,7 @@ exports[`renders ./components/pagination/demo/mini.md correctly 1`] = `
  • @@ -534,6 +584,7 @@ exports[`renders ./components/pagination/demo/mini.md correctly 1`] = `
  • @@ -542,6 +593,7 @@ exports[`renders ./components/pagination/demo/mini.md correctly 1`] = `
  • @@ -551,6 +603,7 @@ exports[`renders ./components/pagination/demo/mini.md correctly 1`] = `
  • @@ -567,12 +620,14 @@ exports[`renders ./components/pagination/demo/more.md correctly 1`] = `
  • @@ -581,12 +636,14 @@ exports[`renders ./components/pagination/demo/more.md correctly 1`] = `
  • @@ -595,6 +652,7 @@ exports[`renders ./components/pagination/demo/more.md correctly 1`] = `
  • @@ -603,6 +661,7 @@ exports[`renders ./components/pagination/demo/more.md correctly 1`] = `
  • @@ -611,6 +670,7 @@ exports[`renders ./components/pagination/demo/more.md correctly 1`] = `
  • @@ -619,6 +679,7 @@ exports[`renders ./components/pagination/demo/more.md correctly 1`] = `
  • @@ -627,12 +688,14 @@ exports[`renders ./components/pagination/demo/more.md correctly 1`] = `
  • @@ -642,6 +705,7 @@ exports[`renders ./components/pagination/demo/more.md correctly 1`] = `
  • @@ -656,6 +720,7 @@ exports[`renders ./components/pagination/demo/simple.md correctly 1`] = `
  • @@ -678,6 +743,7 @@ exports[`renders ./components/pagination/demo/simple.md correctly 1`] = `
  • @@ -699,12 +765,14 @@ exports[`renders ./components/pagination/demo/total.md correctly 1`] = `
  • @@ -713,6 +781,7 @@ exports[`renders ./components/pagination/demo/total.md correctly 1`] = `
  • @@ -721,6 +790,7 @@ exports[`renders ./components/pagination/demo/total.md correctly 1`] = `
  • @@ -729,6 +799,7 @@ exports[`renders ./components/pagination/demo/total.md correctly 1`] = `
  • @@ -737,6 +808,7 @@ exports[`renders ./components/pagination/demo/total.md correctly 1`] = `
  • @@ -746,6 +818,7 @@ exports[`renders ./components/pagination/demo/total.md correctly 1`] = `
  • @@ -764,12 +837,14 @@ exports[`renders ./components/pagination/demo/total.md correctly 1`] = `
  • @@ -778,6 +853,7 @@ exports[`renders ./components/pagination/demo/total.md correctly 1`] = `
  • @@ -786,6 +862,7 @@ exports[`renders ./components/pagination/demo/total.md correctly 1`] = `
  • @@ -794,6 +871,7 @@ exports[`renders ./components/pagination/demo/total.md correctly 1`] = `
  • @@ -802,6 +880,7 @@ exports[`renders ./components/pagination/demo/total.md correctly 1`] = `
  • @@ -811,6 +890,7 @@ exports[`renders ./components/pagination/demo/total.md correctly 1`] = `
  • diff --git a/components/table/__tests__/__snapshots__/Table.pagination.test.js.snap b/components/table/__tests__/__snapshots__/Table.pagination.test.js.snap index c2c3e6bc8..56805d7a7 100644 --- a/components/table/__tests__/__snapshots__/Table.pagination.test.js.snap +++ b/components/table/__tests__/__snapshots__/Table.pagination.test.js.snap @@ -79,12 +79,14 @@ exports[`Table.pagination renders pagination correctly 1`] = `
  • @@ -93,6 +95,7 @@ exports[`Table.pagination renders pagination correctly 1`] = `
  • @@ -102,6 +105,7 @@ exports[`Table.pagination renders pagination correctly 1`] = `
  • diff --git a/components/table/__tests__/__snapshots__/demo.test.js.snap b/components/table/__tests__/__snapshots__/demo.test.js.snap index 3cbaa7766..ff959eec3 100644 --- a/components/table/__tests__/__snapshots__/demo.test.js.snap +++ b/components/table/__tests__/__snapshots__/demo.test.js.snap @@ -355,12 +355,14 @@ exports[`renders ./components/table/demo/basic.md correctly 1`] = `
  • @@ -370,6 +372,7 @@ exports[`renders ./components/table/demo/basic.md correctly 1`] = `
  • @@ -540,12 +543,14 @@ exports[`renders ./components/table/demo/bordered.md correctly 1`] = `
  • @@ -555,6 +560,7 @@ exports[`renders ./components/table/demo/bordered.md correctly 1`] = `
  • @@ -806,12 +812,14 @@ exports[`renders ./components/table/demo/colspan-rowspan.md correctly 1`] = `
  • @@ -821,6 +829,7 @@ exports[`renders ./components/table/demo/colspan-rowspan.md correctly 1`] = `
  • @@ -1001,12 +1010,14 @@ exports[`renders ./components/table/demo/custom-filter-panel.md correctly 1`] =
  • @@ -1016,6 +1027,7 @@ exports[`renders ./components/table/demo/custom-filter-panel.md correctly 1`] =
  • @@ -2339,12 +2351,14 @@ exports[`renders ./components/table/demo/dynamic-settings.md correctly 1`] = `
  • @@ -2354,6 +2368,7 @@ exports[`renders ./components/table/demo/dynamic-settings.md correctly 1`] = `
  • @@ -2539,12 +2554,14 @@ exports[`renders ./components/table/demo/edit-cell.md correctly 1`] = `
  • @@ -2554,6 +2571,7 @@ exports[`renders ./components/table/demo/edit-cell.md correctly 1`] = `
  • @@ -2696,12 +2714,14 @@ exports[`renders ./components/table/demo/edit-row.md correctly 1`] = `
  • @@ -2711,6 +2731,7 @@ exports[`renders ./components/table/demo/edit-row.md correctly 1`] = `
  • @@ -2911,12 +2932,14 @@ exports[`renders ./components/table/demo/expand.md correctly 1`] = `
  • @@ -2926,6 +2949,7 @@ exports[`renders ./components/table/demo/expand.md correctly 1`] = `
  • @@ -3465,12 +3489,14 @@ exports[`renders ./components/table/demo/expand-children.md correctly 1`] = `
  • @@ -3480,6 +3506,7 @@ exports[`renders ./components/table/demo/expand-children.md correctly 1`] = `
  • @@ -3917,12 +3944,14 @@ exports[`renders ./components/table/demo/fixed-columns.md correctly 1`] = `
  • @@ -3932,6 +3961,7 @@ exports[`renders ./components/table/demo/fixed-columns.md correctly 1`] = `
  • @@ -5240,12 +5270,14 @@ exports[`renders ./components/table/demo/fixed-columns-header.md correctly 1`] =
  • @@ -5254,6 +5286,7 @@ exports[`renders ./components/table/demo/fixed-columns-header.md correctly 1`] =
  • @@ -5262,6 +5295,7 @@ exports[`renders ./components/table/demo/fixed-columns-header.md correctly 1`] =
  • @@ -5270,6 +5304,7 @@ exports[`renders ./components/table/demo/fixed-columns-header.md correctly 1`] =
  • @@ -5278,6 +5313,7 @@ exports[`renders ./components/table/demo/fixed-columns-header.md correctly 1`] =
  • @@ -5286,12 +5322,14 @@ exports[`renders ./components/table/demo/fixed-columns-header.md correctly 1`] =
  • @@ -5301,6 +5339,7 @@ exports[`renders ./components/table/demo/fixed-columns-header.md correctly 1`] =
  • @@ -6556,12 +6595,14 @@ exports[`renders ./components/table/demo/fixed-header.md correctly 1`] = `
  • @@ -6570,6 +6611,7 @@ exports[`renders ./components/table/demo/fixed-header.md correctly 1`] = `
  • @@ -6579,6 +6621,7 @@ exports[`renders ./components/table/demo/fixed-header.md correctly 1`] = `
  • @@ -7625,12 +7668,14 @@ exports[`renders ./components/table/demo/grouping-columns.md correctly 1`] = `
  • @@ -7639,6 +7684,7 @@ exports[`renders ./components/table/demo/grouping-columns.md correctly 1`] = `
  • @@ -7647,6 +7693,7 @@ exports[`renders ./components/table/demo/grouping-columns.md correctly 1`] = `
  • @@ -7655,6 +7702,7 @@ exports[`renders ./components/table/demo/grouping-columns.md correctly 1`] = `
  • @@ -7663,6 +7711,7 @@ exports[`renders ./components/table/demo/grouping-columns.md correctly 1`] = `
  • @@ -7671,12 +7720,14 @@ exports[`renders ./components/table/demo/grouping-columns.md correctly 1`] = `
  • @@ -7686,6 +7737,7 @@ exports[`renders ./components/table/demo/grouping-columns.md correctly 1`] = `
  • @@ -7925,12 +7977,14 @@ exports[`renders ./components/table/demo/head.md correctly 1`] = `
  • @@ -7940,6 +7994,7 @@ exports[`renders ./components/table/demo/head.md correctly 1`] = `
  • @@ -8225,12 +8280,14 @@ exports[`renders ./components/table/demo/jsx.md correctly 1`] = `
  • @@ -8240,6 +8297,7 @@ exports[`renders ./components/table/demo/jsx.md correctly 1`] = `
  • @@ -8509,12 +8567,14 @@ exports[`renders ./components/table/demo/nested-table.md correctly 1`] = `
  • @@ -8524,6 +8584,7 @@ exports[`renders ./components/table/demo/nested-table.md correctly 1`] = `
  • @@ -8792,12 +8853,14 @@ exports[`renders ./components/table/demo/reset-filter.md correctly 1`] = `
  • @@ -8807,6 +8870,7 @@ exports[`renders ./components/table/demo/reset-filter.md correctly 1`] = `
  • @@ -9106,12 +9170,14 @@ exports[`renders ./components/table/demo/row-selection.md correctly 1`] = `
  • @@ -9121,6 +9187,7 @@ exports[`renders ./components/table/demo/row-selection.md correctly 1`] = `
  • @@ -9683,12 +9750,14 @@ exports[`renders ./components/table/demo/row-selection-and-operation.md correctl
  • @@ -9697,6 +9766,7 @@ exports[`renders ./components/table/demo/row-selection-and-operation.md correctl
  • @@ -9705,6 +9775,7 @@ exports[`renders ./components/table/demo/row-selection-and-operation.md correctl
  • @@ -9713,6 +9784,7 @@ exports[`renders ./components/table/demo/row-selection-and-operation.md correctl
  • @@ -9721,6 +9793,7 @@ exports[`renders ./components/table/demo/row-selection-and-operation.md correctl
  • @@ -9730,6 +9803,7 @@ exports[`renders ./components/table/demo/row-selection-and-operation.md correctl
  • @@ -10283,12 +10357,14 @@ exports[`renders ./components/table/demo/row-selection-custom.md correctly 1`] =
  • @@ -10297,6 +10373,7 @@ exports[`renders ./components/table/demo/row-selection-custom.md correctly 1`] =
  • @@ -10305,6 +10382,7 @@ exports[`renders ./components/table/demo/row-selection-custom.md correctly 1`] =
  • @@ -10313,6 +10391,7 @@ exports[`renders ./components/table/demo/row-selection-custom.md correctly 1`] =
  • @@ -10321,6 +10400,7 @@ exports[`renders ./components/table/demo/row-selection-custom.md correctly 1`] =
  • @@ -10330,6 +10410,7 @@ exports[`renders ./components/table/demo/row-selection-custom.md correctly 1`] =
  • @@ -10482,12 +10563,14 @@ exports[`renders ./components/table/demo/size.md correctly 1`] = `
  • @@ -10497,6 +10580,7 @@ exports[`renders ./components/table/demo/size.md correctly 1`] = `
  • @@ -10645,12 +10729,14 @@ exports[`renders ./components/table/demo/size.md correctly 1`] = `
  • @@ -10660,6 +10746,7 @@ exports[`renders ./components/table/demo/size.md correctly 1`] = `
  • diff --git a/package.json b/package.json index 5587e022d..2b9bb02a1 100644 --- a/package.json +++ b/package.json @@ -58,7 +58,7 @@ "rc-input-number": "~3.4.4", "rc-menu": "~5.0.9", "rc-notification": "~1.4.0", - "rc-pagination": "~1.8.7", + "rc-pagination": "~1.9.2", "rc-progress": "~2.1.0", "rc-rate": "~2.1.0", "rc-select": "~6.8.0", From e43c8012ade3ad089015ba6bf7f4b9d0936a57eb Mon Sep 17 00:00:00 2001 From: slientcloud Date: Thu, 1 Jun 2017 12:08:39 +0800 Subject: [PATCH 07/34] chore: support slider aira (#6301) --- .../__tests__/__snapshots__/demo.test.js.snap | 5 + .../__tests__/__snapshots__/demo.test.js.snap | 10 ++ .../__tests__/__snapshots__/demo.test.js.snap | 110 ++++++++++++++++++ components/slider/index.tsx | 1 + package.json | 2 +- 5 files changed, 127 insertions(+), 1 deletion(-) diff --git a/components/form/__tests__/__snapshots__/demo.test.js.snap b/components/form/__tests__/__snapshots__/demo.test.js.snap index a7c1b06a1..5a91b0b3f 100644 --- a/components/form/__tests__/__snapshots__/demo.test.js.snap +++ b/components/form/__tests__/__snapshots__/demo.test.js.snap @@ -2123,7 +2123,12 @@ exports[`renders ./components/form/demo/validate-other.md correctly 1`] = ` />
    { > this.toggleTooltipVisible(index, true)} onMouseLeave={() => this.toggleTooltipVisible(index, false)} /> diff --git a/package.json b/package.json index 2b9bb02a1..cfb61395e 100644 --- a/package.json +++ b/package.json @@ -62,7 +62,7 @@ "rc-progress": "~2.1.0", "rc-rate": "~2.1.0", "rc-select": "~6.8.0", - "rc-slider": "~7.0.0", + "rc-slider": "~8.0.0", "rc-steps": "~2.5.0", "rc-switch": "~1.4.2", "rc-table": "~5.3.3", From 45dee9e5042e74a30c882a3dfc886b6df2504bdd Mon Sep 17 00:00:00 2001 From: afc163 Date: Thu, 1 Jun 2017 12:03:36 +0800 Subject: [PATCH 08/34] animating node should not be accessible, close #6314 --- components/style/mixins/motion.less | 2 ++ 1 file changed, 2 insertions(+) diff --git a/components/style/mixins/motion.less b/components/style/mixins/motion.less index 2c49007d3..6cd15567d 100644 --- a/components/style/mixins/motion.less +++ b/components/style/mixins/motion.less @@ -24,9 +24,11 @@ .@{className}-appear.@{className}-appear-active { animation-name: ~"@{keyframeName}In"; animation-play-state: running; + pointer-events: none; } .@{className}-leave.@{className}-leave-active { animation-name: ~"@{keyframeName}Out"; animation-play-state: running; + pointer-events: none; } } From dd60cf8ca2e420c06ef5f51f2f4ec8f19202373d Mon Sep 17 00:00:00 2001 From: afc163 Date: Thu, 1 Jun 2017 14:12:26 +0800 Subject: [PATCH 09/34] Add link --- README-zh_CN.md | 2 +- docs/react/introduce.zh-CN.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README-zh_CN.md b/README-zh_CN.md index b92d55631..453cc10bc 100644 --- a/README-zh_CN.md +++ b/README-zh_CN.md @@ -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),更好的问题更容易获得帮助。 ## 社区互助 diff --git a/docs/react/introduce.zh-CN.md b/docs/react/introduce.zh-CN.md index 040b00127..456558fe5 100644 --- a/docs/react/introduce.zh-CN.md +++ b/docs/react/introduce.zh-CN.md @@ -163,7 +163,7 @@ import 'antd/dist/antd.css'; // or 'antd/dist/antd.less' 在任何形式的参与前,请先阅读 [贡献者文档](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),更好的问题更容易获得帮助。 ## 社区互助 From fd7ef2407c1b4eb15a23d359377ad405e3eced95 Mon Sep 17 00:00:00 2001 From: Wei Zhu Date: Thu, 1 Jun 2017 14:47:49 +0800 Subject: [PATCH 10/34] Don't need extends from rc-table Fix #6313 --- components/table/Column.tsx | 3 +-- components/table/ColumnGroup.tsx | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/components/table/Column.tsx b/components/table/Column.tsx index 177a1d364..ac86c747e 100644 --- a/components/table/Column.tsx +++ b/components/table/Column.tsx @@ -1,5 +1,4 @@ import React from 'react'; -import RcTable from 'rc-table'; export interface ColumnProps { title?: React.ReactNode; @@ -24,4 +23,4 @@ export interface ColumnProps { onCellClick?: (record: T, event: any) => void; } -export default class Column extends (RcTable.Column as React.ComponentClass>) {} +export default class Column extends React.Component, React.ComponentState> {} diff --git a/components/table/ColumnGroup.tsx b/components/table/ColumnGroup.tsx index 2128d0869..1d0d06948 100644 --- a/components/table/ColumnGroup.tsx +++ b/components/table/ColumnGroup.tsx @@ -1,8 +1,7 @@ import React from 'react'; -import RcTable from 'rc-table'; export interface ColumnGroupProps { title?: React.ReactNode; } -export default class ColumnGroup extends (RcTable.ColumnGroup as React.ComponentClass) {} +export default class ColumnGroup extends React.Component {} From e6ef5b570791516b63d66f76f0e5dcf245b9ad86 Mon Sep 17 00:00:00 2001 From: Wei Zhu Date: Thu, 1 Jun 2017 15:07:37 +0800 Subject: [PATCH 11/34] User static variable for element type detection --- components/table/ColumnGroup.tsx | 4 +++- components/table/util.tsx | 5 ++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/components/table/ColumnGroup.tsx b/components/table/ColumnGroup.tsx index 1d0d06948..873f0ace5 100644 --- a/components/table/ColumnGroup.tsx +++ b/components/table/ColumnGroup.tsx @@ -4,4 +4,6 @@ export interface ColumnGroupProps { title?: React.ReactNode; } -export default class ColumnGroup extends React.Component {} +export default class ColumnGroup extends React.Component { + static __ANT_TABLE_COLUMN_GROUP = true; +} diff --git a/components/table/util.tsx b/components/table/util.tsx index 92f5e2227..d83cb01f2 100644 --- a/components/table/util.tsx +++ b/components/table/util.tsx @@ -1,6 +1,5 @@ import React from 'react'; import assign from 'object-assign'; -import ColumnGroup from './ColumnGroup'; export function flatArray(data: Object[] = [], childrenName = 'children') { const result: Object[] = []; @@ -43,7 +42,7 @@ export function flatFilter(tree: any[], callback: Function) { export function normalizeColumns(elements) { const columns: any[] = []; - React.Children.forEach(elements, (element: React.ReactElement) => { + React.Children.forEach(elements, (element) => { if (!React.isValidElement(element)) { return; } @@ -51,7 +50,7 @@ export function normalizeColumns(elements) { if (element.key) { column.key = element.key; } - if (element.type as any === ColumnGroup) { + if (element.type && (element.type as any).__ANT_TABLE_COLUMN_GROUP) { column.children = normalizeColumns(column.children); } columns.push(column); From b0aef6cad5c98e6ebf28a1a770ec2e2a56070826 Mon Sep 17 00:00:00 2001 From: afc163 Date: Thu, 1 Jun 2017 16:54:47 +0800 Subject: [PATCH 12/34] Fix Tree and TreeSelect disabled style, close #6320 --- components/checkbox/style/mixin.less | 2 ++ components/tree-select/style/index.less | 10 +++++++--- components/tree/style/index.less | 13 +++++++++++-- components/tree/style/mixin.less | 7 ++----- 4 files changed, 22 insertions(+), 10 deletions(-) diff --git a/components/checkbox/style/mixin.less b/components/checkbox/style/mixin.less index 1b1c9e18a..4c644a73e 100644 --- a/components/checkbox/style/mixin.less +++ b/components/checkbox/style/mixin.less @@ -96,6 +96,8 @@ } .@{checkbox-prefix-cls}-disabled { + cursor: not-allowed; + &.@{checkbox-prefix-cls}-checked { .@{checkbox-inner-prefix-cls}:after { animation-name: none; diff --git a/components/tree-select/style/index.less b/components/tree-select/style/index.less index 7f54d381f..a86118729 100644 --- a/components/tree-select/style/index.less +++ b/components/tree-select/style/index.less @@ -99,13 +99,17 @@ display: block; } } - &-treenode-disabled { + li&-treenode-disabled { > span, - > a, - > a span { + > .@{select-tree-prefix-cls}-node-content-wrapper, + > .@{select-tree-prefix-cls}-node-content-wrapper span, + > span.@{select-tree-prefix-cls}-switcher { color: @disabled-color; cursor: not-allowed; } + > .@{select-tree-prefix-cls}-node-content-wrapper:hover { + background: transparent; + } } &-icon__open { margin-right: 2px; diff --git a/components/tree/style/index.less b/components/tree/style/index.less index d11ccd9dc..9aecf7bdc 100644 --- a/components/tree/style/index.less +++ b/components/tree/style/index.less @@ -4,6 +4,8 @@ @import "./mixin"; @tree-prefix-cls: ~"@{ant-prefix}-tree"; +@tree-showline-icon-color: @text-color-secondary; + .antCheckboxFn(@checkbox-prefix-cls: ~"@{ant-prefix}-tree-checkbox"); .@{tree-prefix-cls} { @@ -141,13 +143,17 @@ display: block; } } - &-treenode-disabled { + li&-treenode-disabled { > span, > .@{tree-prefix-cls}-node-content-wrapper, - > .@{tree-prefix-cls}-node-content-wrapper span { + > .@{tree-prefix-cls}-node-content-wrapper span, + > span.@{tree-prefix-cls}-switcher { color: @disabled-color; cursor: not-allowed; } + > .@{tree-prefix-cls}-node-content-wrapper:hover { + background: transparent; + } } &-icon__open { margin-right: 2px; @@ -164,6 +170,7 @@ span { &.@{tree-prefix-cls}-switcher { background: @component-background; + color: @text-color; &.@{tree-prefix-cls}-switcher-noop { .antTreeShowLineIcon("tree-doc-icon"); } @@ -171,12 +178,14 @@ &.@{tree-prefix-cls}-center_open, &.@{tree-prefix-cls}-bottom_open, &.@{tree-prefix-cls}-noline_open { + color: @tree-showline-icon-color; .antTreeShowLineIcon("tree-showline-open-icon"); } &.@{tree-prefix-cls}-roots_close, &.@{tree-prefix-cls}-center_close, &.@{tree-prefix-cls}-bottom_close, &.@{tree-prefix-cls}-noline_close { + color: @tree-showline-icon-color; .antTreeShowLineIcon("tree-showline-close-icon"); } } diff --git a/components/tree/style/mixin.less b/components/tree/style/mixin.less index 5f2d1c13d..1a4a4cb87 100644 --- a/components/tree/style/mixin.less +++ b/components/tree/style/mixin.less @@ -4,7 +4,6 @@ @tree-showline-open-icon: "\e621"; @tree-showline-close-icon: "\e645"; @tree-doc-icon: "\e664"; -@tree-showline-icon-color: @text-color-secondary; .antTreeSwitcherIcon(@type: "tree-default-open-icon") { &:after { @@ -12,8 +11,7 @@ display: inline-block; .iconfont-font(@@type); font-weight: bold; - color: @text-color; - transition: transform .3s ease; + transition: transform .3s; } } @@ -24,7 +22,6 @@ .iconfont-font(@@type); vertical-align: baseline; font-weight: normal; - color: @tree-showline-icon-color; - transition: transform .3s ease; + transition: transform .3s; } } From becb888f6e5af6a84a67074973f3fe488f769a26 Mon Sep 17 00:00:00 2001 From: afc163 Date: Thu, 1 Jun 2017 17:56:05 +0800 Subject: [PATCH 13/34] Fix form demo, close #6323 --- components/form/demo/advanced-search.md | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/components/form/demo/advanced-search.md b/components/form/demo/advanced-search.md index ff1250021..4af19ba4b 100644 --- a/components/form/demo/advanced-search.md +++ b/components/form/demo/advanced-search.md @@ -43,18 +43,18 @@ class AdvancedSearchForm extends React.Component { this.setState({ expand: !expand }); } - render() { + // To generate mock Form.Item + getFields() { + const count = this.state.expand ? 10 : 6; const { getFieldDecorator } = this.props.form; const formItemLayout = { labelCol: { span: 5 }, wrapperCol: { span: 19 }, }; - - // To generate mock Form.Item const children = []; for (let i = 0; i < 10; i++) { children.push( - + {getFieldDecorator(`field-${i}`)( @@ -63,17 +63,16 @@ class AdvancedSearchForm extends React.Component { ); } + return children; + } - const expand = this.state.expand; - const shownCount = expand ? children.length : 6; + render() { return (
    - - {children.slice(0, shownCount)} - + {this.getFields()} @@ -81,7 +80,7 @@ class AdvancedSearchForm extends React.Component { Clear - Collapse + Collapse From 9bb7ec0b87d0af8ac67de7e5f7cdfa494e7b8182 Mon Sep 17 00:00:00 2001 From: afc163 Date: Thu, 1 Jun 2017 17:58:06 +0800 Subject: [PATCH 14/34] update form demo snapshot --- .../__tests__/__snapshots__/demo.test.js.snap | 156 +++++++++++++++++- 1 file changed, 150 insertions(+), 6 deletions(-) diff --git a/components/form/__tests__/__snapshots__/demo.test.js.snap b/components/form/__tests__/__snapshots__/demo.test.js.snap index 5a91b0b3f..440c59579 100644 --- a/components/form/__tests__/__snapshots__/demo.test.js.snap +++ b/components/form/__tests__/__snapshots__/demo.test.js.snap @@ -11,7 +11,7 @@ exports[`renders ./components/form/demo/advanced-search.md correctly 1`] = ` >
    + + + +
    Date: Fri, 2 Jun 2017 14:28:56 +0800 Subject: [PATCH 15/34] docs: add docs for TimePicker[defaultOpenValue], close: #6336 --- components/time-picker/demo/basic.md | 6 +++++- components/time-picker/index.en-US.md | 1 + components/time-picker/index.zh-CN.md | 1 + 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/components/time-picker/demo/basic.md b/components/time-picker/demo/basic.md index 118df8f67..bb63f8e92 100644 --- a/components/time-picker/demo/basic.md +++ b/components/time-picker/demo/basic.md @@ -15,10 +15,14 @@ Click `TimePicker`, and then we could select or input a time in panel. ````jsx import { TimePicker } from 'antd'; +import moment from 'moment'; function onChange(time, timeString) { console.log(time, timeString); } -ReactDOM.render(, mountNode); +ReactDOM.render( + , + mountNode +); ```` diff --git a/components/time-picker/index.en-US.md b/components/time-picker/index.en-US.md index b221ae8e9..d7775121c 100644 --- a/components/time-picker/index.en-US.md +++ b/components/time-picker/index.en-US.md @@ -23,6 +23,7 @@ import moment from 'moment'; |---------------------|-----|-----|-------| | defaultValue | to set default time | [moment](http://momentjs.com/) | - | | value | to set time | [moment](http://momentjs.com/) | - | +| defaultOpenValue | to highlight values in panel when there is no selected value | [moment](http://momentjs.com/) | moment() | | open | whether to popup panel | boolean | false | | onOpenChange | a callback function which will be called while panel opening/closing | (open: boolean): void | - | | placeholder | display when there's no value | string | "Select a time" | diff --git a/components/time-picker/index.zh-CN.md b/components/time-picker/index.zh-CN.md index b029d537c..3abde1db7 100644 --- a/components/time-picker/index.zh-CN.md +++ b/components/time-picker/index.zh-CN.md @@ -24,6 +24,7 @@ import moment from 'moment'; |---------------------|-----|-----|-------| | defaultValue | 默认时间 | [moment](http://momentjs.com/) | 无 | | value | 当前时间 | [moment](http://momentjs.com/) | 无 | +| defaultOpenValue | 无选中值时,面板打开时高亮的值 | [moment](http://momentjs.com/) | moment() | | open | 面板是否打开 | boolean | false | | onOpenChange | 面板打开/关闭时的回调 | (open: boolean): void | 无 | | placeholder | 没有值的时候显示的内容 | string | "请选择时间" | From e01c8c8ff68bae2a66887fdfead219b853168d2a Mon Sep 17 00:00:00 2001 From: Benjy Cui Date: Fri, 2 Jun 2017 16:11:30 +0800 Subject: [PATCH 16/34] fix: should work with ES2015 module, close: #6334 --- components/_util/getLocale.tsx | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/components/_util/getLocale.tsx b/components/_util/getLocale.tsx index 57adba7b5..f0bb73750 100644 --- a/components/_util/getLocale.tsx +++ b/components/_util/getLocale.tsx @@ -1,8 +1,15 @@ 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); From f40be3d7ac281b47606acd0cf9e9a974687b22ca Mon Sep 17 00:00:00 2001 From: afc163 Date: Fri, 2 Jun 2017 16:25:05 +0800 Subject: [PATCH 17/34] Tweak pagination style for vertical align and focused state --- components/pagination/style/index.less | 42 ++++++++++++++++++++------ 1 file changed, 32 insertions(+), 10 deletions(-) diff --git a/components/pagination/style/index.less b/components/pagination/style/index.less index a2f0da767..9b8fab47b 100644 --- a/components/pagination/style/index.less +++ b/components/pagination/style/index.less @@ -18,9 +18,10 @@ &-total-text { display: inline-block; - height: 30px; - line-height: 30px; - margin-right: 10px; + vertical-align: middle; + height: 28px; + line-height: 28px; + margin-right: 8px; } &-item { @@ -33,10 +34,12 @@ text-align: center; list-style: none; display: inline-block; + vertical-align: middle; border: @border-width-base @border-style-base @border-color-base; background-color: @component-background; margin-right: 8px; font-family: Arial; + outline: 0; a { text-decoration: none; @@ -45,8 +48,9 @@ margin: 0 6px; } + &:focus, &:hover { - transition: all 0.3s ease; + transition: all .3s; border-color: @primary-color; a { color: @primary-color; @@ -57,7 +61,14 @@ background-color: @primary-color; border-color: @primary-color; + &:focus, + &:hover { + background-color: @primary-5; + border-color: @primary-5; + } + a, + &:focus a, &:hover a { color: #fff; } @@ -66,6 +77,8 @@ &-jump-prev, &-jump-next { + outline: 0; + &:after { content: "•••"; display: block; @@ -74,6 +87,7 @@ text-align: center; } + &:focus, &:hover { &:after { color: @primary-color; @@ -85,6 +99,7 @@ } &-jump-prev { + &:focus, &:hover { &:after { content: "\e620\e620"; @@ -93,6 +108,7 @@ } &-jump-next { + &:focus, &:hover { &:after { content: "\e61f\e61f"; @@ -118,31 +134,34 @@ height: 28px; line-height: 28px; text-align: center; - transition: all 0.3s ease; + transition: all .3s; display: inline-block; + vertical-align: middle; } &-prev, &-next { border: @border-width-base @border-style-base @border-color-base; background-color: @component-background; + outline: 0; a { color: @text-color; + outline: none; &:after { .iconfont-size-under-12px(8px); display: block; height: 26px; - line-height: 27px; + line-height: 26px; font-family: "anticon"; text-align: center; } } + &:focus, &:hover { border-color: @primary-color; - a { color: @primary-color; } @@ -187,10 +206,12 @@ &-options { display: inline-block; - margin-left: 15px; + vertical-align: middle; + margin-left: 16px; + &-size-changer { display: inline-block; - margin-right: 10px; + margin-right: 8px; } &-quick-jumper { @@ -217,6 +238,7 @@ &-simple &-simple-pager { display: inline-block; + vertical-align: middle; margin-right: 8px; input { @@ -230,7 +252,7 @@ width: 30px; height: 24px; text-align: center; - transition: border-color 0.3s ease; + transition: border-color .3s; &:hover { border-color: @primary-color; From c209c45660e87739e2d206a72846307067a12757 Mon Sep 17 00:00:00 2001 From: afc163 Date: Fri, 2 Jun 2017 16:33:11 +0800 Subject: [PATCH 18/34] fix #6339 --- components/pagination/style/index.less | 1 - 1 file changed, 1 deletion(-) diff --git a/components/pagination/style/index.less b/components/pagination/style/index.less index 9b8fab47b..f8b912ee0 100644 --- a/components/pagination/style/index.less +++ b/components/pagination/style/index.less @@ -249,7 +249,6 @@ border: @border-width-base @border-style-base @border-color-base; outline: none; padding: 5px 8px; - width: 30px; height: 24px; text-align: center; transition: border-color .3s; From 6d74ea346f7314985299d9349661ca01c6411955 Mon Sep 17 00:00:00 2001 From: Damian Green Date: Fri, 2 Jun 2017 13:43:32 +0100 Subject: [PATCH 19/34] Add en-GB, it-IT, fr-FR + nl_BE locales --- components/calendar/locale/en_GB.tsx | 2 ++ components/calendar/locale/fr_FR.tsx | 2 ++ components/calendar/locale/it_IT.tsx | 2 ++ components/calendar/locale/nl_BE.tsx | 2 ++ components/date-picker/locale/en_GB.tsx | 17 +++++++++ components/date-picker/locale/fr_FR.tsx | 17 +++++++++ components/date-picker/locale/it_IT.tsx | 17 +++++++++ components/date-picker/locale/nl_BE.tsx | 17 +++++++++ components/locale-provider/en_GB.tsx | 46 ++++++++++++++++++++++++ components/locale-provider/fr_FR.tsx | 39 ++++++++++++++++++++ components/locale-provider/it_IT.tsx | 47 +++++++++++++++++++++++++ components/locale-provider/nl_BE.tsx | 46 ++++++++++++++++++++++++ components/time-picker/locale/en_GB.tsx | 5 +++ components/time-picker/locale/fr_FR.tsx | 5 +++ components/time-picker/locale/it_IT.tsx | 5 +++ components/time-picker/locale/nl_BE.tsx | 5 +++ 16 files changed, 274 insertions(+) create mode 100644 components/calendar/locale/en_GB.tsx create mode 100644 components/calendar/locale/fr_FR.tsx create mode 100644 components/calendar/locale/it_IT.tsx create mode 100644 components/calendar/locale/nl_BE.tsx create mode 100644 components/date-picker/locale/en_GB.tsx create mode 100644 components/date-picker/locale/fr_FR.tsx create mode 100644 components/date-picker/locale/it_IT.tsx create mode 100644 components/date-picker/locale/nl_BE.tsx create mode 100644 components/locale-provider/en_GB.tsx create mode 100644 components/locale-provider/fr_FR.tsx create mode 100644 components/locale-provider/it_IT.tsx create mode 100644 components/locale-provider/nl_BE.tsx create mode 100644 components/time-picker/locale/en_GB.tsx create mode 100644 components/time-picker/locale/fr_FR.tsx create mode 100644 components/time-picker/locale/it_IT.tsx create mode 100644 components/time-picker/locale/nl_BE.tsx diff --git a/components/calendar/locale/en_GB.tsx b/components/calendar/locale/en_GB.tsx new file mode 100644 index 000000000..0d081144e --- /dev/null +++ b/components/calendar/locale/en_GB.tsx @@ -0,0 +1,2 @@ +import en_GB from '../../date-picker/locale/en_GB'; +export default en_GB; diff --git a/components/calendar/locale/fr_FR.tsx b/components/calendar/locale/fr_FR.tsx new file mode 100644 index 000000000..98c62aa75 --- /dev/null +++ b/components/calendar/locale/fr_FR.tsx @@ -0,0 +1,2 @@ +import fr_FR from '../../date-picker/locale/fr_FR'; +export default fr_FR; diff --git a/components/calendar/locale/it_IT.tsx b/components/calendar/locale/it_IT.tsx new file mode 100644 index 000000000..907792ffb --- /dev/null +++ b/components/calendar/locale/it_IT.tsx @@ -0,0 +1,2 @@ +import it_IT from '../../date-picker/locale/it_IT'; +export default it_IT; diff --git a/components/calendar/locale/nl_BE.tsx b/components/calendar/locale/nl_BE.tsx new file mode 100644 index 000000000..7f36785fe --- /dev/null +++ b/components/calendar/locale/nl_BE.tsx @@ -0,0 +1,2 @@ +import nl_BE from '../../date-picker/locale/nl_BE'; +export default nl_BE; diff --git a/components/date-picker/locale/en_GB.tsx b/components/date-picker/locale/en_GB.tsx new file mode 100644 index 000000000..8032469e0 --- /dev/null +++ b/components/date-picker/locale/en_GB.tsx @@ -0,0 +1,17 @@ +import CalendarLocale from 'rc-calendar/lib/locale/en_GB'; +import TimePickerLocale from '../../time-picker/locale/en_GB'; +import assign from 'object-assign'; + +// Merge into a locale object +const locale = { + lang: assign({ + placeholder: 'Select date', + rangePlaceholder: ['Start date', 'End date'], + }, CalendarLocale), + timePickerLocale: assign({}, TimePickerLocale), +}; + +// All settings at: +// https://github.com/ant-design/ant-design/blob/master/components/date-picker/locale/example.json + +export default locale; diff --git a/components/date-picker/locale/fr_FR.tsx b/components/date-picker/locale/fr_FR.tsx new file mode 100644 index 000000000..9b45d1a76 --- /dev/null +++ b/components/date-picker/locale/fr_FR.tsx @@ -0,0 +1,17 @@ +import CalendarLocale from 'rc-calendar/lib/locale/fr_FR'; +import TimePickerLocale from '../../time-picker/locale/fr_FR'; +import assign from 'object-assign'; + +// Merge into a locale object +const locale = { + lang: assign({ + placeholder: 'Sélectionner une date', + rangePlaceholder: ['Date de début', 'Date de fin'], + }, CalendarLocale), + timePickerLocale: assign({}, TimePickerLocale), +}; + +// All settings at: +// https://github.com/ant-design/ant-design/issues/424 + +export default locale; diff --git a/components/date-picker/locale/it_IT.tsx b/components/date-picker/locale/it_IT.tsx new file mode 100644 index 000000000..4516505eb --- /dev/null +++ b/components/date-picker/locale/it_IT.tsx @@ -0,0 +1,17 @@ +import CalendarLocale from 'rc-calendar/lib/locale/it_IT'; +import TimePickerLocale from '../../time-picker/locale/it_IT'; +import assign from 'object-assign'; + +// Merge into a locale object +const locale = { + lang: assign({ + placeholder: 'Selezionare la data', + rangePlaceholder: ['Data d\'inizio', 'Data di fine'], + }, CalendarLocale), + timePickerLocale: assign({}, TimePickerLocale), +}; + +// All settings at: +// https://github.com/ant-design/ant-design/issues/424 + +export default locale; diff --git a/components/date-picker/locale/nl_BE.tsx b/components/date-picker/locale/nl_BE.tsx new file mode 100644 index 000000000..9e7385e33 --- /dev/null +++ b/components/date-picker/locale/nl_BE.tsx @@ -0,0 +1,17 @@ +import CalendarLocale from 'rc-calendar/lib/locale/nl_BE'; +import TimePickerLocale from '../../time-picker/locale/nl_BE'; +import assign from 'object-assign'; + +// Merge into a locale object +const locale = { + lang: assign({ + placeholder: 'Selecteer datum', + rangePlaceholder: ['Begin datum', 'Eind datum'], + }, CalendarLocale), + timePickerLocale: assign({}, TimePickerLocale), +}; + +// All settings at: +// https://github.com/ant-design/ant-design/issues/424 + +export default locale; diff --git a/components/locale-provider/en_GB.tsx b/components/locale-provider/en_GB.tsx new file mode 100644 index 000000000..260799ad4 --- /dev/null +++ b/components/locale-provider/en_GB.tsx @@ -0,0 +1,46 @@ +import moment from 'moment'; +moment.locale('en-gb'); + +import Pagination from 'rc-pagination/lib/locale/en_GB'; +import DatePicker from '../date-picker/locale/en_GB'; +import TimePicker from '../time-picker/locale/en_GB'; +import Calendar from '../calendar/locale/en_GB'; + +export default { + locale: 'en-gb', + DatePicker, + TimePicker, + Calendar, + Table: { + filterTitle: 'Filter Menu', + filterConfirm: 'OK', + filterReset: 'Reset', + emptyText: 'No Data', + selectAll: 'Select Current Page', + selectInvert: 'Select Invert', + }, + Modal: { + okText: 'OK', + cancelText: 'Cancel', + justOkText: 'OK', + }, + Popconfirm: { + okText: 'OK', + cancelText: 'Cancel', + }, + Transfer: { + notFoundContent: 'Not Found', + searchPlaceholder: 'Search here', + itemUnit: 'item', + itemsUnit: 'items', + }, + Select: { + notFoundContent: 'Not Found', + }, + Upload: { + uploading: 'Uploading...', + removeFile: 'Remove file', + uploadError: 'Upload error', + previewFile: 'Preview file', + }, +}; diff --git a/components/locale-provider/fr_FR.tsx b/components/locale-provider/fr_FR.tsx new file mode 100644 index 000000000..2698bc031 --- /dev/null +++ b/components/locale-provider/fr_FR.tsx @@ -0,0 +1,39 @@ +import moment from 'moment'; +moment.locale('fr'); + +import Pagination from 'rc-pagination/lib/locale/fr_FR'; +import DatePicker from '../date-picker/locale/fr_FR'; +import TimePicker from '../time-picker/locale/fr_FR'; +import Calendar from '../calendar/locale/fr_FR'; + +export default { + locale: 'fr', + Pagination, + DatePicker, + TimePicker, + Calendar, + Table: { + filterTitle: 'Filtrer', + filterConfirm: 'OK', + filterReset: 'Réinitialiser', + emptyText: 'Aucune donnée', + }, + Modal: { + okText: 'OK', + cancelText: 'Annuler', + justOkText: 'OK', + }, + Popconfirm: { + okText: 'OK', + cancelText: 'Annuler', + }, + Transfer: { + notFoundContent: 'Pas de résultat', + searchPlaceholder: 'Recherche', + itemUnit: 'élément', + itemsUnit: 'éléments', + }, + Select: { + notFoundContent: 'Pas de résultat', + }, +}; diff --git a/components/locale-provider/it_IT.tsx b/components/locale-provider/it_IT.tsx new file mode 100644 index 000000000..7b90e4ea4 --- /dev/null +++ b/components/locale-provider/it_IT.tsx @@ -0,0 +1,47 @@ +import moment from 'moment'; +moment.locale('it'); + +import Pagination from 'rc-pagination/lib/locale/it_IT'; +import DatePicker from '../date-picker/locale/it_IT'; +import TimePicker from '../time-picker/locale/it_IT'; +import Calendar from '../calendar/locale/it_IT'; + +export default { + locale: 'it', + Pagination, + DatePicker, + TimePicker, + Calendar, + Table: { + filterTitle: 'Menu Filtro', + filterConfirm: 'OK', + filterReset: 'Reset', + emptyText: 'Nessun dato', + selectAll: 'Seleziona pagina corrente', + selectInvert: 'Selezionare Inverti', + }, + Modal: { + okText: 'OK', + cancelText: 'Annulla', + justOkText: 'OK', + }, + Popconfirm: { + okText: 'OK', + cancelText: 'Annulla', + }, + Transfer: { + notFoundContent: 'Non trovato', + searchPlaceholder: 'Cerca qui', + itemUnit: 'articolo', + itemsUnit: 'elementi', + }, + Select: { + notFoundContent: 'Non trovato', + }, + Upload: { + uploading: 'Caricamento...', + removeFile: 'Rimuovi il file', + uploadError: 'Errore di caricamento', + previewFile: 'Anteprima file', + }, +}; diff --git a/components/locale-provider/nl_BE.tsx b/components/locale-provider/nl_BE.tsx new file mode 100644 index 000000000..f8eaa8e0d --- /dev/null +++ b/components/locale-provider/nl_BE.tsx @@ -0,0 +1,46 @@ +import moment from 'moment'; +moment.locale('nl-be'); + +import Pagination from 'rc-pagination/lib/locale/nl_BE'; +import DatePicker from '../date-picker/locale/nl_BE'; +import TimePicker from '../time-picker/locale/nl_BE'; +import Calendar from '../calendar/locale/nl_BE'; + +export default { + locale: 'nl-be', + DatePicker, + TimePicker, + Calendar, + Table: { + filterTitle: 'FilterMenu', + filterConfirm: 'OK', + filterReset: 'Reset', + emptyText: 'Geen gegevens', + selectAll: 'Selecteer huidige pagina', + selectInvert: 'Selecteer huidige pagina', + }, + Modal: { + okText: 'OK', + cancelText: 'Annuleer', + justOkText: 'OK', + }, + Popconfirm: { + okText: 'OK', + cancelText: 'Annuleer', + }, + Transfer: { + notFoundContent: 'Niet gevonden', + searchPlaceholder: 'Zoek hier', + itemUnit: 'item', + itemsUnit: 'items', + }, + Select: { + notFoundContent: 'Niet gevonden', + }, + Upload: { + uploading: 'Uploaden...', + removeFile: 'Bestand verwijderen', + uploadError: 'Upload fout', + previewFile: 'Preview bestand', + }, +}; diff --git a/components/time-picker/locale/en_GB.tsx b/components/time-picker/locale/en_GB.tsx new file mode 100644 index 000000000..b95b5a362 --- /dev/null +++ b/components/time-picker/locale/en_GB.tsx @@ -0,0 +1,5 @@ +const locale = { + placeholder: 'Select time', +}; + +export default locale; diff --git a/components/time-picker/locale/fr_FR.tsx b/components/time-picker/locale/fr_FR.tsx new file mode 100644 index 000000000..e6fca5d4e --- /dev/null +++ b/components/time-picker/locale/fr_FR.tsx @@ -0,0 +1,5 @@ +const locale = { + placeholder: 'Sélectionner l\'heure', +}; + +export default locale; diff --git a/components/time-picker/locale/it_IT.tsx b/components/time-picker/locale/it_IT.tsx new file mode 100644 index 000000000..16dd65d4e --- /dev/null +++ b/components/time-picker/locale/it_IT.tsx @@ -0,0 +1,5 @@ +const locale = { + placeholder: 'Selezionare il tempo', +}; + +export default locale; diff --git a/components/time-picker/locale/nl_BE.tsx b/components/time-picker/locale/nl_BE.tsx new file mode 100644 index 000000000..7318ca9f6 --- /dev/null +++ b/components/time-picker/locale/nl_BE.tsx @@ -0,0 +1,5 @@ +const locale = { + placeholder: 'Selecteer tijd', +}; + +export default locale; From 8e8f19e2b57d1b601588d3e6de77b06e229cc303 Mon Sep 17 00:00:00 2001 From: afc163 Date: Fri, 2 Jun 2017 21:55:04 +0800 Subject: [PATCH 20/34] update snapshot --- components/pagination/__tests__/__snapshots__/demo.test.js.snap | 1 + 1 file changed, 1 insertion(+) diff --git a/components/pagination/__tests__/__snapshots__/demo.test.js.snap b/components/pagination/__tests__/__snapshots__/demo.test.js.snap index 19961552d..286eb15ae 100644 --- a/components/pagination/__tests__/__snapshots__/demo.test.js.snap +++ b/components/pagination/__tests__/__snapshots__/demo.test.js.snap @@ -730,6 +730,7 @@ exports[`renders ./components/pagination/demo/simple.md correctly 1`] = ` title="2/5" > From 9193c051021627ac9d1d6cce3d1d7890b6ef5a96 Mon Sep 17 00:00:00 2001 From: Damian Green Date: Fri, 2 Jun 2017 14:58:13 +0100 Subject: [PATCH 21/34] fix lint --- components/locale-provider/en_GB.tsx | 1 + components/locale-provider/nl_BE.tsx | 1 + 2 files changed, 2 insertions(+) diff --git a/components/locale-provider/en_GB.tsx b/components/locale-provider/en_GB.tsx index 260799ad4..ad54e9016 100644 --- a/components/locale-provider/en_GB.tsx +++ b/components/locale-provider/en_GB.tsx @@ -8,6 +8,7 @@ import Calendar from '../calendar/locale/en_GB'; export default { locale: 'en-gb', + Pagination, DatePicker, TimePicker, Calendar, diff --git a/components/locale-provider/nl_BE.tsx b/components/locale-provider/nl_BE.tsx index f8eaa8e0d..6a4f87e56 100644 --- a/components/locale-provider/nl_BE.tsx +++ b/components/locale-provider/nl_BE.tsx @@ -8,6 +8,7 @@ import Calendar from '../calendar/locale/nl_BE'; export default { locale: 'nl-be', + Pagination, DatePicker, TimePicker, Calendar, From 5e84b79996a5329d5059e97ff238627f64871658 Mon Sep 17 00:00:00 2001 From: Damian Green Date: Fri, 2 Jun 2017 16:58:42 +0100 Subject: [PATCH 22/34] bump rc-pagination@1.9.4 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index cfb61395e..72a4e979e 100644 --- a/package.json +++ b/package.json @@ -58,7 +58,7 @@ "rc-input-number": "~3.4.4", "rc-menu": "~5.0.9", "rc-notification": "~1.4.0", - "rc-pagination": "~1.9.2", + "rc-pagination": "~1.9.4", "rc-progress": "~2.1.0", "rc-rate": "~2.1.0", "rc-select": "~6.8.0", From 920adb9a8a8e7b5953947574503efa9963b88ee3 Mon Sep 17 00:00:00 2001 From: afc163 Date: Sat, 3 Jun 2017 00:55:30 +0800 Subject: [PATCH 23/34] props.style in wrapper for input with addons --- components/input/Input.tsx | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/components/input/Input.tsx b/components/input/Input.tsx index cba15b1cf..b3e9b114b 100644 --- a/components/input/Input.tsx +++ b/components/input/Input.tsx @@ -180,19 +180,29 @@ export default class Input extends Component { [wrapperClassName]: (addonBefore || addonAfter), }); - const node = ( + // Need another wrapper for changing display:table to display:inline-block + // and put style prop in wrapper + if (addonBefore || addonAfter) { + return ( + + + {addonBefore} + {cloneElement(children, { style: null })} + {addonAfter} + + + ); + } + return ( {addonBefore} {children} {addonAfter} ); - - // Need another wrapper for changing display:table to display:inline-block - if (addonBefore || addonAfter) { - return {node}; - } - return node; } renderLabeledIcon(children) { From bd2ad34300e6f8e37fc9cdd3d5ee0d99783ab464 Mon Sep 17 00:00:00 2001 From: afc163 Date: Sat, 3 Jun 2017 01:05:27 +0800 Subject: [PATCH 24/34] Add changelog for 2.10.4 --- CHANGELOG.en-US.md | 8 +++++++- CHANGELOG.zh-CN.md | 10 ++++++++-- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.en-US.md b/CHANGELOG.en-US.md index 40ba71e74..fd46f63ea 100644 --- a/CHANGELOG.en-US.md +++ b/CHANGELOG.en-US.md @@ -17,6 +17,12 @@ If you want to read change logs before `2.0.0`, please visit [GitHub](https://gi --- +## 2.10.4 + +`2017-06-01` + +- Fix `rc-util@<4.0.4` issue. + ## 2.10.3 `2017-05-31` @@ -30,7 +36,7 @@ If you want to read change logs before `2.0.0`, please visit [GitHub](https://gi - **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) + - 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) diff --git a/CHANGELOG.zh-CN.md b/CHANGELOG.zh-CN.md index 24a63be93..e4ddfeb8a 100644 --- a/CHANGELOG.zh-CN.md +++ b/CHANGELOG.zh-CN.md @@ -17,11 +17,17 @@ timeline: true --- +## 2.10.4 + +`2017-06-01` + +- 修复可能安装到 `rc-util@<4.0.4` 版本导致 `Can't resolve 'rc-util/es/KeyCode'` 的问题。 + ## 2.10.3 `2017-05-31` -- **Calendar** +- **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) @@ -30,7 +36,7 @@ timeline: true - **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) + - 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) From dc314983b99f0f45b291849c7a69cdeda0416416 Mon Sep 17 00:00:00 2001 From: afc163 Date: Sat, 3 Jun 2017 01:06:24 +0800 Subject: [PATCH 25/34] fix changelog for 2.10.4 --- CHANGELOG.en-US.md | 3 ++- CHANGELOG.zh-CN.md | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.en-US.md b/CHANGELOG.en-US.md index fd46f63ea..43abb9dcd 100644 --- a/CHANGELOG.en-US.md +++ b/CHANGELOG.en-US.md @@ -21,7 +21,8 @@ If you want to read change logs before `2.0.0`, please visit [GitHub](https://gi `2017-06-01` -- Fix `rc-util@<4.0.4` issue. +- 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 diff --git a/CHANGELOG.zh-CN.md b/CHANGELOG.zh-CN.md index e4ddfeb8a..57952cbe7 100644 --- a/CHANGELOG.zh-CN.md +++ b/CHANGELOG.zh-CN.md @@ -21,7 +21,8 @@ timeline: true `2017-06-01` -- 修复可能安装到 `rc-util@<4.0.4` 版本导致 `Can't resolve 'rc-util/es/KeyCode'` 的问题。 +- 修正 `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 From 0a1c0712a2a496499f0aa325d0dd6aca375f1279 Mon Sep 17 00:00:00 2001 From: afc163 Date: Sat, 3 Jun 2017 01:37:02 +0800 Subject: [PATCH 26/34] Fix DatePicker panel position, close #6347 --- components/date-picker/createPicker.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/date-picker/createPicker.tsx b/components/date-picker/createPicker.tsx index 315bbdc1c..4bf1d759f 100644 --- a/components/date-picker/createPicker.tsx +++ b/components/date-picker/createPicker.tsx @@ -125,7 +125,7 @@ export default function createPicker(TheCalendar): any { ) : null; const input = ({ value: inputValue }) => ( - +
    {clearIcon} - +
    ); const pickerValue = value; From d086ee253e7676a3d0a0277a459719a3fcc020fc Mon Sep 17 00:00:00 2001 From: afc163 Date: Sat, 3 Jun 2017 01:38:26 +0800 Subject: [PATCH 27/34] update snapshots for #6347 --- .../__tests__/__snapshots__/demo.test.js.snap | 52 +++++++++---------- .../__tests__/__snapshots__/demo.test.js.snap | 20 +++---- .../__tests__/__snapshots__/demo.test.js.snap | 4 +- .../__tests__/__snapshots__/demo.test.js.snap | 4 +- 4 files changed, 40 insertions(+), 40 deletions(-) diff --git a/components/date-picker/__tests__/__snapshots__/demo.test.js.snap b/components/date-picker/__tests__/__snapshots__/demo.test.js.snap index 0521d791e..5a1d32240 100644 --- a/components/date-picker/__tests__/__snapshots__/demo.test.js.snap +++ b/components/date-picker/__tests__/__snapshots__/demo.test.js.snap @@ -5,7 +5,7 @@ exports[`renders ./components/date-picker/demo/basic.md correctly 1`] = ` - +
    - +

    - +
    - +

    - +
    - +

    - +
    - +

    - +
    - +

    - +
    - +

    - +
    - +

    - +
    - +

    - +
    - +

    - +
    - +

    - +
    - +
    - +
    - +
    `; @@ -508,7 +508,7 @@ exports[`renders ./components/date-picker/demo/time.md correctly 1`] = ` class="ant-calendar-picker" style="width:154px;" > - +
    - +

    - +
    - +
    @@ -1732,7 +1732,7 @@ exports[`renders ./components/form/demo/time-related-controls.md correctly 1`] = class="ant-calendar-picker" style="width:154px;" > - +
    - +
    @@ -1770,7 +1770,7 @@ exports[`renders ./components/form/demo/time-related-controls.md correctly 1`] = - +
    - +
    @@ -2801,7 +2801,7 @@ exports[`renders ./components/form/demo/validate-static.md correctly 1`] = ` - +
    - +
    - +
    - +
    diff --git a/components/input/__tests__/__snapshots__/demo.test.js.snap b/components/input/__tests__/__snapshots__/demo.test.js.snap index 18a6a1943..407b3c0e1 100644 --- a/components/input/__tests__/__snapshots__/demo.test.js.snap +++ b/components/input/__tests__/__snapshots__/demo.test.js.snap @@ -359,7 +359,7 @@ exports[`renders ./components/input/demo/group.md correctly 1`] = ` - +
    - +

    diff --git a/components/locale-provider/__tests__/__snapshots__/demo.test.js.snap b/components/locale-provider/__tests__/__snapshots__/demo.test.js.snap index 90c2903d2..46099dcf8 100644 --- a/components/locale-provider/__tests__/__snapshots__/demo.test.js.snap +++ b/components/locale-provider/__tests__/__snapshots__/demo.test.js.snap @@ -211,7 +211,7 @@ exports[`renders ./components/locale-provider/demo/all.md correctly 1`] = ` - +
    - +
    Date: Mon, 5 Jun 2017 11:39:59 +0800 Subject: [PATCH 28/34] Fix Timeline.Item type, close #6356 --- components/timeline/Timeline.tsx | 4 ++-- components/timeline/index.tsx | 2 -- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/components/timeline/Timeline.tsx b/components/timeline/Timeline.tsx index bad03618d..17cd650fe 100644 --- a/components/timeline/Timeline.tsx +++ b/components/timeline/Timeline.tsx @@ -1,6 +1,6 @@ import React from 'react'; import classNames from 'classnames'; -import TimelineItem from './TimelineItem'; +import TimelineItem, { TimeLineItemProps } from './TimelineItem'; export interface TimelineProps { prefixCls?: string; @@ -11,7 +11,7 @@ export interface TimelineProps { } export default class Timeline extends React.Component { - static Item: React.ReactNode; + static Item = TimelineItem as React.ClassicComponentClass; static defaultProps = { prefixCls: 'ant-timeline', }; diff --git a/components/timeline/index.tsx b/components/timeline/index.tsx index 7f27820a7..33eb2dd86 100644 --- a/components/timeline/index.tsx +++ b/components/timeline/index.tsx @@ -1,5 +1,3 @@ import Timeline from './Timeline'; -import TimelineItem from './TimelineItem'; -Timeline.Item = TimelineItem; export default Timeline; From cc5f2edde16755f40624e5c80adf954e71b70377 Mon Sep 17 00:00:00 2001 From: paranoidjk Date: Mon, 5 Jun 2017 11:54:04 +0800 Subject: [PATCH 29/34] feat: upgrade bisheng. ref https://github.com/ant-design/ant-design-mobile/issues/1292 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index cfb61395e..c6c4e29b2 100644 --- a/package.json +++ b/package.json @@ -92,7 +92,7 @@ "babel-preset-react": "^6.16.0", "babel-preset-stage-0": "^6.16.0", "bezier-easing": "^2.0.3", - "bisheng": "^0.23.0", + "bisheng": "^0.24.0", "bisheng-plugin-antd": "^0.13.2", "bisheng-plugin-description": "^0.1.1", "bisheng-plugin-react": "^0.5.0", From 45f5d6cdfe5ce3422f3a8b42251ee252372aaa45 Mon Sep 17 00:00:00 2001 From: afc163 Date: Mon, 5 Jun 2017 14:12:59 +0800 Subject: [PATCH 30/34] Tweak progress text width, close #6354 --- components/progress/style/index.less | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/components/progress/style/index.less b/components/progress/style/index.less index d9f2453a1..d3fec88f0 100644 --- a/components/progress/style/index.less +++ b/components/progress/style/index.less @@ -18,8 +18,8 @@ margin-right: 0; padding-right: 0; .@{progress-prefix-cls}-show-info & { - padding-right: 45px; - margin-right: -45px; + padding-right: 2.75em; + margin-right: -2.75em; } } @@ -47,14 +47,12 @@ } &-text { - width: 35px; + width: 2em; text-align: left; font-size: 1em; - margin-left: 10px; + margin-left: 0.75em; vertical-align: middle; display: inline-block; - position: relative; - top: -1px; .@{iconfont-css-prefix} { font-size: @font-size-base; } From ea616e4deba1ab0421e64dd0e29f1085269d08ed Mon Sep 17 00:00:00 2001 From: Damian Green Date: Mon, 5 Jun 2017 10:28:45 +0100 Subject: [PATCH 31/34] tests --- components/locale-provider/__tests__/index.test.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/components/locale-provider/__tests__/index.test.js b/components/locale-provider/__tests__/index.test.js index 6b142fc65..fe93a13b8 100644 --- a/components/locale-provider/__tests__/index.test.js +++ b/components/locale-provider/__tests__/index.test.js @@ -3,6 +3,10 @@ import { mount } from 'enzyme'; import moment from 'moment'; import { LocaleProvider, Pagination, DatePicker, TimePicker, Calendar, Popconfirm, Table, Modal, Select, Transfer } from '../../'; +import enGB from '../en_GB'; +import frFR from '../fr_FR'; +import nlBE from '../nl_BE'; +import itIT from '../it_IT'; import enUS from '../en_US'; import ptBR from '../pt_BR'; import ruRU from '../ru_RU'; @@ -22,7 +26,7 @@ import zhTW from '../zh_TW'; import fiFI from '../fi_FI'; import bgBG from '../bg_BG'; -const locales = [enUS, ptBR, ruRU, esES, svSE, frBE, deDE, nlNL, caES, csCZ, koKR, etEE, skSK, jaJP, trTR, zhTW, fiFI, bgBG]; +const locales = [enUS, ptBR, ruRU, esES, svSE, frBE, deDE, nlNL, caES, csCZ, koKR, etEE, skSK, jaJP, trTR, zhTW, fiFI, bgBG, enGB, frFR, nlBE, itIT]; const Option = Select.Option; const RangePicker = DatePicker.RangePicker; From 8c632ef2cf5dc9f77961236768984682f0c84dd2 Mon Sep 17 00:00:00 2001 From: Benjy Cui Date: Tue, 6 Jun 2017 11:51:50 +0800 Subject: [PATCH 32/34] fix: Modal.method should stop loading when promise throw err, close: #6183 --- components/modal/ActionButton.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/components/modal/ActionButton.tsx b/components/modal/ActionButton.tsx index 674bc3be2..e4f8ffa46 100644 --- a/components/modal/ActionButton.tsx +++ b/components/modal/ActionButton.tsx @@ -43,6 +43,9 @@ export default class ActionButton extends React.Component { + // See: https://github.com/ant-design/ant-design/issues/6183 + this.setState({ loading: false }); }); } } else { From 505cc23a74474919a272b1f31ee0e802cc5b8ad4 Mon Sep 17 00:00:00 2001 From: afc163 Date: Tue, 6 Jun 2017 13:40:19 +0800 Subject: [PATCH 33/34] Improve doc for create-react-app, close #6371 --- docs/react/use-with-create-react-app.en-US.md | 37 ++++++++++++++----- docs/react/use-with-create-react-app.zh-CN.md | 36 +++++++++++++----- 2 files changed, 54 insertions(+), 19 deletions(-) diff --git a/docs/react/use-with-create-react-app.en-US.md b/docs/react/use-with-create-react-app.en-US.md index a9c39f4ce..8cb11c226 100644 --- a/docs/react/use-with-create-react-app.en-US.md +++ b/docs/react/use-with-create-react-app.en-US.md @@ -63,7 +63,7 @@ Modify `src/App.js`, import Button component from `antd`. ```jsx import React, { Component } from 'react'; -import { Button } from 'antd'; +import Button from 'antd/lib/button'; import './App.css'; class App extends Component { @@ -96,19 +96,16 @@ Ok, you now see a blue primary button displaying in page now, next you can choos ## Advanced Guides -We are successfully running antd components now; but in the real world, there are still lots of problems about antd-demo. -For instance, we actually import all components in the project which will cause a serious network perfermance issue. +We are successfully running antd components now. But in the real world, there are still lots of problems about antd-demo. +For instance, we actually import all styles of components in the project which maybe a network perfermance issue. -> You will see a warning in your browser console. -> ![](https://zos.alipayobjects.com/rmsportal/vgcHJRVZFmPjAawwVoXK.png) - -So it is necessary to customize the default webpack config. We can achieve that by using `eject` script command. +Sometimes it could be necessary to customize the default webpack config. We can achieve that by using `eject` script command. ```bash $ yarn run eject ``` -### Import on demand +### Use babel-plugin-import [babel-plugin-import](https://github.com/ant-design/babel-plugin-import) is a babel plugin for importing components on demand ([principle](/docs/react/getting-started#Import-on-Demand)). After eject all config files to antd-demo, we allowed to install it and modify `config/webpack.config.dev.js` now. @@ -136,9 +133,29 @@ $ yarn add babel-plugin-import --dev > Note: because there is no `.babelrc` file after config eject, so we have to put the babel option into `webpack.config.js` or `babel` field of `package.json`. -Remove the `@import '~antd/dist/antd.css';` statement added before because `babel-plugin-import` will import styles. +Remove the `@import '~antd/dist/antd.css';` statement added before because `babel-plugin-import` will import styles and import components like below: -Then reboot `yarn start` and visit demo page, you should find that the above warning message would be gone which prove the `import on demand` config is effective now. +```diff + // scr/App.js + import React, { Component } from 'react'; +- import Button from 'antd/lib/button'; ++ import { Button } from 'antd'; + import './App.css'; + + class App extends Component { + render() { + return ( +
    + +
    + ); + } + } + + export default App; +``` + +Then reboot `yarn start` and visit demo page, you should not find any [warning message](https://zos.alipayobjects.com/rmsportal/vgcHJRVZFmPjAawwVoXK.png) in console which prove the `import on demand` config is working now. You will find more info about it in [this guide](/docs/react/getting-started#Import-on-Demand). ### Customize Theme diff --git a/docs/react/use-with-create-react-app.zh-CN.md b/docs/react/use-with-create-react-app.zh-CN.md index e74233dbf..905d76a3e 100644 --- a/docs/react/use-with-create-react-app.zh-CN.md +++ b/docs/react/use-with-create-react-app.zh-CN.md @@ -62,7 +62,7 @@ $ yarn add antd ```jsx import React, { Component } from 'react'; -import { Button } from 'antd'; +import Button from 'antd/lib/button'; import './App.css'; class App extends Component { @@ -94,18 +94,15 @@ export default App; ## 高级配置 -我们现在已经把组件成功运行起来了,但是在实际开发过程中还有很多问题,例如上面的例子实际上加载了全部的 antd 组件的代码(对前端性能是个隐患)。 +我们现在已经把组件成功运行起来了,但是在实际开发过程中还有很多问题,例如上面的例子实际上加载了全部的 antd 组件的样式(对前端性能是个隐患)。 -> 你会在控制台看到如下警告。 -> ![](https://zos.alipayobjects.com/rmsportal/vgcHJRVZFmPjAawwVoXK.png) - -我们需要对 create-react-app 的默认配置进行自定义。可以使用 `eject` 命令将所有内建的配置暴露出来。 +此时我们可能需要对 create-react-app 的默认配置进行自定义。可以使用 `eject` 命令将所有内建的配置暴露出来。 ```bash $ yarn run eject ``` -### 按需加载 +### 使用 babel-plugin-import [babel-plugin-import](https://github.com/ant-design/babel-plugin-import) 是一个用于按需加载组件代码和样式的 babel 插件([原理](/docs/react/getting-started#按需加载)),现在我们尝试安装它并修改 `config/webpack.config.dev.js` 文件。 @@ -133,9 +130,30 @@ $ yarn add babel-plugin-import --dev > 注意,由于 create-react-app eject 之后的配置中没有 `.babelrc` 文件,所以需要把配置放到 `webpack.config.js` 或 `package.json` 的 `babel` 属性中。 -然后移除前面在 `src/App.css` 里全量添加的 `@import '~antd/dist/antd.css';` 样式代码,现在 babel-plugin-import 会按需加载样式。 -最后重启 `yarn start` 访问页面,此时上面的警告信息应该没了,antd 组件的 js 和 css 代码都会按需加载。 +然后移除前面在 `src/App.css` 里全量添加的 `@import '~antd/dist/antd.css';` 样式代码,并且按下面的格式引入模块。 + +```diff + // scr/App.js + import React, { Component } from 'react'; +- import Button from 'antd/lib/button'; ++ import { Button } from 'antd'; + import './App.css'; + + class App extends Component { + render() { + return ( +
    + +
    + ); + } + } + + export default App; +``` + +最后重启 `yarn start` 访问页面,antd 组件的 js 和 css 代码都会按需加载,你在控制台也不会看到这样的[警告信息](https://zos.alipayobjects.com/rmsportal/vgcHJRVZFmPjAawwVoXK.png)。关于按需加载的原理和其他方式可以阅读[这里](/docs/react/getting-started#Import-on-Demand). ### 自定义主题 From 5e55383796a7f47193731a3ac34833b2fbf51a9b Mon Sep 17 00:00:00 2001 From: Benjy Cui Date: Tue, 6 Jun 2017 17:17:18 +0800 Subject: [PATCH 34/34] deps: lock antd-tools to minor, to avoid eslint failed --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 078409247..123f3d44b 100644 --- a/package.json +++ b/package.json @@ -82,7 +82,7 @@ "@types/react": "^15.0.8", "@types/react-dom": "~0.14.18", "antd-demo-jest": "^1.0.5", - "antd-tools": "^1.4.2", + "antd-tools": "~1.5.0", "babel-cli": "^6.18.0", "babel-eslint": "^7.1.0", "babel-jest": "^19.0.0",