From 1042681bcd22593d8af8606f0b9f1918443d04e7 Mon Sep 17 00:00:00 2001 From: afc163 Date: Tue, 10 Jan 2017 13:46:52 +0800 Subject: [PATCH 01/85] Fix Table filter dropdown style --- components/dropdown/style/index.less | 2 +- components/table/style/index.less | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/components/dropdown/style/index.less b/components/dropdown/style/index.less index 3ce7d6c1f1..ea717c2095 100644 --- a/components/dropdown/style/index.less +++ b/components/dropdown/style/index.less @@ -107,7 +107,7 @@ font-family: "anticon" !important; position: absolute; content: "\e61f"; - right: 16px; + right: 12px; color: @text-color-secondary; .iconfont-size-under-12px(10px); } diff --git a/components/table/style/index.less b/components/table/style/index.less index 9e78834906..9b9ff1dfec 100644 --- a/components/table/style/index.less +++ b/components/table/style/index.less @@ -357,7 +357,7 @@ border-radius: @border-radius-base @border-radius-base 0 0; &-item > label + span { - margin-left: 8px; + padding: 0; } &-sub { From 75b50e9731340672225f72b59016fde5810207ac Mon Sep 17 00:00:00 2001 From: afc163 Date: Tue, 10 Jan 2017 14:03:04 +0800 Subject: [PATCH 02/85] wider the selection column and expand column of Table --- components/table/demo/expand-children.md | 1 - components/table/style/index.less | 10 ++++------ 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/components/table/demo/expand-children.md b/components/table/demo/expand-children.md index 206b9fb68c..49ece808c1 100644 --- a/components/table/demo/expand-children.md +++ b/components/table/demo/expand-children.md @@ -34,7 +34,6 @@ const columns = [{ title: 'Address', dataIndex: 'address', key: 'address', - width: '30%', }]; const data = [{ diff --git a/components/table/style/index.less b/components/table/style/index.less index 9b9ff1dfec..1c9c6f972b 100644 --- a/components/table/style/index.less +++ b/components/table/style/index.less @@ -132,9 +132,11 @@ } &-thead > tr > th.@{table-prefix-cls}-selection-column, - &-tbody > tr > td.@{table-prefix-cls}-selection-column { + &-tbody > tr > td.@{table-prefix-cls}-selection-column, + &-expand-icon-th, + &-row-expand-icon-cell { text-align: center; - width: 40px; + width: 48px; } &-header { @@ -406,10 +408,6 @@ } } - &-expand-icon-th { - width: 40px; - } - &-row { &-expand-icon { cursor: pointer; From 088ecf18a4b1a83344e604256499beb13c19ff4a Mon Sep 17 00:00:00 2001 From: afc163 Date: Tue, 10 Jan 2017 14:09:19 +0800 Subject: [PATCH 03/85] cleaner demo --- components/table/demo/jsx.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/table/demo/jsx.md b/components/table/demo/jsx.md index c53afb8adc..38a52dccfd 100644 --- a/components/table/demo/jsx.md +++ b/components/table/demo/jsx.md @@ -39,7 +39,7 @@ const data = [{ }]; ReactDOM.render( - +
Date: Tue, 10 Jan 2017 14:10:44 +0800 Subject: [PATCH 04/85] fix table demo snapshot --- components/table/__tests__/__snapshots__/demo.test.js.snap | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/components/table/__tests__/__snapshots__/demo.test.js.snap b/components/table/__tests__/__snapshots__/demo.test.js.snap index 61f60d6964..f0f4668983 100644 --- a/components/table/__tests__/__snapshots__/demo.test.js.snap +++ b/components/table/__tests__/__snapshots__/demo.test.js.snap @@ -2352,8 +2352,7 @@ exports[`test renders ./components/table/demo/expand-children.md correctly 1`] = style="width:40%;min-width:40%;" /> - + @@ -6319,7 +6318,7 @@ exports[`test renders ./components/table/demo/jsx.md correctly 1`] = `
+ class="ant-table ant-table-large ant-table-without-column-header ant-table-scroll-position-left">
Date: Tue, 10 Jan 2017 15:11:43 +0800 Subject: [PATCH 05/85] Fix Search block again, close #4540 --- components/input/Input.tsx | 6 +++--- components/input/__tests__/__snapshots__/demo.test.js.snap | 3 ++- components/input/demo/search-input.md | 6 +++++- components/input/style/mixin.less | 4 +++- components/tree/__tests__/__snapshots__/demo.test.js.snap | 4 ++-- 5 files changed, 15 insertions(+), 8 deletions(-) diff --git a/components/input/Input.tsx b/components/input/Input.tsx index 4753fd3393..f8b2dfba61 100644 --- a/components/input/Input.tsx +++ b/components/input/Input.tsx @@ -1,5 +1,5 @@ import React from 'react'; -import { Component, PropTypes } from 'react'; +import { Component, PropTypes, cloneElement } from 'react'; import classNames from 'classnames'; import calculateNodeHeight from './calculateNodeHeight'; import assign from 'object-assign'; @@ -236,9 +236,9 @@ export default class Input extends Component { ) : null; return ( - + {prefix} - {children} + {cloneElement(children, { style: null })} {suffix} ); diff --git a/components/input/__tests__/__snapshots__/demo.test.js.snap b/components/input/__tests__/__snapshots__/demo.test.js.snap index 0da831cd5d..539f20ecdc 100644 --- a/components/input/__tests__/__snapshots__/demo.test.js.snap +++ b/components/input/__tests__/__snapshots__/demo.test.js.snap @@ -365,7 +365,8 @@ exports[`test renders ./components/input/demo/presuffix.md correctly 1`] = ` exports[`test renders ./components/input/demo/search-input.md correctly 1`] = ` + class="ant-input-preSuffix-wrapper" + style="width:200px;"> console.log(value)} /> + console.log(value)} + /> , mountNode); ```` diff --git a/components/input/style/mixin.less b/components/input/style/mixin.less index 8848805aa9..b454216c99 100644 --- a/components/input/style/mixin.less +++ b/components/input/style/mixin.less @@ -278,6 +278,8 @@ .input-preSuffix-wrapper(@inputClass) { position: relative; + display: inline-block; + width: 100%; .@{inputClass} { z-index: 1; @@ -290,7 +292,7 @@ .@{inputClass}-prefix, .@{inputClass}-suffix { position: absolute; - top: 51%; // little adjust for misplace + top: 50%; transform: translateY(-50%); z-index: 2; line-height: 1.2; diff --git a/components/tree/__tests__/__snapshots__/demo.test.js.snap b/components/tree/__tests__/__snapshots__/demo.test.js.snap index fedd4e9e59..9d57655019 100644 --- a/components/tree/__tests__/__snapshots__/demo.test.js.snap +++ b/components/tree/__tests__/__snapshots__/demo.test.js.snap @@ -526,11 +526,11 @@ exports[`test renders ./components/tree/demo/dynamic.md correctly 1`] = ` exports[`test renders ./components/tree/demo/search.md correctly 1`] = `
+ class="ant-input-preSuffix-wrapper" + style="width:200px;"> From 3f5aebe85bf6c47aae31efac18727762d0021c16 Mon Sep 17 00:00:00 2001 From: afc163 Date: Tue, 10 Jan 2017 20:52:53 +0800 Subject: [PATCH 06/85] Fix Table column.filteredValue null problem, ref #4550 --- components/table/Table.tsx | 2 +- .../table/__tests__/Table.filter.test.js | 16 +++++++++ .../__tests__/__snapshots__/demo.test.js.snap | 33 ++++++++++++------- components/table/demo/reset-filter.md | 27 +++++++-------- 4 files changed, 49 insertions(+), 29 deletions(-) diff --git a/components/table/Table.tsx b/components/table/Table.tsx index ce0c5c5478..9f7b1d7b37 100755 --- a/components/table/Table.tsx +++ b/components/table/Table.tsx @@ -294,7 +294,7 @@ export default class Table extends React.Component, any> { } getFilteredValueColumns(columns?) { - return (columns || this.columns || []).filter(column => column.filteredValue); + return (columns || this.columns || []).filter(column => typeof column.filteredValue !== 'undefined'); } getFiltersFromColumns(columns?) { diff --git a/components/table/__tests__/Table.filter.test.js b/components/table/__tests__/Table.filter.test.js index 49ca3970fb..1517ba5fca 100644 --- a/components/table/__tests__/Table.filter.test.js +++ b/components/table/__tests__/Table.filter.test.js @@ -128,6 +128,22 @@ describe('Table.filter', () => { expect(wrapper.find('tbody tr').length).toBe(4); }); + it('can be controlled by filteredValue null', () => { + const wrapper = mount(createTable({ + columns: [{ + ...column, + filteredValue: ['girl'], + }], + })); + + expect(wrapper.find('tbody tr').length).toBe(1); + wrapper.setProps({ columns: [{ + ...column, + filteredValue: null, + }] }); + expect(wrapper.find('tbody tr').length).toBe(4); + }); + it('fires change event', () => { const handleChange = jest.fn(); const wrapper = mount(createTable({ onChange: handleChange })); diff --git a/components/table/__tests__/__snapshots__/demo.test.js.snap b/components/table/__tests__/__snapshots__/demo.test.js.snap index f0f4668983..d596ea15dd 100644 --- a/components/table/__tests__/__snapshots__/demo.test.js.snap +++ b/components/table/__tests__/__snapshots__/demo.test.js.snap @@ -6908,18 +6908,27 @@ exports[`test renders ./components/table/demo/reset-filter.md correctly 1`] = `
- - Age descending order - - - Clear filters - - - Clear filters and sorting - + + +
diff --git a/components/table/demo/reset-filter.md b/components/table/demo/reset-filter.md index 88b0131b34..69f61287a8 100644 --- a/components/table/demo/reset-filter.md +++ b/components/table/demo/reset-filter.md @@ -22,7 +22,7 @@ Control filters and sorters by `filteredValue` and `sortOrder`. > 3. `column.key` is required. ````jsx -import { Table } from 'antd'; +import { Table, Button } from 'antd'; const data = [{ key: '1', @@ -60,19 +60,16 @@ const App = React.createClass({ sortedInfo: sorter, }); }, - clearFilters(e) { - e.preventDefault(); + clearFilters() { this.setState({ filteredInfo: null }); }, - clearAll(e) { - e.preventDefault(); + clearAll() { this.setState({ filteredInfo: null, sortedInfo: null, }); }, - setAgeSort(e) { - e.preventDefault(); + setAgeSort() { this.setState({ sortedInfo: { order: 'descend', @@ -92,7 +89,7 @@ const App = React.createClass({ { text: 'Joe', value: 'Joe' }, { text: 'Jim', value: 'Jim' }, ], - filteredValue: filteredInfo.name, + filteredValue: filteredInfo.name || null, onFilter: (value, record) => record.name.includes(value), sorter: (a, b) => a.name.length - b.name.length, sortOrder: sortedInfo.columnKey === 'name' && sortedInfo.order, @@ -110,7 +107,7 @@ const App = React.createClass({ { text: 'London', value: 'London' }, { text: 'New York', value: 'New York' }, ], - filteredValue: filteredInfo.address, + filteredValue: filteredInfo.address || null, onFilter: (value, record) => record.address.includes(value), sorter: (a, b) => a.address.length - b.address.length, sortOrder: sortedInfo.columnKey === 'address' && sortedInfo.order, @@ -118,9 +115,9 @@ const App = React.createClass({ return (
- Age descending order - Clear filters - Clear filters and sorting + + +
@@ -133,12 +130,10 @@ ReactDOM.render(, mountNode); ````css .table-operations { - font-size: 12px; - text-align: right; margin-bottom: 16px; } -.table-operations a { - margin-left: 8px; +.table-operations > button { + margin-right: 8px; } ```` From 29324ca59d7fa2d913d3a3866a191310bf33c4e8 Mon Sep 17 00:00:00 2001 From: afc163 Date: Tue, 10 Jan 2017 22:10:37 +0800 Subject: [PATCH 07/85] Add less variables for TimePicker panel width, close #4194 --- components/style/themes/default.less | 5 +++++ components/time-picker/style/index.less | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/components/style/themes/default.less b/components/style/themes/default.less index 955e45e56d..9ddb975167 100644 --- a/components/style/themes/default.less +++ b/components/style/themes/default.less @@ -234,3 +234,8 @@ @spin-dot-size-sm: 14px; @spin-dot-size: 20px; @spin-dot-size-lg: 32px; + +// TimePicker +// --- +@time-picker-panel-column-width: 56px; +@time-picker-panel-width: @time-picker-panel-column-width * 3; diff --git a/components/time-picker/style/index.less b/components/time-picker/style/index.less index 67781a4c71..9feb1a63de 100644 --- a/components/time-picker/style/index.less +++ b/components/time-picker/style/index.less @@ -5,7 +5,7 @@ @timepicker-prefix-cls: ~"@{ant-prefix}-time-picker"; .@{timepicker-prefix-cls}-panel { - max-width: 168px; + max-width: @time-picker-panel-width; z-index: @zindex-picker; position: absolute; @@ -74,7 +74,7 @@ } &-narrow &-input-wrap { - max-width: 111px; + max-width: @time-picker-panel-column-width * 2; } &-select { @@ -82,7 +82,7 @@ font-size: @font-size-base; border-left: 1px solid @border-color-split; box-sizing: border-box; - width: 56px; + width: @time-picker-panel-column-width; overflow: hidden; position: relative; // Fix chrome weird render bug max-height: 144px; From e0999eaec3c8be28da6d666a38730fe59beca2a0 Mon Sep 17 00:00:00 2001 From: afc163 Date: Wed, 11 Jan 2017 11:32:17 +0800 Subject: [PATCH 08/85] fix code indent --- components/layout/demo/custom-trigger.md | 4 ++-- components/layout/demo/side.md | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/components/layout/demo/custom-trigger.md b/components/layout/demo/custom-trigger.md index d5c90a3cfb..f30a6b3a49 100644 --- a/components/layout/demo/custom-trigger.md +++ b/components/layout/demo/custom-trigger.md @@ -91,10 +91,10 @@ ReactDOM.render(, mountNode); } #components-layout-demo-custom-trigger .ant-layout-sider-collapsed .anticon { - font-size: 16px; + font-size: 16px; } #components-layout-demo-custom-trigger .ant-layout-sider-collapsed .nav-text { - display: none; + display: none; } ```` diff --git a/components/layout/demo/side.md b/components/layout/demo/side.md index 32c86ac56a..f5415ca8a4 100644 --- a/components/layout/demo/side.md +++ b/components/layout/demo/side.md @@ -94,10 +94,10 @@ ReactDOM.render(, mountNode); } #components-layout-demo-side .ant-layout-sider-collapsed .anticon { - font-size: 16px; + font-size: 16px; } #components-layout-demo-side .ant-layout-sider-collapsed .nav-text { - display: none; + display: none; } ```` From af9a2cd8fb0b502356ecbc61d7ccb5158bd74f53 Mon Sep 17 00:00:00 2001 From: afc163 Date: Wed, 11 Jan 2017 19:15:16 +0800 Subject: [PATCH 09/85] update modal style --- components/modal/style/modal.less | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/modal/style/modal.less b/components/modal/style/modal.less index 157c3e6f30..97e44ecb77 100644 --- a/components/modal/style/modal.less +++ b/components/modal/style/modal.less @@ -40,7 +40,7 @@ border: 0; background: transparent; position: absolute; - right: 18px; + right: 16px; top: 16px; z-index: 10; font-weight: 700; From b305a9c7e78d789f125ee116a9df21961e37d6be Mon Sep 17 00:00:00 2001 From: VTHINKXIE Date: Wed, 11 Jan 2017 19:21:37 +0800 Subject: [PATCH 10/85] update link of ant.design of angular 2 (#4570) --- docs/spec/introduce.en-US.md | 2 +- docs/spec/introduce.zh-CN.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/spec/introduce.en-US.md b/docs/spec/introduce.en-US.md index 842791e202..0a25f0bff2 100644 --- a/docs/spec/introduce.en-US.md +++ b/docs/spec/introduce.en-US.md @@ -26,9 +26,9 @@ We supply a series of design principles, practical patterns and high quality des [React](http://facebook.github.io/react/) is used to encapsulate a library of Ant Design components. Any other version of frameworks to implement is also welcome. - [Ant Design of React](/docs/react/introduce) (official implementation) +- - - -- - - diff --git a/docs/spec/introduce.zh-CN.md b/docs/spec/introduce.zh-CN.md index 6dc108ef35..710eefb2d1 100644 --- a/docs/spec/introduce.zh-CN.md +++ b/docs/spec/introduce.zh-CN.md @@ -26,9 +26,9 @@ Ant Design 是一个致力于提升『用户』和『设计者』使用体验的 我们采用 [React](http://facebook.github.io/react/) 封装了一套 Ant Design 的组件库,也欢迎社区其他框架的实现版本。 - [Ant Design of React](/docs/react/introduce)(官方实现) +- - - -- - - From 8a2b3470ef77160e177953cbae76aac3c9d35c54 Mon Sep 17 00:00:00 2001 From: Wei Zhu Date: Wed, 11 Jan 2017 19:52:43 +0800 Subject: [PATCH 11/85] Document using Table in TypeScript (#4568) * Allow any valid ReactElement as Table.Column * Document using Table in TypeScript --- components/table/demo/jsx.md | 4 ++++ components/table/index.en-US.md | 34 +++++++++++++++++++++++++++++++++ components/table/index.zh-CN.md | 33 ++++++++++++++++++++++++++++++++ components/table/util.tsx | 7 +------ 4 files changed, 72 insertions(+), 6 deletions(-) diff --git a/components/table/demo/jsx.md b/components/table/demo/jsx.md index 38a52dccfd..61db119738 100644 --- a/components/table/demo/jsx.md +++ b/components/table/demo/jsx.md @@ -9,10 +9,14 @@ title: 使用 JSX 风格的 API(2.5.0 以后引入) +> 这个只是一个描述 `columns` 的语法糖,所以你不能去 compose `Column` 和 `ColumnGroup`。 + ## en-US Using JSX style API (introduced in 2.5.0) +> Since this is just a syntax sugar for the prop `columns`, so that you can't compose `Column` and `ColumnGroup`. + ````jsx import { Table, Icon } from 'antd'; diff --git a/components/table/index.en-US.md b/components/table/index.en-US.md index 2f9da8c1f4..43b9212df0 100644 --- a/components/table/index.en-US.md +++ b/components/table/index.en-US.md @@ -120,6 +120,40 @@ Properties for selection. | onSelect | callback that is called when select/deselect one row | Function(record, selected, selectedRows) | - | | onSelectAll | callback that is called when select/deselect all | Function(selected, selectedRows, changeRows) | - | +## Using in TypeScript + +```jsx +import { Table } from 'antd'; +import { TableColumnConfig } from 'antd/lib/table/Table'; + +interface IUser { + key: number, + name: string; +} + +const columns: TableColumnConfig[] = [{ + key: 'name', + title: 'Name', + dataIndex: 'name', +}]; + +const data: IUser[] = [{ + key: 0, + name: 'Jack', +}]; + +class UserTable extends Table {} + + + +// Use JSX style API +class NameColumn extends Table.Column {} + + + + +``` + ## Note According to [React documentation](http://facebook.github.io/react/docs/multiple-components.html#dynamic-children), every child in array should be assigned a unique key. The value inside `dataSource` and `columns` should follow this in Table, and `dataSource[i].key` would be treated as key value defaultly for `dataSource`. diff --git a/components/table/index.zh-CN.md b/components/table/index.zh-CN.md index 398886fe73..c3bb542dd7 100644 --- a/components/table/index.zh-CN.md +++ b/components/table/index.zh-CN.md @@ -121,6 +121,39 @@ const columns = [{ | onSelect | 用户手动选择/取消选择某列的回调 | Function(record, selected, selectedRows) | - | | onSelectAll | 用户手动选择/取消选择所有列的回调 | Function(selected, selectedRows, changeRows) | - | +## 在 TypeScript 中使用 + +```jsx +import { Table } from 'antd'; +import { TableColumnConfig } from 'antd/lib/table/Table'; + +interface IUser { + key: number, + name: string; +} + +const columns: TableColumnConfig[] = [{ + key: 'name', + title: 'Name', + dataIndex: 'name', +}]; + +const data: IUser[] = [{ + key: 0, + name: 'Jack', +}]; + +class UserTable extends Table {} + + +// 使用 JSX 风格的 API +class NameColumn extends Table.Column {} + + + + +``` + ## 注意 按照 React 的[规范](http://facebook.github.io/react/docs/multiple-components.html#dynamic-children),所有的组件数组必须绑定 key。在 Table 中,`dataSource` 和 `columns` 里的数据值都需要指定 `key` 值。对于 `dataSource` 默认将每列数据的 `key` 属性作为唯一的标识。 diff --git a/components/table/util.tsx b/components/table/util.tsx index ebd1abdb1a..1ebade915f 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 Column from './Column'; import ColumnGroup from './ColumnGroup'; export function flatArray(data: Object[] = [], childrenName = 'children') { @@ -32,7 +31,7 @@ export function treeMap(tree: Object[], mapper: Function, childrenName = 'childr export function normalizeColumns(elements) { const columns: any[] = []; React.Children.forEach(elements, (element: React.ReactElement) => { - if (!isColumnElement(element)) { + if (!React.isValidElement(element)) { return; } const column = assign({}, element.props); @@ -46,7 +45,3 @@ export function normalizeColumns(elements) { }); return columns; } - -function isColumnElement(element) { - return element && (element.type === Column || element.type === ColumnGroup); -} From f978b52ce3956f1957077e36d66a851d703a3bee Mon Sep 17 00:00:00 2001 From: afc163 Date: Wed, 11 Jan 2017 20:08:28 +0800 Subject: [PATCH 12/85] remove blanks --- components/tree/demo/search.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/components/tree/demo/search.md b/components/tree/demo/search.md index 0b3713d6af..373636e082 100644 --- a/components/tree/demo/search.md +++ b/components/tree/demo/search.md @@ -75,14 +75,12 @@ const getParentKey = (key, tree) => { return parentKey; }; - class SearchTree extends React.Component { state = { expandedKeys: [], searchValue: '', autoExpandParent: true, } - onExpand = (expandedKeys) => { this.setState({ expandedKeys, From 65f2d8eb719929f056a8fffc86f3d914e8719d23 Mon Sep 17 00:00:00 2001 From: afc163 Date: Wed, 11 Jan 2017 20:20:38 +0800 Subject: [PATCH 13/85] shorter demo code --- components/tree/demo/search.md | 31 +++++++------------------------ 1 file changed, 7 insertions(+), 24 deletions(-) diff --git a/components/tree/demo/search.md b/components/tree/demo/search.md index 373636e082..60460d137d 100644 --- a/components/tree/demo/search.md +++ b/components/tree/demo/search.md @@ -89,20 +89,14 @@ class SearchTree extends React.Component { } onChange = (e) => { const value = e.target.value; - const expandedKeys = []; - dataList.forEach((item) => { + const expandedKeys = dataList.map((item) => { if (item.key.indexOf(value) > -1) { - expandedKeys.push(getParentKey(item.key, gData)); + return getParentKey(item.key, gData); } - }); - const uniqueExpandedKeys = []; - expandedKeys.forEach((item) => { - if (item && uniqueExpandedKeys.indexOf(item) === -1) { - uniqueExpandedKeys.push(item); - } - }); + return null; + }).filter((item, i, self) => item && self.indexOf(item) === i); this.setState({ - expandedKeys: uniqueExpandedKeys, + expandedKeys, searchValue: value, autoExpandParent: true, }); @@ -116,7 +110,7 @@ class SearchTree extends React.Component { const title = index > -1 ? ( {beforeStr} - {searchValue} + {searchValue} {afterStr} ) : {item.key}; @@ -131,11 +125,7 @@ class SearchTree extends React.Component { }); return (
- + , mountNode); ```` - -````css -.ant-tree-searchable-filter { - color: #f50; - transition: all .3s ease; -} -```` From 1dd5fce3243eb679ce43698464a3e8a1e19d9326 Mon Sep 17 00:00:00 2001 From: afc163 Date: Wed, 11 Jan 2017 21:25:52 +0800 Subject: [PATCH 14/85] ignore lint temp js/jsx files in components --- .eslintignore | 6 ++++++ package.json | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 .eslintignore diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000000..56db29dec0 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,6 @@ +components/**/*.js +components/**/*.jsx +!.eslintrc.js +!components/**/__tests__/* +!components/**/demo/* +!components/**/style/* diff --git a/package.json b/package.json index be319c01a3..190904056b 100644 --- a/package.json +++ b/package.json @@ -141,10 +141,10 @@ "test-all": "./scripts/test-all.sh", "lint": "npm run tslint && npm run eslint && npm run demolint && npm run lesshint", "tslint": "antd-tools run ts-lint && npm run compile && rm -rf lib", - "eslint": "eslint tests site scripts components ./.eslintrc.js ./webpack.config.js --ext '.js,.jsx' --ignore-pattern '!.eslintrc.js'", + "eslint": "eslint tests site scripts components ./.eslintrc.js ./webpack.config.js --ext '.js,.jsx'", "demolint": "RUN_ENV=DEMO eslint components/*/demo/*.md --ext '.md'", "lesshint": "lesshint components -r scripts/lesshint-report.js", - "eslint-fix": "eslint --fix tests site scripts components ./.eslintrc.js ./webpack.config.js --ext '.js,.jsx' --ignore-pattern '!.eslintrc.js' && eslint-tinker ./components/*/demo/*.md", + "eslint-fix": "eslint --fix tests site scripts components ./.eslintrc.js ./webpack.config.js --ext '.js,.jsx' && eslint-tinker ./components/*/demo/*.md", "clean": "antd-tools run clean", "dist": "antd-tools run dist", From 4654db312f30b6a01e52078e6834052ac5256d92 Mon Sep 17 00:00:00 2001 From: afc163 Date: Wed, 11 Jan 2017 21:45:09 +0800 Subject: [PATCH 15/85] Fix some lesshint problems --- .lesshintrc | 3 --- components/carousel/style/index.less | 2 -- components/collapse/style/index.less | 4 ++-- components/form/style/mixin.less | 2 +- components/input/style/mixin.less | 1 - components/mention/style/index.less | 3 +-- components/modal/style/modal.less | 2 +- components/select/style/index.less | 2 -- components/spin/style/index.less | 3 ++- components/style/core/motion/other.less | 1 - components/style/index.less | 2 +- components/style/mixins/clearfix.less | 2 +- components/style/mixins/iconfont.less | 4 ++-- components/style/mixins/index.less | 4 ++-- 14 files changed, 13 insertions(+), 22 deletions(-) diff --git a/.lesshintrc b/.lesshintrc index 8f8d42fa80..7e0de6628e 100644 --- a/.lesshintrc +++ b/.lesshintrc @@ -6,9 +6,6 @@ "importantRule": false, "zeroUnit": "no_unit", "qualifyingElement": false, - "duplicateProperty": false, - "importPath": false, - "finalNewline": false, "newlineAfterBlock": false, "maxCharPerLine": false, "excludedFiles": [ diff --git a/components/carousel/style/index.less b/components/carousel/style/index.less index cef67990b3..c8d8c8eda6 100644 --- a/components/carousel/style/index.less +++ b/components/carousel/style/index.less @@ -24,7 +24,6 @@ &.dragging { cursor: pointer; - cursor: hand; } } .slick-slider .slick-track, @@ -165,7 +164,6 @@ outline: none; font-size: 0; color: transparent; - cursor: pointer; transition: all .3s; &:hover, &:focus { diff --git a/components/collapse/style/index.less b/components/collapse/style/index.less index 0bbbc3a055..61e7f56c5e 100644 --- a/components/collapse/style/index.less +++ b/components/collapse/style/index.less @@ -39,8 +39,8 @@ transition: transform 0.24s ease; top: 0; left: 16px; - top: ~"16px \9"; - left: ~"0 \9"; + top: ~"16px \9"; // lesshint duplicateProperty: false + left: ~"0 \9"; // lesshint duplicateProperty: false &:before { content: "\e606"; } diff --git a/components/form/style/mixin.less b/components/form/style/mixin.less index 0f0bc1de12..9c91a1508d 100644 --- a/components/form/style/mixin.less +++ b/components/form/style/mixin.less @@ -87,7 +87,7 @@ input[type="radio"]:focus, input[type="checkbox"]:focus { outline: thin dotted; - outline: 5px auto -webkit-focus-ring-color; // lesshint spaceAroundOperator: false + outline: 5px auto -webkit-focus-ring-color; // lesshint duplicateProperty: false outline-offset: -2px; } diff --git a/components/input/style/mixin.less b/components/input/style/mixin.less index b454216c99..e9d6ec3ecf 100644 --- a/components/input/style/mixin.less +++ b/components/input/style/mixin.less @@ -152,7 +152,6 @@ .@{ant-prefix}-select-selection { background-color: inherit; - border: 0; margin: -1px; border: 1px solid transparent; box-shadow: none; diff --git a/components/mention/style/index.less b/components/mention/style/index.less index 4823a92754..4d7917d1ce 100644 --- a/components/mention/style/index.less +++ b/components/mention/style/index.less @@ -1,6 +1,6 @@ @import "../../style/themes/default"; @import "../../style/mixins/index"; -@import '../../input/style/mixin.less'; +@import '../../input/style/mixin'; .@{ant-prefix}-mention-wrapper { position: relative; @@ -70,7 +70,6 @@ color: @text-color; white-space: nowrap; cursor: pointer; - white-space: nowrap; text-overflow: ellipsis; overflow: hidden; transition: background 0.3s ease; diff --git a/components/modal/style/modal.less b/components/modal/style/modal.less index 97e44ecb77..01cb6f4bd3 100644 --- a/components/modal/style/modal.less +++ b/components/modal/style/modal.less @@ -115,7 +115,7 @@ left: 0; bottom: 0; background-color: #373737; - background-color: rgba(55, 55, 55, 0.6); + background-color: rgba(55, 55, 55, 0.6); // lesshint duplicateProperty: false height: 100%; z-index: @zindex-modal-mask; filter: ~"alpha(opacity=50)"; diff --git a/components/select/style/index.less b/components/select/style/index.less index 1c20b66a27..fd53870fba 100644 --- a/components/select/style/index.less +++ b/components/select/style/index.less @@ -299,7 +299,6 @@ border-radius: 4px; cursor: default; float: left; - padding: 0 16px; margin-right: 4px; max-width: 99%; position: relative; @@ -444,7 +443,6 @@ color: @text-color; white-space: nowrap; cursor: pointer; - white-space: nowrap; overflow: hidden; transition: background 0.3s ease; diff --git a/components/spin/style/index.less b/components/spin/style/index.less index 075febe778..ed20005020 100644 --- a/components/spin/style/index.less +++ b/components/spin/style/index.less @@ -77,7 +77,8 @@ opacity: 0.7; -webkit-filter: blur(1px); filter: blur(1px); - filter: ~"progid\:DXImageTransform\.Microsoft\.Blur(PixelRadius\=1, MakeShadow\=false)"; /* IE6~IE9 */ + /* IE6~IE9 */ + filter: ~"progid\:DXImageTransform\.Microsoft\.Blur(PixelRadius\=1, MakeShadow\=false)"; // lesshint duplicateProperty: false &:after { content: ''; position: absolute; diff --git a/components/style/core/motion/other.less b/components/style/core/motion/other.less index 837b7a12b9..f90f0912ba 100644 --- a/components/style/core/motion/other.less +++ b/components/style/core/motion/other.less @@ -8,4 +8,3 @@ transform: rotate(360deg); } } - diff --git a/components/style/index.less b/components/style/index.less index ce4b88c3d7..a33fdfc3aa 100644 --- a/components/style/index.less +++ b/components/style/index.less @@ -1,2 +1,2 @@ @import "./themes/default"; -@import "./core/index.less"; +@import "./core/index"; diff --git a/components/style/mixins/clearfix.less b/components/style/mixins/clearfix.less index bf39fbdb26..d5bbf76707 100644 --- a/components/style/mixins/clearfix.less +++ b/components/style/mixins/clearfix.less @@ -13,4 +13,4 @@ font-size: 0; height: 0; } -} \ No newline at end of file +} diff --git a/components/style/mixins/iconfont.less b/components/style/mixins/iconfont.less index d07ca4a479..cb85ddb51b 100644 --- a/components/style/mixins/iconfont.less +++ b/components/style/mixins/iconfont.less @@ -4,7 +4,6 @@ vertical-align: baseline; text-align: center; text-transform: none; - text-rendering: auto; line-height: 1; text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased; @@ -29,7 +28,8 @@ display: inline-block; @font-scale: unit(@size / 12px); font-size: @font-size-base; - font-size: ~"@{size} \9"; // ie8-9 + // ie8-9 + font-size: ~"@{size} \9"; // lesshint duplicateProperty: false transform: scale(@font-scale) rotate(@rotate); .ie-rotate-via-degrees(@rotate); :root & { diff --git a/components/style/mixins/index.less b/components/style/mixins/index.less index 17b465cc0b..c331b159fb 100644 --- a/components/style/mixins/index.less +++ b/components/style/mixins/index.less @@ -1,7 +1,7 @@ // Mixins // -------------------------------------------------- -@import "opacity.less"; -@import "size.less"; +@import "opacity"; +@import "size"; @import "compatibility"; @import "clearfix"; @import "iconfont"; From 0ff50fc79d8d2c72d7bc1a6dd73b79af35692db6 Mon Sep 17 00:00:00 2001 From: Wei Zhu Date: Thu, 12 Jan 2017 00:03:35 +0800 Subject: [PATCH 16/85] docs: Update Table JSX api note --- components/table/demo/jsx.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/table/demo/jsx.md b/components/table/demo/jsx.md index 61db119738..5e4d748478 100644 --- a/components/table/demo/jsx.md +++ b/components/table/demo/jsx.md @@ -9,13 +9,13 @@ title: 使用 JSX 风格的 API(2.5.0 以后引入) -> 这个只是一个描述 `columns` 的语法糖,所以你不能去 compose `Column` 和 `ColumnGroup`。 +> 这个只是一个描述 `columns` 的语法糖,所以你不能用其他组件去包裹 `Column` 和 `ColumnGroup`。 ## en-US Using JSX style API (introduced in 2.5.0) -> Since this is just a syntax sugar for the prop `columns`, so that you can't compose `Column` and `ColumnGroup`. +> Since this is just a syntax sugar for the prop `columns`, so that you can't compose `Column` and `ColumnGroup` with other Components. ````jsx import { Table, Icon } from 'antd'; From 477fde8b7f02f45eaecaee28538a971702bcf7a9 Mon Sep 17 00:00:00 2001 From: Tao Zhang Date: Wed, 11 Jan 2017 19:09:59 -0600 Subject: [PATCH 17/85] docs: Updated form description (#4574) --- components/form/index.zh-CN.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/form/index.zh-CN.md b/components/form/index.zh-CN.md index 8440dbad65..137888c90a 100644 --- a/components/form/index.zh-CN.md +++ b/components/form/index.zh-CN.md @@ -13,7 +13,7 @@ title: Form 我们为 `form` 提供了以下两种排列方式: - 水平排列:标签和表单控件水平排列;(默认) -- 水质排列:标签和表单控件上下垂直排列; +- 垂直排列:标签和表单控件上下垂直排列; - 行内排列:表单项水平行内排列。 ## 表单域 From c01ee02758cac27a1b397def835e28e2bd2c605a Mon Sep 17 00:00:00 2001 From: wallverb Date: Wed, 11 Jan 2017 20:23:56 -0500 Subject: [PATCH 18/85] chore: Change AutoCompleteProps to extend SelectProps (#4565) * Change AutoCompleteProps to extend SelectProps * Extract common props into AbstractSelectProps --- components/auto-complete/index.tsx | 15 +++------------ components/select/index.tsx | 27 +++++++++++++++------------ 2 files changed, 18 insertions(+), 24 deletions(-) diff --git a/components/auto-complete/index.tsx b/components/auto-complete/index.tsx index 6600a32503..3b39934617 100755 --- a/components/auto-complete/index.tsx +++ b/components/auto-complete/index.tsx @@ -1,5 +1,5 @@ import React from 'react'; -import Select, { OptionProps, OptGroupProps } from '../select'; +import Select, { AbstractSelectProps, OptionProps, OptGroupProps } from '../select'; import { Option, OptGroup } from 'rc-select'; import classNames from 'classnames'; @@ -11,21 +11,12 @@ export interface SelectedValue { export interface DataSourceItemObject { value: string; text: string; }; export type DataSourceItemType = string | DataSourceItemObject; -export interface AutoCompleteProps { - size?: 'large' | 'small' | 'default'; - className?: string; - notFoundContent?: Element; +export interface AutoCompleteProps extends AbstractSelectProps { dataSource: DataSourceItemType[]; - prefixCls?: string; - transitionName?: string; - optionLabelProp?: string; - choiceTransitionName?: string; - showSearch?: boolean; defaultValue?: string | Array | SelectedValue | Array; value?: string | Array | SelectedValue | Array; - allowClear?: boolean; onChange?: (value: string | Array | SelectedValue | Array) => void; - disabled?: boolean; + onSelect?: (value: string | Array | SelectedValue | Array, option: Object) => any; } export default class AutoComplete extends React.Component { diff --git a/components/select/index.tsx b/components/select/index.tsx index ee08af2430..90aa388036 100755 --- a/components/select/index.tsx +++ b/components/select/index.tsx @@ -6,33 +6,36 @@ import classNames from 'classnames'; export type SelectValue = string | any[] | { key: string, label: React.ReactNode } | Array<{ key: string, label: React.ReactNode }>; -export interface SelectProps { - prefixCls?: string; +export interface AbstractSelectProps { + size?: 'default' | 'large' | 'small'; className?: string; + notFoundContent?: React.ReactNode | null; + prefixCls?: string; + transitionName?: string; + optionLabelProp?: string; + choiceTransitionName?: string; + showSearch?: boolean; + allowClear?: boolean; + disabled?: boolean; + style?: React.CSSProperties; + placeholder?: string; +} + +export interface SelectProps extends AbstractSelectProps { value?: SelectValue; defaultValue?: SelectValue; - size?: 'default' | 'large' | 'small'; combobox?: boolean; - notFoundContent?: React.ReactNode | null; - showSearch?: boolean; - transitionName?: string; - choiceTransitionName?: string; multiple?: boolean; - allowClear?: boolean; filterOption?: boolean | ((inputValue: string, option: Object) => any); tags?: boolean; onSelect?: (value: SelectValue, option: Object) => any; onDeselect?: (value: SelectValue) => any; onSearch?: (value: string) => any; - placeholder?: string; dropdownMatchSelectWidth?: boolean; optionFilterProp?: string; - optionLabelProp?: string; - disabled?: boolean; defaultActiveFirstOption?: boolean; labelInValue?: boolean; getPopupContainer?: (triggerNode: React.ReactNode) => React.ReactNode | HTMLElement; - style?: React.CSSProperties; dropdownStyle?: React.CSSProperties; dropdownMenuStyle?: React.CSSProperties; onChange?: (value: SelectValue) => void; From 97221a6f63436d7afc49e9f4491f8074b17bdf15 Mon Sep 17 00:00:00 2001 From: Benjy Cui Date: Thu, 12 Jan 2017 10:35:17 +0800 Subject: [PATCH 19/85] css: fix style issue, close: #4415 --- components/date-picker/style/Calendar.less | 5 +---- components/date-picker/style/DecadePanel.less | 11 +---------- components/date-picker/style/RangePicker.less | 3 ++- components/date-picker/style/TimePicker.less | 1 - components/date-picker/style/YearPanel.less | 11 +---------- package.json | 2 +- 6 files changed, 6 insertions(+), 27 deletions(-) diff --git a/components/date-picker/style/Calendar.less b/components/date-picker/style/Calendar.less index fc4d8c9fd5..7b25a53dbc 100644 --- a/components/date-picker/style/Calendar.less +++ b/components/date-picker/style/Calendar.less @@ -238,11 +238,8 @@ border-bottom-right-radius: 4px; } - &-footer { - border-top: 1px solid @border-color-split; - } - &-footer-btn { + border-top: 1px solid @border-color-split; text-align: center; display: block; line-height: 38px; diff --git a/components/date-picker/style/DecadePanel.less b/components/date-picker/style/DecadePanel.less index fb0cab48b6..8dd0a9a202 100644 --- a/components/date-picker/style/DecadePanel.less +++ b/components/date-picker/style/DecadePanel.less @@ -62,15 +62,6 @@ .@{calendar-prefix-cls}-decade-panel-next-century-cell { .@{calendar-prefix-cls}-decade-panel-decade { user-select: none; - } - .@{calendar-prefix-cls}-decade-panel-decade:before { - content: "\e61f"; - font-family: "anticon" !important; - } -} - -.@{calendar-prefix-cls}-decade-panel-last-century-cell { - .@{calendar-prefix-cls}-decade-panel-decade:before { - content: "\e620"; + color: @disabled-color; } } diff --git a/components/date-picker/style/RangePicker.less b/components/date-picker/style/RangePicker.less index 472479456d..46a9905216 100644 --- a/components/date-picker/style/RangePicker.less +++ b/components/date-picker/style/RangePicker.less @@ -149,10 +149,11 @@ } } + // `div` for selector specificity div&-quick-selector { display: block; text-align: left; - border-bottom: 1px solid @border-color-split; + border-top: 1px solid @border-color-split; padding: 10.5px 10px; > a { diff --git a/components/date-picker/style/TimePicker.less b/components/date-picker/style/TimePicker.less index bc26f53628..1ee9caa0a9 100644 --- a/components/date-picker/style/TimePicker.less +++ b/components/date-picker/style/TimePicker.less @@ -128,7 +128,6 @@ } .@{calendar-prefix-cls}-footer { - border-top: 1px solid @border-color-split; text-align: right; position: relative; height: auto; diff --git a/components/date-picker/style/YearPanel.less b/components/date-picker/style/YearPanel.less index dd3d0add6b..68ea94a32a 100644 --- a/components/date-picker/style/YearPanel.less +++ b/components/date-picker/style/YearPanel.less @@ -61,15 +61,6 @@ .@{calendar-prefix-cls}-year-panel-next-decade-cell { .@{calendar-prefix-cls}-year-panel-year { user-select: none; - } - .@{calendar-prefix-cls}-year-panel-year:before { - content: "\e61f"; - font-family: "anticon" !important; - } -} - -.@{calendar-prefix-cls}-year-panel-last-decade-cell { - .@{calendar-prefix-cls}-year-panel-year:before { - content: "\e620"; + color: @disabled-color; } } diff --git a/package.json b/package.json index 190904056b..a697efec2e 100644 --- a/package.json +++ b/package.json @@ -41,7 +41,7 @@ "object-assign": "~4.1.0", "omit.js": "^0.1.0", "rc-animate": "~2.3.0", - "rc-calendar": "~7.5.1", + "rc-calendar": "~7.6.0", "rc-cascader": "~0.10.1", "rc-checkbox": "~1.4.0", "rc-collapse": "~1.6.4", From 75c0ade1cecc8debe4ed10ac94b8b0e603d94929 Mon Sep 17 00:00:00 2001 From: Benjy Cui Date: Thu, 12 Jan 2017 10:38:14 +0800 Subject: [PATCH 20/85] test: update snapshot --- components/tree/__tests__/__snapshots__/demo.test.js.snap | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/components/tree/__tests__/__snapshots__/demo.test.js.snap b/components/tree/__tests__/__snapshots__/demo.test.js.snap index 9d57655019..01ce91b3d9 100644 --- a/components/tree/__tests__/__snapshots__/demo.test.js.snap +++ b/components/tree/__tests__/__snapshots__/demo.test.js.snap @@ -527,7 +527,7 @@ exports[`test renders ./components/tree/demo/search.md correctly 1`] = `
+ style="width:300px;"> + style="color:#f50;" /> 0-0 @@ -570,7 +570,7 @@ exports[`test renders ./components/tree/demo/search.md correctly 1`] = ` class="ant-tree-title"> + style="color:#f50;" /> 0-1 @@ -587,7 +587,7 @@ exports[`test renders ./components/tree/demo/search.md correctly 1`] = ` class="ant-tree-title"> + style="color:#f50;" /> 0-2 From 6a015f00e6be37f09d9c376f2b61c286128dd1d5 Mon Sep 17 00:00:00 2001 From: afc163 Date: Thu, 12 Jan 2017 13:57:35 +0800 Subject: [PATCH 21/85] upgrade @types/react --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index a697efec2e..a1b5092a29 100644 --- a/package.json +++ b/package.json @@ -74,7 +74,7 @@ "warning": "~3.0.0" }, "devDependencies": { - "@types/react": "~0.14.41", + "@types/react": "^15.0.0", "@types/react-dom": "~0.14.18", "antd-demo-jest": "^1.0.5", "antd-tools": "~0.16.0", From ff67c6eee6f0935f14337ee2969b80289c4129c6 Mon Sep 17 00:00:00 2001 From: Benjy Cui Date: Thu, 12 Jan 2017 17:57:04 +0800 Subject: [PATCH 22/85] docs: add documentation of third-party and awesomeness (#4559) * docs: add documentation of third-party and awesomeness * docs: merge install.md into introduce.md * docs: update recommendation components list --- CHANGELOG.en-US.md | 2 +- CHANGELOG.zh-CN.md | 2 +- docs/react/awesome-ant-design.md | 5 +++ docs/react/install.en-US.md | 66 ------------------------------ docs/react/install.zh-CN.md | 66 ------------------------------ docs/react/introduce.en-US.md | 62 +++++++++++++++++++++++----- docs/react/introduce.zh-CN.md | 62 +++++++++++++++++++++++----- docs/react/recommendation.en-US.md | 15 +++++++ docs/react/recommendation.zh-CN.md | 15 +++++++ 9 files changed, 139 insertions(+), 156 deletions(-) create mode 100644 docs/react/awesome-ant-design.md delete mode 100644 docs/react/install.en-US.md delete mode 100644 docs/react/install.zh-CN.md create mode 100644 docs/react/recommendation.en-US.md create mode 100644 docs/react/recommendation.zh-CN.md diff --git a/CHANGELOG.en-US.md b/CHANGELOG.en-US.md index 196a6d5288..88246f6f0c 100644 --- a/CHANGELOG.en-US.md +++ b/CHANGELOG.en-US.md @@ -1,5 +1,5 @@ --- -order: 6 +order: 9 title: Change Log toc: false timeline: true diff --git a/CHANGELOG.zh-CN.md b/CHANGELOG.zh-CN.md index 2c345dc564..7fe83a5934 100644 --- a/CHANGELOG.zh-CN.md +++ b/CHANGELOG.zh-CN.md @@ -1,5 +1,5 @@ --- -order: 6 +order: 9 title: 更新日志 toc: false timeline: true diff --git a/docs/react/awesome-ant-design.md b/docs/react/awesome-ant-design.md new file mode 100644 index 0000000000..0592543375 --- /dev/null +++ b/docs/react/awesome-ant-design.md @@ -0,0 +1,5 @@ +--- +order: 8 +title: Awesome Ant Design +link: https://github.com/websemantics/awesome-ant-design +--- diff --git a/docs/react/install.en-US.md b/docs/react/install.en-US.md deleted file mode 100644 index 8e9e93efca..0000000000 --- a/docs/react/install.en-US.md +++ /dev/null @@ -1,66 +0,0 @@ ---- -order: 2 -title: Installation ---- - -## Using npm to install - -**We recommend using npm to install**,it not only makes development easier,but you can also take advantage of the whole ecosystem. - -If using npm to install, you could use `import` or `require`. - -Stable version: - -[![npm package](https://img.shields.io/npm/v/antd.svg?style=flat-square)](https://www.npmjs.org/package/antd) - -```bash -$ npm install antd --save -``` - -You can subscribe to this feed for new version notification: https://github.com/ant-design/ant-design/releases.atom - -Beta version: - -[![](https://cnpmjs.org/badge/v/antd.svg?&tag=beta&subject=npm)](https://www.npmjs.org/package/antd) - -```bash -$ npm install antd@beta --save -``` - -## Import in Browser - -[![CDNJS](https://img.shields.io/cdnjs/v/antd.svg?style=flat-square)](https://cdnjs.com/libraries/antd) - -We provide `antd.js` `antd.css` and `antd.min.js` `antd.min.css` under `antd/dist` in antd's npm package, in order to import all the components of antd directly. Also, you can use [unpkg](https://unpkg.com/). - -> It's not recommended to use the already built files, as you cannot get bugfixes from the dependencies of antd. - -#### stable - -- https://unpkg.com/antd/dist/antd.js -- https://unpkg.com/antd/dist/antd.css -- https://unpkg.com/antd/dist/antd.min.js -- https://unpkg.com/antd/dist/antd.min.css - -#### beta - -- https://unpkg.com/antd@beta/dist/antd.js -- https://unpkg.com/antd@beta/dist/antd.css -- https://unpkg.com/antd@beta/dist/antd.min.js -- https://unpkg.com/antd@beta/dist/antd.min.css - -> Here is an [example](https://github.com/ant-design/antd-init/tree/master/examples/build-antd-standalone) of how to build your own antd.js if you are using antd@<1.0.0. - -## Development tool - -We provide React components [Scaffold tool](https://github.com/dvajs/dva-cli). - -```bash -$ npm install dva-cli -g -``` - -Run `dva new myapp` to init a React application. - -You can explore the latest structure of scaffold [here](https://github.com/dvajs/dva-cli/tree/master/boilerplates), it is a good habit to watch this repo to get the latest features. - -> [More development tool features](https://github.com/sorrycc/roadhog)。 diff --git a/docs/react/install.zh-CN.md b/docs/react/install.zh-CN.md deleted file mode 100644 index 74244c4155..0000000000 --- a/docs/react/install.zh-CN.md +++ /dev/null @@ -1,66 +0,0 @@ ---- -order: 2 -title: 安装 ---- - -## 使用 npm 安装 - -**我们推荐使用 npm 的方式进行开发**,不仅可在开发环境轻松调试,也可放心地在生产环境打包部署使用,享受整个生态圈和工具链带来的诸多好处。 - -可以通过 npm 直接安装到项目中,使用 `import` 或 `require` 进行引用。 - -稳定版: - -[![npm package](https://img.shields.io/npm/v/antd.svg?style=flat-square)](https://www.npmjs.org/package/antd) - -```bash -$ npm install antd --save -``` - -你可以订阅:https://github.com/ant-design/ant-design/releases.atom 来获得稳定版发布的通知。 - -开发版本: - -[![](https://cnpmjs.org/badge/v/antd.svg?&tag=beta&subject=npm)](https://www.npmjs.org/package/antd) - -```bash -$ npm install antd@beta --save -``` - -## 浏览器引入 - -[![CDNJS](https://img.shields.io/cdnjs/v/antd.svg?style=flat-square)](https://cdnjs.com/libraries/antd) - -我们在 npm 发布包内的 `antd/dist` 目录下提供了 `antd.js` `antd.css` 以及 `antd.min.js` `antd.min.css` 用于一次性引入所有的 antd 组件,也可以通过 [UNPKG](https://unpkg.com/) 进行下载。 - -> 不推荐使用构建文件,因为难以获得底层依赖模块的 bug 快速修复支持。 - -#### stable - -- https://unpkg.com/antd/dist/antd.js -- https://unpkg.com/antd/dist/antd.css -- https://unpkg.com/antd/dist/antd.min.js -- https://unpkg.com/antd/dist/antd.min.css - -#### beta - -- https://unpkg.com/antd@beta/dist/antd.js -- https://unpkg.com/antd@beta/dist/antd.css -- https://unpkg.com/antd@beta/dist/antd.min.js -- https://unpkg.com/antd@beta/dist/antd.min.css - -> 对于 1.0 之前的版本,这里有一个 [自行构建的例子](https://github.com/ant-design/antd-init/tree/master/examples/build-antd-standalone) 以供参考。 - -## 开发工具 - -我们提供了 React 前端应用开发的 [脚手架工具](https://github.com/dvajs/dva-cli),可以安装到全局直接使用。 - -```bash -$ npm install dva-cli -g -``` - -运行 `dva new myapp` 可以初始化一个 React 的前端应用。 - -最新的脚手架结构可以到这里 [查看](https://github.com/dvajs/dva-cli/tree/master/boilerplates),建议持续关注更新以便获得最新的开发工程特性。 - -> 更多开发工具的[特性](https://github.com/sorrycc/roadhog)。 diff --git a/docs/react/introduce.en-US.md b/docs/react/introduce.en-US.md index 3cbcaf8572..6bada141ee 100644 --- a/docs/react/introduce.en-US.md +++ b/docs/react/introduce.en-US.md @@ -31,12 +31,63 @@ Following Ant Design specification, We develop a React UI library `antd` that co - It is a set of high quality UI components and based on [React Component](http://react-component.github.io/badgeboard/). - Provides a work flow which is based on npm, webpack, and babel, supporting ES2015 and TypeScript. +## Compatibility + +Modern browsers and IE9+. + +> [IE8 issues](https://github.com/xcatliu/react-ie8) + +## Version + +- Stable: [![npm package](https://img.shields.io/npm/v/antd.svg?style=flat-square)](https://www.npmjs.org/package/antd) +- Beta: [![](https://cnpmjs.org/badge/v/antd.svg?&tag=beta&subject=npm)](https://www.npmjs.org/package/antd) + +You can subscribe to this feed for new version notification: https://github.com/ant-design/ant-design/releases.atom + ## Installation +### Using npm to install + +**We recommend using npm to install**,it not only makes development easier,but you can also take advantage of the whole ecosystem. + +If using npm to install, you could use `import` or `require`. + +Stable version: + ```bash $ npm install antd --save ``` +Beta version: + +```bash +$ npm install antd@beta --save +``` + +### Import in Browser + +[![CDNJS](https://img.shields.io/cdnjs/v/antd.svg?style=flat-square)](https://cdnjs.com/libraries/antd) + +We provide `antd.js` `antd.css` and `antd.min.js` `antd.min.css` under `antd/dist` in antd's npm package, in order to import all the components of antd directly. Also, you can use [unpkg](https://unpkg.com/). + +> It's not recommended to use the already built files, as you cannot get bugfixes from the dependencies of antd. + +#### stable + +- https://unpkg.com/antd/dist/antd.js +- https://unpkg.com/antd/dist/antd.css +- https://unpkg.com/antd/dist/antd.min.js +- https://unpkg.com/antd/dist/antd.min.css + +#### beta + +- https://unpkg.com/antd@beta/dist/antd.js +- https://unpkg.com/antd@beta/dist/antd.css +- https://unpkg.com/antd@beta/dist/antd.min.js +- https://unpkg.com/antd@beta/dist/antd.min.css + +> Here is an [example](https://github.com/ant-design/antd-init/tree/master/examples/build-antd-standalone) of how to build your own antd.js if you are using antd@<1.0.0. + ## Usage ### Use prebuilt bundle @@ -77,17 +128,6 @@ import 'antd/dist/antd.css'; // or 'antd/dist/antd.less' import 'antd/lib/date-picker/style/css'; // with style ``` -## Version - -- Stable: [![npm package](https://img.shields.io/npm/v/antd.svg?style=flat-square)](https://www.npmjs.org/package/antd) -- Beta: [![](https://cnpmjs.org/badge/v/antd.svg?&tag=beta&subject=npm)](https://www.npmjs.org/package/antd) - -## Compatibility - -Modern browsers and IE9+. - -> [IE8 issues](https://github.com/xcatliu/react-ie8) - ## Useful Links - [Home page](http://ant.design/) diff --git a/docs/react/introduce.zh-CN.md b/docs/react/introduce.zh-CN.md index 2a9d7f8020..95a70138ba 100644 --- a/docs/react/introduce.zh-CN.md +++ b/docs/react/introduce.zh-CN.md @@ -31,12 +31,63 @@ title: Ant Design of React - [React Component](http://react-component.github.io/badgeboard/) 基础上精心封装的高质量 UI 组件。 - 基于 npm + webpack + babel 的工作流,支持 ES2015 和 TypeScript。 +## 浏览器支持 + +现代浏览器和 IE9 及以上。 + +> [IE8 issues](https://github.com/xcatliu/react-ie8) + +## 版本 + +- 稳定版:[![npm package](https://img.shields.io/npm/v/antd.svg?style=flat-square)](https://www.npmjs.org/package/antd) +- 开发版:[![](https://cnpmjs.org/badge/v/antd.svg?&tag=beta&subject=npm)](https://www.npmjs.org/package/antd) + +你可以订阅:https://github.com/ant-design/ant-design/releases.atom 来获得稳定版发布的通知。 + ## 安装 +### 使用 npm 安装 + +**我们推荐使用 npm 的方式进行开发**,不仅可在开发环境轻松调试,也可放心地在生产环境打包部署使用,享受整个生态圈和工具链带来的诸多好处。 + +可以通过 npm 直接安装到项目中,使用 `import` 或 `require` 进行引用。 + +稳定版: + ```bash $ npm install antd --save ``` +开发版本: + +```bash +$ npm install antd@beta --save +``` + +### 浏览器引入 + +[![CDNJS](https://img.shields.io/cdnjs/v/antd.svg?style=flat-square)](https://cdnjs.com/libraries/antd) + +我们在 npm 发布包内的 `antd/dist` 目录下提供了 `antd.js` `antd.css` 以及 `antd.min.js` `antd.min.css` 用于一次性引入所有的 antd 组件,也可以通过 [UNPKG](https://unpkg.com/) 进行下载。 + +> 不推荐使用构建文件,因为难以获得底层依赖模块的 bug 快速修复支持。 + +#### stable + +- https://unpkg.com/antd/dist/antd.js +- https://unpkg.com/antd/dist/antd.css +- https://unpkg.com/antd/dist/antd.min.js +- https://unpkg.com/antd/dist/antd.min.css + +#### beta + +- https://unpkg.com/antd@beta/dist/antd.js +- https://unpkg.com/antd@beta/dist/antd.css +- https://unpkg.com/antd@beta/dist/antd.min.js +- https://unpkg.com/antd@beta/dist/antd.min.css + +> 对于 1.0 之前的版本,这里有一个 [自行构建的例子](https://github.com/ant-design/antd-init/tree/master/examples/build-antd-standalone) 以供参考。 + ## 示例 ```jsx @@ -57,17 +108,6 @@ import 'antd/dist/antd.css'; // or 'antd/dist/antd.less' > babel-plugin-import 支持 js 和 css 同时按需加载。 -## 版本 - -- 稳定版:[![npm package](https://img.shields.io/npm/v/antd.svg?style=flat-square)](https://www.npmjs.org/package/antd) -- 开发版:[![](https://cnpmjs.org/badge/v/antd.svg?&tag=beta&subject=npm)](https://www.npmjs.org/package/antd) - -## 浏览器支持 - -现代浏览器和 IE9 及以上。 - -> [IE8 issues](https://github.com/xcatliu/react-ie8) - ## 链接 - [首页](http://ant.design/) diff --git a/docs/react/recommendation.en-US.md b/docs/react/recommendation.en-US.md new file mode 100644 index 0000000000..86c7b63fd5 --- /dev/null +++ b/docs/react/recommendation.en-US.md @@ -0,0 +1,15 @@ +--- +order: 7 +title: Third-Party Library +--- + +`antd` is designed to provide high-quality React UI components which following Ant Design Specification. So, we are not going to implement other functions which are not relative to `antd`'s target, and recommend to use excellent third-party library which are provided by React community: + +* **Router: ** [react-router](https://github.com/ReactTraining/react-router) +* **Layout: ** [react-blocks](http://whoisandie.github.io/react-blocks/) +* **Drag and drop: ** [react-dnd](https://github.com/gaearon/react-dnd) +* **Editor: ** [react-codemirror](https://github.com/JedWatson/react-codemirror) +* **Color Picker: ** [rc-color-picker](https://github.com/react-component/color-picker), [react-color](http://casesandberg.github.io/react-color/) +* **Media Query: ** [react-responsive](https://github.com/contra/react-responsive), [react-media](https://github.com/ReactTraining/react-media) +* **Copy to clipboard: ** [react-copy-to-clipboard](https://github.com/nkbt/react-copy-to-clipboard) +* **Document head manager: ** [react-helmet](https://github.com/nfl/react-helmet) diff --git a/docs/react/recommendation.zh-CN.md b/docs/react/recommendation.zh-CN.md new file mode 100644 index 0000000000..1f9a689df4 --- /dev/null +++ b/docs/react/recommendation.zh-CN.md @@ -0,0 +1,15 @@ +--- +order: 7 +title: 社区精选组件 +--- + +`antd` 是 Ant Design 设计规范的 React 实现,所以我们倾向于只提供符合该规范、且带有视觉展现的 UI 组件,也尽量不重复造轮子。我们推荐使用以下社区已有的优秀实现,与 antd 形成互补: + +* **路由:** [react-router](https://github.com/ReactTraining/react-router) +* **布局:** [react-blocks](http://whoisandie.github.io/react-blocks/) +* **拖拽:** [react-dnd](https://github.com/gaearon/react-dnd) +* **编辑器:** [react-codemirror](https://github.com/JedWatson/react-codemirror) +* **拾色器:** [rc-color-picker](https://github.com/react-component/color-picker)、[react-color](http://casesandberg.github.io/react-color/) +* **Media Query:** [react-responsive](https://github.com/contra/react-responsive)、[react-media](https://github.com/ReactTraining/react-media) +* **复制到剪贴板:** [react-copy-to-clipboard](https://github.com/nkbt/react-copy-to-clipboard) +* **管理 document head:** [react-helmet](https://github.com/nfl/react-helmet) From de544ad21bbab9b085cfdd6459d317f181416c32 Mon Sep 17 00:00:00 2001 From: afc163 Date: Thu, 12 Jan 2017 20:38:20 +0800 Subject: [PATCH 23/85] fix useless className --- components/table/__tests__/__snapshots__/demo.test.js.snap | 2 +- components/table/demo/expand.md | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/components/table/__tests__/__snapshots__/demo.test.js.snap b/components/table/__tests__/__snapshots__/demo.test.js.snap index d596ea15dd..bb85d600d7 100644 --- a/components/table/__tests__/__snapshots__/demo.test.js.snap +++ b/components/table/__tests__/__snapshots__/demo.test.js.snap @@ -2155,7 +2155,7 @@ exports[`test renders ./components/table/demo/edit-row.md correctly 1`] = ` exports[`test renders ./components/table/demo/expand.md correctly 1`] = `
+ class=" clearfix">

{record.description}

} dataSource={data} - className="table" /> , mountNode); ```` From d01395239896457c15a9ee30964e453159c5d801 Mon Sep 17 00:00:00 2001 From: afc163 Date: Thu, 12 Jan 2017 21:51:40 +0800 Subject: [PATCH 24/85] remove unused doc --- docs/spec/colors.md | 130 ++++---------------------------------------- 1 file changed, 11 insertions(+), 119 deletions(-) diff --git a/docs/spec/colors.md b/docs/spec/colors.md index 2755f06299..bfddea4f27 100644 --- a/docs/spec/colors.md +++ b/docs/spec/colors.md @@ -8,15 +8,22 @@ title: en-US: Colors --- -## 有意义的色彩 +设计中对色彩的运用不仅应考虑品牌的识别性,还需达到信息传递、操作指引、交互反馈,或是强化和凸显某一个元素的目的。基于操作系统更注重高效、清晰等特点,Ant Design 的用色上更偏向简洁实用一些。在选择色彩时有以下三个注意点: -色彩在界面设计中的使用应同时具备品牌识别性以及界面设计功能性。色彩是相当感性的东西,设计中对色彩的运用首要应考虑到品牌层面的表达,另外很重要的一点是色彩的运用应达到信息传递,动作指引,交互反馈,或是强化和凸现某一个元素的目的。任何颜色的选取和使用应该是有意义的。 +- 色彩应与产品定位相匹配,且符合用户心理认知; +- 视觉层次应清晰分明,为重要行动点或关键信息定义一个主色,并建立视觉连续性; +- 遵守 WCAG 2.0 的 标准,保证足够的对比度,让色彩更容易被视障碍(色盲)用户识别。 ## Ant Design Colors -Ant Design 的色板由 8 种基本色彩组成,通过一套[精心设计的色彩算法](https://github.com/ant-design/ant-design/blob/734beb84ffc3f0469fbae1566aa8450f966cb261/components/style/color/colorPalette.less),每种基本色又自动衍生出 10 种渐变色,其中第 6 种为基本色。 +Ant Design PC 端的色板由 10 个由浅至深的色彩单元格组成,我们为部分色彩格定义了默认使用场景,用户在进行色彩配色时只需根据关键词选择一条色板即可得到一套完整的系统配色方案。在理论上,在 UI 设计中的色彩都应取自这份色板。 + +经过设计师和程序员的精心调教,结合了色彩加白、加黑、加深,贝塞尔曲线,以及针对冷暖色的不同旋转角度,得出一套[色板生成算法](https://github.com/ant-design/ant-design/blob/734beb84ffc3f0469fbae1566aa8450f966cb261/components/style/color/colorPalette.less)。使用者只需指定主色,便可导出一条完整的渐变色板。 + +Ant Design 的色板由 8 种基本色彩组成,每种基本色(第 6 格)又按上述算法衍生出 10 种渐变色。 + +> 注:在由浅至深的色板里,第 6 格色彩单元格普遍满足 [WCAG 2.0](http://leaverou.github.io/contrast-ratio/) 的 4.5:1 最小对比度(AA 级),我们将其定义为色板的默认品牌色。 -> 我们结合了色彩加白、加黑、加深,贝塞尔曲线,以及针对冷暖色的不同旋转角度,调教出一套色彩算法。使用者只需指定主色,便可导出一条完整的渐变色板。 `````__react const rgbToHex = (rgbString) => { @@ -118,118 +125,3 @@ const ExtendPalettes = React.createClass({ }); ReactDOM.render(, mountNode); ````` - -## 色彩和交互 - -设计元素本身由于交互行为会引发一系列细微的视觉变化,而元素本身的颜色变化有时也能很好的实现这一目的。在进行这类设计的同时,建议采取在颜色上添加黑色或者白色并按照 `n+5%` 的规律递增的方式来实现。以下图为例,当鼠标 hover 某个特定元素,就视为浮起,对应颜色就相应增加白色叠加,相反点击的行为可以理解为按下去,在颜色上就相应的增加黑色的叠加。 - - - - - -## 色彩识别 - -合适的色彩对比为信息传达加分,同时也应放考虑到有颜色识别障碍人群的需求。我们将每种主色衍生出来的颜色进行了打标,在考虑对比颜色的选择时建议两种颜色对应标签数值的差要大于等于 5。 - - - - - -## 色彩换算工具 - -> 正数为变淡 `tint` ,负数为加深 `shade`。 - -`````__react -const Values = require('values.js'); -const CopyToClipboard = require('react-copy-to-clipboard'); -const classNames = require('classnames'); -const antd = require('antd'); -const Button = antd.Button; -const InputNumber = antd.InputNumber; -const Slider = antd.Slider; -const Tooltip = antd.Tooltip; -const TintShadeTool = React.createClass({ - getInitialState() { - return { - result: '#2db7f5', - color: '#2db7f5', - justCopied: false, - darkBackground: false, - value: 80 - }; - }, - handleChangeColor(e) { - this.setState({ - color: e.target.value - }, this.calculate); - }, - handleChangeValue(value) { - this.setState({ - value: value - }, this.calculate); - }, - componentDidMount() { - this.calculate(); - }, - calculate() { - if (this.state.value === 0) { - this.setState({ - result: this.state.color - }); - return; - } - const tintOrShade = this.state.value > 0 ? 'tint' : 'shade'; - const c = new Values(this.state.color); - const resultColor = c[tintOrShade](Math.abs(this.state.value)); - this.setState({ - result: '#' + resultColor.hex, - darkBackground: resultColor.getBrightness() < 50 - }); - }, - copySuccess(e) { - this.setState({ justCopied: true }, () => { - setTimeout(() => { - this.setState({ justCopied: false }); - }, 1000); - }); - }, - render() { - const marks = { - '-100': '加黑', - '0': '原色', - '100': '加白' - }; - const className = classNames({ - 'color-block': true, - copied: this.state.justCopied, - dark: this.state.darkBackground, - }); - return
-
- - -
- - - {this.state.result} - - - % -
-
- -
-
; - } -}); - -ReactDOM.render(, mountNode); -````` - -Ant Design 专用色彩换算工具,用于解析类似 `#2db7f5 tint 80%` 的色彩标注。 - -less 或 scss 语言可以直接使用 `tint(#2db7f5, 80%)` 和 `shade(#2db7f5, 80%)` 的语法。 From e459562cdc49313636bad812903671c3e0b66f38 Mon Sep 17 00:00:00 2001 From: Benjy Cui Date: Fri, 13 Jan 2017 14:59:14 +0800 Subject: [PATCH 25/85] site: fix target demo highlight, close: #4545 --- site/theme/template/Content/ComponentDoc.jsx | 23 ++++++++++---------- site/theme/template/Content/Demo.jsx | 13 ++++++++++- 2 files changed, 23 insertions(+), 13 deletions(-) diff --git a/site/theme/template/Content/ComponentDoc.jsx b/site/theme/template/Content/ComponentDoc.jsx index e85a59d8cc..35cf7f6a99 100644 --- a/site/theme/template/Content/ComponentDoc.jsx +++ b/site/theme/template/Content/ComponentDoc.jsx @@ -41,20 +41,19 @@ export default class ComponentDoc extends React.Component { demos.filter(demo => demo.meta.only) : demos.filter(demo => demo.preview); showedDemo.sort((a, b) => a.meta.order - b.meta.order) .forEach((demoData, index) => { + const demoElem = ( + + ); if (index % 2 === 0 || isSingleCol) { - leftChildren.push( - - ); + leftChildren.push(demoElem); } else { - rightChildren.push( - - ); + rightChildren.push(demoElem); } }); const expandTriggerClass = classNames({ diff --git a/site/theme/template/Content/Demo.jsx b/site/theme/template/Content/Demo.jsx index d65c53cdc4..4a99d1684e 100644 --- a/site/theme/template/Content/Demo.jsx +++ b/site/theme/template/Content/Demo.jsx @@ -22,10 +22,21 @@ export default class Demo extends React.Component { return (this.state.codeExpand || this.props.expand) !== (nextState.codeExpand || nextProps.expand); } + componentDidMount() { + const { meta, location } = this.props; + if (meta.id === location.hash.slice(1)) { + this.anchor.click(); + } + } + handleCodeExapnd = () => { this.setState({ codeExpand: !this.state.codeExpand }); } + saveAnchor = (anchor) => { + this.anchor = anchor; + } + render() { const props = this.props; const { @@ -70,7 +81,7 @@ export default class Demo extends React.Component {
- + {localizedTitle} } filename={meta.filename} /> From eeae03d681d71433410ed0e491720f1555b6db24 Mon Sep 17 00:00:00 2001 From: Benjy Cui Date: Fri, 13 Jan 2017 15:14:06 +0800 Subject: [PATCH 26/85] docs: remove useless code --- components/form/demo/dynamic-form-item.md | 6 ------ 1 file changed, 6 deletions(-) diff --git a/components/form/demo/dynamic-form-item.md b/components/form/demo/dynamic-form-item.md index 1612aa3436..bffcc6c263 100644 --- a/components/form/demo/dynamic-form-item.md +++ b/components/form/demo/dynamic-form-item.md @@ -19,12 +19,6 @@ const FormItem = Form.Item; let uuid = 0; class DynamicFieldSet extends React.Component { - componentWillMount() { - this.props.form.setFieldsValue({ - keys: [0], - }); - } - remove = (k) => { const { form } = this.props; // can use data-binding to get From c4c1078f2da3e503399feaea36f738522888d34e Mon Sep 17 00:00:00 2001 From: Benjy Cui Date: Fri, 13 Jan 2017 17:11:26 +0800 Subject: [PATCH 27/85] docs: update demos for Calendar --- components/calendar/demo/basic.md | 1 - components/calendar/demo/card.md | 2 +- components/calendar/demo/custom-render.md | 33 --------------------- components/calendar/demo/locale.md | 2 +- components/calendar/demo/notice-calendar.md | 10 +++---- 5 files changed, 7 insertions(+), 41 deletions(-) delete mode 100644 components/calendar/demo/custom-render.md diff --git a/components/calendar/demo/basic.md b/components/calendar/demo/basic.md index 6e5093702e..956bc2621c 100644 --- a/components/calendar/demo/basic.md +++ b/components/calendar/demo/basic.md @@ -9,7 +9,6 @@ title: 一个通用的日历面板,支持年/月切换。 - ## en-US A basic calendar component with Year/Month switch. diff --git a/components/calendar/demo/card.md b/components/calendar/demo/card.md index bb04bc0173..df9e2b39ce 100644 --- a/components/calendar/demo/card.md +++ b/components/calendar/demo/card.md @@ -1,5 +1,5 @@ --- -order: 10 +order: 2 title: zh-CN: 卡片模式 en-US: Card diff --git a/components/calendar/demo/custom-render.md b/components/calendar/demo/custom-render.md deleted file mode 100644 index 8d06258893..0000000000 --- a/components/calendar/demo/custom-render.md +++ /dev/null @@ -1,33 +0,0 @@ ---- -order: 1 -title: - zh-CN: 自定义渲染 - en-US: Custom Render ---- - -## zh-CN - -用 `dateCellRender` 和 `monthCellRender` 函数来自定义需要渲染的数据。 - -## en-US - -This component can be rendered by using `dateCellRender` and `monthCellRender` with the data you need. - -````jsx -import { Calendar } from 'antd'; -import moment from 'moment'; - -function dateCellRender(value) { - return
Custom date {value.date()}
; -} - -function monthCellRender(value) { - return
Custom monthly {value.month()}
; -} - -ReactDOM.render( - -, mountNode); -```` diff --git a/components/calendar/demo/locale.md b/components/calendar/demo/locale.md index 0a5bd4690d..1bdb7a17d0 100644 --- a/components/calendar/demo/locale.md +++ b/components/calendar/demo/locale.md @@ -1,5 +1,5 @@ --- -order: 4 +order: 3 title: zh-CN: 国际化 en-US: locale diff --git a/components/calendar/demo/notice-calendar.md b/components/calendar/demo/notice-calendar.md index 8e4ccc60d0..831d74cd87 100644 --- a/components/calendar/demo/notice-calendar.md +++ b/components/calendar/demo/notice-calendar.md @@ -1,17 +1,17 @@ --- -order: 2 +order: 1 title: - zh-CN: 通知事项日历演示 - en-US: A demo of Notice Calendar + zh-CN: 通知事项日历 + en-US: Notice Calendar --- ## zh-CN -一个复杂的应用示例。 +一个复杂的应用示例,用 `dateCellRender` 和 `monthCellRender` 函数来自定义需要渲染的数据。 ## en-US -A complex application. +This component can be rendered by using `dateCellRender` and `monthCellRender` with the data you need. ````jsx import { Calendar } from 'antd'; From e032fa6a62f5ca9c6a7e278a58bb85adf07e14a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=81=8F=E5=8F=B3?= Date: Fri, 13 Jan 2017 17:48:30 +0800 Subject: [PATCH 28/85] adjust entry file (#4594) --- components/index.tsx | 2 +- index.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/components/index.tsx b/components/index.tsx index 78d6c16f87..8de8930e30 100644 --- a/components/index.tsx +++ b/components/index.tsx @@ -2,7 +2,7 @@ // this file is not used if use https://github.com/ant-design/babel-plugin-import if (process.env.NODE_ENV !== 'production') { if (typeof console !== 'undefined' && console.warn) { - console.warn(`You are using prebuilt antd, + console.warn(`You are using a whole package of antd, please use https://www.npmjs.com/package/babel-plugin-import to reduce app bundle size.`); } } diff --git a/index.js b/index.js index 1337fd4fdd..46f497b21a 100644 --- a/index.js +++ b/index.js @@ -7,7 +7,7 @@ function camelCase(name) { } // Just import style for https://github.com/ant-design/ant-design/issues/3745 -const req = require.context('./components', true, /^\.\/[^_][\w-]+\/(style\/)index\.tsx?$/); +const req = require.context('./components', true, /^\.\/[^_][\w-]+\/style\/index\.tsx?$/); req.keys().forEach((mod) => { let v = req(mod); From 927581bb844a6e9fc16cd51d8214f24a95b0d8df Mon Sep 17 00:00:00 2001 From: Hans Chan Date: Mon, 9 Jan 2017 11:03:35 +0800 Subject: [PATCH 29/85] docs: add property `colon` for Form.Item (#4505) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * docs: 修改错别字 * docs: add property `colon` for Form.Item `colon` is available since 2.0.0-beta.1 --- components/form/index.en-US.md | 2 +- components/form/index.zh-CN.md | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/components/form/index.en-US.md b/components/form/index.en-US.md index dd1d37807f..cd0646daf7 100644 --- a/components/form/index.en-US.md +++ b/components/form/index.en-US.md @@ -115,7 +115,7 @@ Note: | required | Whether provided or not, it will be generated by the validation rule. | boolean | false | | validateStatus | The validation status. If not provided, it will be generated by validation rule. options: 'success' 'warning' 'error' 'validating' | string | | | hasFeedback | Used with `validateStatus`, this option specifies the validation status icon. Recommended to be used only with `Input`. | boolean | false | - +| colon | Used with `label`, whether to display `:` after label text. | boolean | true | From fe5f8910dd47e5bb6747bb62c1a28e5d2fc27909 Mon Sep 17 00:00:00 2001 From: afc163 Date: Thu, 19 Jan 2017 16:08:09 +0800 Subject: [PATCH 71/85] Hide scroll bar in fixed header of table, close #4637 --- components/table/style/index.less | 2 ++ 1 file changed, 2 insertions(+) diff --git a/components/table/style/index.less b/components/table/style/index.less index 1c9c6f972b..2277c41bb7 100644 --- a/components/table/style/index.less +++ b/components/table/style/index.less @@ -457,6 +457,7 @@ &-scroll { overflow: auto; + overflow-x: hidden; table { width: auto; min-width: 100%; @@ -480,6 +481,7 @@ overflow: scroll; padding-bottom: 20px; margin-bottom: -20px; + margin-right: -18px; } /* fix firefox scrollbar bug */ From 5203cabb8f9d1b8642ba8cdd7cfc605c32ef714e Mon Sep 17 00:00:00 2001 From: afc163 Date: Thu, 19 Jan 2017 17:36:02 +0800 Subject: [PATCH 72/85] update comment --- components/spin/style/index.less | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/components/spin/style/index.less b/components/spin/style/index.less index 4ee654edc1..56c8914a0b 100644 --- a/components/spin/style/index.less +++ b/components/spin/style/index.less @@ -79,8 +79,9 @@ filter: blur(1px); /* IE6~IE9 */ filter: ~"progid\:DXImageTransform\.Microsoft\.Blur(PixelRadius\=1, MakeShadow\=false)"; // lesshint duplicateProperty: false - // workround for strange bug in safari, having no clue that why this works + // workround for a strange style bug in safari: // https://github.com/ant-design/ant-design/issues/4622 + // have no clue why this works -webkit-transform: translateZ(0); &:after { content: ''; From 1db0e06bc46caf5137a55e0613b616c7c5baf8ae Mon Sep 17 00:00:00 2001 From: afc163 Date: Thu, 19 Jan 2017 21:49:03 +0800 Subject: [PATCH 73/85] Fix Table[small]'s title and footer border, close #4647 --- components/table/style/index.less | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/components/table/style/index.less b/components/table/style/index.less index 2277c41bb7..8039c81eb1 100644 --- a/components/table/style/index.less +++ b/components/table/style/index.less @@ -320,11 +320,16 @@ .@{table-prefix-cls}-title { border: 0; border-bottom: 1px solid @border-color-split; + border-right: 1px solid @border-color-split; } .@{table-prefix-cls}-footer { border: 0; border-top: 1px solid @border-color-split; + border-right: 1px solid @border-color-split; + &:before { + display: none; + } } } } From ddc7054751318ec1024f0f08d2a1811a259a1fa6 Mon Sep 17 00:00:00 2001 From: afc163 Date: Thu, 19 Jan 2017 21:51:53 +0800 Subject: [PATCH 74/85] Fix fixed column table border radius --- components/table/style/index.less | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/table/style/index.less b/components/table/style/index.less index 8039c81eb1..6e91f044b5 100644 --- a/components/table/style/index.less +++ b/components/table/style/index.less @@ -516,7 +516,7 @@ &-fixed-left { left: 0; - box-shadow: @shadow-1-right; + box-shadow: 6px 0 6px -4px @shadow-color; .@{table-prefix-cls}-header { overflow-y: hidden; } @@ -536,7 +536,7 @@ &-fixed-right { right: 0; - box-shadow: @shadow-1-left; + box-shadow: -6px 0 6px -4px @shadow-color; &, table { border-radius: 0 @border-radius-base 0 0; From fd861d6c0dfbedcee97db9d3f195d5daa9ecb010 Mon Sep 17 00:00:00 2001 From: Wei Zhu Date: Thu, 19 Jan 2017 22:40:30 +0800 Subject: [PATCH 75/85] Tweak empty table border (#4650) --- components/table/style/index.less | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/components/table/style/index.less b/components/table/style/index.less index 6e91f044b5..ae3c7dff2e 100644 --- a/components/table/style/index.less +++ b/components/table/style/index.less @@ -273,6 +273,13 @@ border-bottom: 0; } + &.@{table-prefix-cls}-empty { + .@{table-prefix-cls}-placeholder { + border-left: 1px solid @border-color-split; + border-right: 1px solid @border-color-split; + } + } + &.@{table-prefix-cls}-fixed-header { .@{table-prefix-cls}-header > table { border-bottom: 0; @@ -289,7 +296,7 @@ } .@{table-prefix-cls}-placeholder { - border-bottom: 0; + border: 0; } } @@ -297,10 +304,6 @@ border-bottom: 1px solid @border-color-split; } - &.@{table-prefix-cls}-empty .@{table-prefix-cls}-thead > tr > th { - border-bottom: 0; - } - .@{table-prefix-cls}-thead > tr > th, .@{table-prefix-cls}-tbody > tr > td { border-right: 1px solid @border-color-split; @@ -337,7 +340,7 @@ &-placeholder { padding: 16px 8px; background: @component-background; - border-bottom: 1px solid @border-color-split;; + border-bottom: 1px solid @border-color-split; text-align: center; font-size: @font-size-base; color: @text-color-secondary; From fd1ae531f47ba4a0bee9528c54a6740bf64a70b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=81=8F=E5=8F=B3?= Date: Fri, 20 Jan 2017 01:07:13 +0800 Subject: [PATCH 76/85] Update README.md --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index cc7bd3add3..e22bca175f 100644 --- a/README.md +++ b/README.md @@ -123,7 +123,7 @@ We welcome all contributions, please read our [CONTRIBUTING.md](https://github.c ## Release Schedule -* Weekly release: patch version at the end of every week. -* Monthly release: minor version at the end of every month. -* Emergence release: emergence patch anytime if necessary. -* Major version release is not included in this schedule. +* Weekly release: patch version at the end of every week for routine bugfix. +* Monthly release: minor version at the end of every month for new features. +* Emergence release: emergence patch anytime if necessary for urgent bugfix. +* Major version release is not included in this schedule for breadking change and new features. From 48ea23e026594f2b85457052df31dee84879f5f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=81=8F=E5=8F=B3?= Date: Fri, 20 Jan 2017 01:10:06 +0800 Subject: [PATCH 77/85] Update README-zh_CN.md --- README-zh_CN.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/README-zh_CN.md b/README-zh_CN.md index fc48eaf339..b001076538 100644 --- a/README-zh_CN.md +++ b/README-zh_CN.md @@ -96,7 +96,6 @@ tsconfig.json ## 发布周期 -* 每周末会发布一个完全兼容的 patch 版本。 -* 每月发布一个带有新特性的 minor 版本。 -* 任何时候都可以发布紧急补丁。 -* 大版本号不在此发布周期内。 +* patch 版本:每周末会进行日常 bugfix 更新。(如果有紧急的 bugfix,则任何时候都可发布) +* minor 版本:每月发布一个带有新特性的版本。 +* 大版本号:含有破坏性更新和新特性,不再发布周期内。 From fae7fd1658626555c81b3e3a04eb76305f5808c4 Mon Sep 17 00:00:00 2001 From: afc163 Date: Fri, 20 Jan 2017 11:33:27 +0800 Subject: [PATCH 78/85] Fix default value of Table showHeader, close #4658 --- components/table/Table.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/components/table/Table.tsx b/components/table/Table.tsx index 9f7b1d7b37..70cdc7153b 100755 --- a/components/table/Table.tsx +++ b/components/table/Table.tsx @@ -114,6 +114,7 @@ export default class Table extends React.Component, any> { indentSize: 20, locale: {}, rowKey: 'key', + showHeader: true, }; static contextTypes = { From 2004c136536bb5cd8dd49b006b2ef4bbc21da27f Mon Sep 17 00:00:00 2001 From: afc163 Date: Fri, 20 Jan 2017 11:47:31 +0800 Subject: [PATCH 79/85] Add semver link --- README-zh_CN.md | 2 ++ README.md | 2 ++ 2 files changed, 4 insertions(+) diff --git a/README-zh_CN.md b/README-zh_CN.md index b001076538..775cbee05f 100644 --- a/README-zh_CN.md +++ b/README-zh_CN.md @@ -96,6 +96,8 @@ tsconfig.json ## 发布周期 +遵循 [Semantic Versioning 2.0.0](http://semver.org/lang/zh-CN/) 语义化版本规范。 + * patch 版本:每周末会进行日常 bugfix 更新。(如果有紧急的 bugfix,则任何时候都可发布) * minor 版本:每月发布一个带有新特性的版本。 * 大版本号:含有破坏性更新和新特性,不再发布周期内。 diff --git a/README.md b/README.md index e22bca175f..02414de259 100644 --- a/README.md +++ b/README.md @@ -123,6 +123,8 @@ We welcome all contributions, please read our [CONTRIBUTING.md](https://github.c ## Release Schedule +Follow [Semantic Versioning 2.0.0](http://semver.org/). + * Weekly release: patch version at the end of every week for routine bugfix. * Monthly release: minor version at the end of every month for new features. * Emergence release: emergence patch anytime if necessary for urgent bugfix. From eb254572b7f4bd90547397ce81d64c46352898cb Mon Sep 17 00:00:00 2001 From: Benjy Cui Date: Fri, 20 Jan 2017 11:47:08 +0800 Subject: [PATCH 80/85] site: upgrade bisheng to 0.20.0 --- package.json | 2 +- site/bisheng.config.js | 73 +++++++-------------- site/theme/index.js | 69 +++++++++++++------ site/theme/template/Content/MainContent.jsx | 7 +- site/theme/template/Layout/Footer.jsx | 5 +- site/theme/template/Layout/index.jsx | 2 +- 6 files changed, 81 insertions(+), 77 deletions(-) diff --git a/package.json b/package.json index f5cec8a230..c3b8291397 100644 --- a/package.json +++ b/package.json @@ -86,7 +86,7 @@ "babel-preset-es2015": "^6.18.0", "babel-preset-react": "^6.16.0", "babel-preset-stage-0": "^6.16.0", - "bisheng": "^0.19.0", + "bisheng": "^0.20.0", "bisheng-plugin-antd": "^0.8.0", "bisheng-plugin-description": "^0.1.1", "bisheng-plugin-react": "^0.4.0", diff --git a/site/bisheng.config.js b/site/bisheng.config.js index 4a1919009e..fabdb50da6 100644 --- a/site/bisheng.config.js +++ b/site/bisheng.config.js @@ -1,18 +1,5 @@ const path = require('path'); -function pickerGenerator(module) { - const tester = new RegExp(`^docs/${module}`); - return (markdownData) => { - const filename = markdownData.meta.filename; - if (tester.test(filename) && - !/\/demo$/.test(path.dirname(filename))) { - return { - meta: markdownData.meta, - }; - } - }; -} - module.exports = { port: 8001, source: [ @@ -21,43 +8,33 @@ module.exports = { 'CHANGELOG.zh-CN.md', // TODO: fix it in bisheng 'CHANGELOG.en-US.md', ], - lazyLoad(nodePath, nodeValue) { - if (typeof nodeValue === 'string') { - return true; - } - return nodePath.endsWith('/demo'); - }, - pick: { - components(markdownData) { - const filename = markdownData.meta.filename; - if (!/^components/.test(filename) || - /\/demo$/.test(path.dirname(filename))) return; - - return { - meta: markdownData.meta, - }; - }, - changelog(markdownData) { - if (/CHANGELOG/.test(markdownData.meta.filename)) { - return { - meta: markdownData.meta, - }; - } - }, - 'docs/pattern': pickerGenerator('pattern'), - 'docs/practice': pickerGenerator('practice'), - 'docs/react': pickerGenerator('react'), - 'docs/resource': pickerGenerator('resource'), - 'docs/spec': pickerGenerator('spec'), - }, theme: './site/theme', htmlTemplate: './site/theme/static/template.html', - plugins: [ - 'bisheng-plugin-description', - 'bisheng-plugin-toc?maxDepth=2&keepElem', - 'bisheng-plugin-antd', - 'bisheng-plugin-react?lang=__react', - ], + themeConfig: { + categoryOrder: { + 十大原则: 0, + Principles: 0, + 设计基础: 1, + 'Design Fundamental': 1, + }, + typeOrder: { + General: 0, + Layout: 1, + Navigation: 2, + 'Data Entry': 3, + 'Data Display': 4, + Feedback: 5, + Localization: 6, + Other: 7, + }, + docVersions: { + '0.9.x': 'http://09x.ant.design', + '0.10.x': 'http://010x.ant.design', + '0.11.x': 'http://011x.ant.design', + '0.12.x': 'http://012x.ant.design', + '1.x': 'http://1x.ant.design', + }, + }, filePathMapper(filePath) { if (filePath === '/index.html') { return ['/index.html', '/index-cn.html']; diff --git a/site/theme/index.js b/site/theme/index.js index dec3f24947..31d58e1ea5 100644 --- a/site/theme/index.js +++ b/site/theme/index.js @@ -1,30 +1,57 @@ +const path = require('path'); + const homeTmpl = './template/Home/index'; const contentTmpl = './template/Content/index'; +function pickerGenerator(module) { + const tester = new RegExp(`^docs/${module}`); + return (markdownData) => { + const filename = markdownData.meta.filename; + if (tester.test(filename) && + !/\/demo$/.test(path.dirname(filename))) { + return { + meta: markdownData.meta, + }; + } + }; +} + module.exports = { - categoryOrder: { - 十大原则: 0, - Principles: 0, - 设计基础: 1, - 'Design Fundamental': 1, + lazyLoad(nodePath, nodeValue) { + if (typeof nodeValue === 'string') { + return true; + } + return nodePath.endsWith('/demo'); }, - typeOrder: { - General: 0, - Layout: 1, - Navigation: 2, - 'Data Entry': 3, - 'Data Display': 4, - Feedback: 5, - Localization: 6, - Other: 7, - }, - docVersions: { - '0.9.x': 'http://09x.ant.design', - '0.10.x': 'http://010x.ant.design', - '0.11.x': 'http://011x.ant.design', - '0.12.x': 'http://012x.ant.design', - '1.x': 'http://1x.ant.design', + pick: { + components(markdownData) { + const filename = markdownData.meta.filename; + if (!/^components/.test(filename) || + /\/demo$/.test(path.dirname(filename))) return; + + return { + meta: markdownData.meta, + }; + }, + changelog(markdownData) { + if (/CHANGELOG/.test(markdownData.meta.filename)) { + return { + meta: markdownData.meta, + }; + } + }, + 'docs/pattern': pickerGenerator('pattern'), + 'docs/practice': pickerGenerator('practice'), + 'docs/react': pickerGenerator('react'), + 'docs/resource': pickerGenerator('resource'), + 'docs/spec': pickerGenerator('spec'), }, + plugins: [ + 'bisheng-plugin-description', + 'bisheng-plugin-toc?maxDepth=2&keepElem', + 'bisheng-plugin-antd', + 'bisheng-plugin-react?lang=__react', + ], routes: { path: '/', component: './template/Layout/index', diff --git a/site/theme/template/Content/MainContent.jsx b/site/theme/template/Content/MainContent.jsx index f7960f8b5a..e5ace5075a 100644 --- a/site/theme/template/Content/MainContent.jsx +++ b/site/theme/template/Content/MainContent.jsx @@ -4,7 +4,6 @@ import { Row, Col, Menu } from 'antd'; import Article from './Article'; import ComponentDoc from './ComponentDoc'; import * as utils from '../utils'; -import config from '../../'; const SubMenu = Menu.SubMenu; @@ -124,9 +123,10 @@ export default class MainContent extends React.Component { } generateSubMenuItems(obj) { + const { themeConfig } = this.props; const topLevel = (obj.topLevel || []).map(this.generateMenuItem.bind(this, true)); const itemGroups = Object.keys(obj).filter(isNotTopLevel) - .sort((a, b) => config.typeOrder[a] - config.typeOrder[b]) + .sort((a, b) => themeConfig.typeOrder[a] - themeConfig.typeOrder[b]) .map((type) => { const groupItems = obj[type].sort((a, b) => { return a.title.charCodeAt(0) - @@ -142,13 +142,14 @@ export default class MainContent extends React.Component { } getMenuItems() { + const { themeConfig } = this.props; const moduleData = getModuleData(this.props); const menuItems = utils.getMenuItems( moduleData, this.context.intl.locale ); const topLevel = this.generateSubMenuItems(menuItems.topLevel); const subMenu = Object.keys(menuItems).filter(isNotTopLevel) - .sort((a, b) => config.categoryOrder[a] - config.categoryOrder[b]) + .sort((a, b) => themeConfig.categoryOrder[a] - themeConfig.categoryOrder[b]) .map((category) => { const subMenuItems = this.generateSubMenuItems(menuItems[category]); return ( diff --git a/site/theme/template/Layout/Footer.jsx b/site/theme/template/Layout/Footer.jsx index ef3d9a5e3d..3427e197cc 100644 --- a/site/theme/template/Layout/Footer.jsx +++ b/site/theme/template/Layout/Footer.jsx @@ -3,7 +3,6 @@ import { FormattedMessage, injectIntl } from 'react-intl'; import { Select, Modal } from 'antd'; import { version as antdVersion } from 'antd/package.json'; import * as utils from '../utils'; -import { docVersions } from '../../'; const Option = Select.Option; @@ -19,8 +18,6 @@ function isLocalStorageNameSupported() { } } -docVersions[antdVersion] = antdVersion; - class Footer extends React.Component { componentDidMount() { // for some iOS @@ -71,6 +68,8 @@ class Footer extends React.Component { } render() { + const { themeConfig } = this.props; + const docVersions = { ...themeConfig.docVersions, [antdVersion]: antdVersion }; const options = Object.keys(docVersions) .map(version => ); return ( diff --git a/site/theme/template/Layout/index.jsx b/site/theme/template/Layout/index.jsx index 9a34b9b877..162469e59f 100644 --- a/site/theme/template/Layout/index.jsx +++ b/site/theme/template/Layout/index.jsx @@ -70,7 +70,7 @@ export default class Layout extends React.Component {
{cloneElement(children, { onEnterChange: this.onEnterChange })} -
+
From 6c98d94b0de2fdead95ce98e2435701eb4c1a14d Mon Sep 17 00:00:00 2001 From: afc163 Date: Fri, 20 Jan 2017 13:41:13 +0800 Subject: [PATCH 81/85] site: improve style of toc and color page --- site/theme/static/colors.less | 15 ++++++++------- site/theme/static/toc.less | 5 +++++ 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/site/theme/static/colors.less b/site/theme/static/colors.less index 94ccebfc8d..959fc6dd4c 100644 --- a/site/theme/static/colors.less +++ b/site/theme/static/colors.less @@ -4,21 +4,22 @@ .main-color { overflow: hidden; -} - -.main-color { + display: flex; &-item { - width: 80px; - height: 60px; + flex: 1; + height: 80px; border-radius: 4px; float: left; - margin: 0 5px 5px 0; + margin-right: 4px; transition: all .2s; position: relative; text-align: center; - padding-top: 20px; + padding-top: 28px; font-family: Consolas; font-size: 12px; + &:last-child { + margin-right: 0; + } } &-item &-value { font-size: 12px; diff --git a/site/theme/static/toc.less b/site/theme/static/toc.less index 3e5973da15..f6b82c194d 100644 --- a/site/theme/static/toc.less +++ b/site/theme/static/toc.less @@ -5,6 +5,11 @@ list-style: none; } +.markdown .toc { + background: #fbfbfb; + border-left: 2px solid #eee; +} + .toc > ul { padding: 8px 0; list-style: none; From e245facb48f304155c19993506709499d4caac51 Mon Sep 17 00:00:00 2001 From: afc163 Date: Fri, 20 Jan 2017 13:43:39 +0800 Subject: [PATCH 82/85] Fix table snapshots --- .../__tests__/__snapshots__/demo.test.js.snap | 2 +- .../__snapshots__/Table.filter.test.js.snap | 2 +- .../Table.pagination.test.js.snap | 2 +- .../__snapshots__/Table.test.js.snap | 2 +- .../__tests__/__snapshots__/demo.test.js.snap | 42 +++++++++---------- 5 files changed, 25 insertions(+), 25 deletions(-) diff --git a/components/locale-provider/__tests__/__snapshots__/demo.test.js.snap b/components/locale-provider/__tests__/__snapshots__/demo.test.js.snap index f491bec881..dd20609036 100644 --- a/components/locale-provider/__tests__/__snapshots__/demo.test.js.snap +++ b/components/locale-provider/__tests__/__snapshots__/demo.test.js.snap @@ -1152,7 +1152,7 @@ exports[`test renders ./components/locale-provider/demo/all.md correctly 1`] = `
+ class="ant-table ant-table-large ant-table-empty ant-table-scroll-position-left">
+ class="ant-table ant-table-large ant-table-scroll-position-left">
+ class="ant-table ant-table-large ant-table-scroll-position-left">
+ class="ant-table ant-table-large ant-table-scroll-position-left">
+ class="ant-table ant-table-large ant-table-empty ant-table-scroll-position-left">
+ class="ant-table ant-table-large ant-table-scroll-position-left">
+ class="ant-table ant-table-large ant-table-bordered ant-table-scroll-position-left">
Header @@ -468,7 +468,7 @@ exports[`test renders ./components/table/demo/colspan-rowspan.md correctly 1`] =
+ class="ant-table ant-table-large ant-table-bordered ant-table-scroll-position-left">
+ class="ant-table ant-table-large ant-table-scroll-position-left">
+ class="ant-table ant-table-large ant-table-bordered ant-table-scroll-position-left">
+ class="ant-table ant-table-large ant-table-bordered ant-table-scroll-position-left">
+ class="ant-table ant-table-large ant-table-scroll-position-left">
+ class="ant-table ant-table-large ant-table-scroll-position-left">
+ class="ant-table ant-table-large ant-table-scroll-position-left">
+ class="ant-table ant-table-large ant-table-fixed-header ant-table-scroll-position-left">
+ class="ant-table ant-table-large ant-table-fixed-header ant-table-scroll-position-left">
+ class="ant-table ant-table-middle ant-table-bordered ant-table-fixed-header ant-table-scroll-position-left">
+ class="ant-table ant-table-large ant-table-scroll-position-left">
+ class="ant-table ant-table-large ant-table-scroll-position-left">
+ class="ant-table ant-table-large ant-table-scroll-position-left">
+ class="ant-table ant-table-large ant-table-scroll-position-left">
+ class="ant-table ant-table-large ant-table-scroll-position-left">
+ class="ant-table ant-table-large ant-table-scroll-position-left">
+ class="ant-table ant-table-middle ant-table-scroll-position-left">
+ class="ant-table ant-table-small ant-table-scroll-position-left">
Date: Fri, 20 Jan 2017 14:12:06 +0800 Subject: [PATCH 83/85] fix RangePicker snapshot --- .../__tests__/__snapshots__/RangePicker.test.js.snap | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/components/date-picker/__tests__/__snapshots__/RangePicker.test.js.snap b/components/date-picker/__tests__/__snapshots__/RangePicker.test.js.snap index a12e28b12e..122778401e 100644 --- a/components/date-picker/__tests__/__snapshots__/RangePicker.test.js.snap +++ b/components/date-picker/__tests__/__snapshots__/RangePicker.test.js.snap @@ -16,7 +16,7 @@ exports[`RangePicker show month panel according to value 1`] = `
@@ -624,7 +624,7 @@ exports[`RangePicker show month panel according to value 1`] = `
@@ -1260,7 +1260,7 @@ exports[`RangePicker switch to corresponding month panel when click presetted ra
@@ -1868,7 +1868,7 @@ exports[`RangePicker switch to corresponding month panel when click presetted ra
From 823ac6c139368d5617dc83e4a7ba2105bfe69eb9 Mon Sep 17 00:00:00 2001 From: Wei Zhu Date: Fri, 20 Jan 2017 16:08:20 +0800 Subject: [PATCH 84/85] fix TableColumnConfig exporting, #4660 --- components/table/Table.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/components/table/Table.tsx b/components/table/Table.tsx index 70cdc7153b..03bdf97a32 100755 --- a/components/table/Table.tsx +++ b/components/table/Table.tsx @@ -36,6 +36,8 @@ const defaultPagination = { onShowSizeChange: noop, }; +export type TableColumnConfig = ColumnProps; + export interface TableRowSelection { type?: 'checkbox' | 'radio'; selectedRowKeys?: string[]; From bee522133ef0dd5defbac126b6d1246bb47483ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=86=E7=A6=BB?= Date: Fri, 20 Jan 2017 16:16:31 +0800 Subject: [PATCH 85/85] docs: Autocomplete optionLabelProp document (#4663) close #4656 --- components/auto-complete/index.en-US.md | 1 + components/auto-complete/index.zh-CN.md | 1 + 2 files changed, 2 insertions(+) diff --git a/components/auto-complete/index.en-US.md b/components/auto-complete/index.en-US.md index eca1bb8b6a..079fcd6da2 100644 --- a/components/auto-complete/index.en-US.md +++ b/components/auto-complete/index.en-US.md @@ -29,3 +29,4 @@ Since `AutoComplete` is based on `Select`, so besides the following API, `AutoCo | onSelect | Called when a option is selected. param is option's value and option instance. | function(value, option) | - | | disabled | Whether disabled select | boolean | false | | placeholder | placeholder of input | string | - | +| optionLabelProp | Which prop value of option will render as content of select. | string | `children` | diff --git a/components/auto-complete/index.zh-CN.md b/components/auto-complete/index.zh-CN.md index eacad5a915..f10a60a93b 100644 --- a/components/auto-complete/index.zh-CN.md +++ b/components/auto-complete/index.zh-CN.md @@ -30,3 +30,4 @@ const dataSource = ['12345', '23456', '34567']; | onSelect | 被选中时调用,参数为选中项的 value 值 | function(value, option) | 无 | | disabled | 是否禁用 | boolean | false | | placeholder | 输入框提示 | string | - | +| optionLabelProp | 回填到选择框的 Option 的属性值,默认是 Option 的子元素。比如在子元素需要高亮效果时,此值可以设为 `value`。 | string | `children` |