+
66.66%
-
@@ -69,7 +69,7 @@ english: Layout
* 通过`row`在水平方向建立一组`column`(简写col)
* 你的内容应当放置于`col`内,并且,只有`col`可以作为`row`的直接元素
-* 栅格系统中的列是指1到24的值来表示其跨越的范围。例如,三个等宽的列可以使用`.col-8`来创建
+* 栅格系统中的列是指1到24的值来表示其跨越的范围。例如,三个等宽的列可以使用`.ant-col-8`来创建
* 如果一个`row`中的`col`总和超过 24,那么多余的`col`会作为一个整体另起一行排列
## Flex 布局
diff --git a/components/layout/row.jsx b/components/layout/row.jsx
index 54dd0c7245..a7f93b0357 100644
--- a/components/layout/row.jsx
+++ b/components/layout/row.jsx
@@ -16,10 +16,10 @@ export default class Row extends React.Component {
render() {
const { type, justify, align, className, gutter, style, children, ...others } = this.props;
const classes = classNames({
- row: !type,
- [`row-${type}`]: type,
- [`row-${type}-${justify}`]: justify,
- [`row-${type}-${align}`]: align,
+ 'ant-row': !type,
+ [`ant-row-${type}`]: type,
+ [`ant-row-${type}-${justify}`]: justify,
+ [`ant-row-${type}-${align}`]: align,
[className]: className,
});
const rowStyle = gutter > 0 ? {
diff --git a/components/layout/style/index.less b/components/layout/style/index.less
index 1cea82b039..0b105d50c4 100644
--- a/components/layout/style/index.less
+++ b/components/layout/style/index.less
@@ -3,12 +3,12 @@
@import "./mixin";
// Grid system
-.row {
+.ant-row {
.make-row();
display: block;
}
-.row-flex {
+.ant-row-flex {
display: flex;
flex-direction: row;
flex-wrap: wrap;
@@ -20,46 +20,46 @@
}
// x轴原点
-.row-flex-start {
+.ant-row-flex-start {
justify-content: flex-start;
}
// x轴居中
-.row-flex-center {
+.ant-row-flex-center {
justify-content: center;
}
// x轴反方向
-.row-flex-end {
+.ant-row-flex-end {
justify-content: flex-end;
}
// x轴平分
-.row-flex-space-between {
+.ant-row-flex-space-between {
justify-content: space-between;
}
// x轴有间隔地平分
-.row-flex-space-around {
+.ant-row-flex-space-around {
justify-content: space-around;
}
// 顶部对齐
-.row-flex-top {
+.ant-row-flex-top {
align-items: flex-start;
}
// 居中对齐
-.row-flex-middle {
+.ant-row-flex-middle {
align-items: center;
}
// 底部对齐
-.row-flex-bottom {
+.ant-row-flex-bottom {
align-items: flex-end;
}
-.col {
+.ant-col {
position: relative;
display: block;
}
diff --git a/components/layout/style/mixin.less b/components/layout/style/mixin.less
index 1ce82101e1..d238ad7b8c 100644
--- a/components/layout/style/mixin.less
+++ b/components/layout/style/mixin.less
@@ -12,11 +12,11 @@
.make-grid-columns() {
.col(@index) {
- @item: ~".col-@{index}, .col-xs-@{index}, .col-sm-@{index}, .col-md-@{index}, .col-lg-@{index}";
+ @item: ~".ant-col-@{index}, .ant-col-xs-@{index}, .ant-col-sm-@{index}, .ant-col-md-@{index}, .ant-col-lg-@{index}";
.col((@index + 1), @item);
}
.col(@index, @list) when (@index =< @grid-columns) {
- @item: ~".col-@{index}, .col-xs-@{index}, .col-sm-@{index}, .col-md-@{index}, .col-lg-@{index}";
+ @item: ~".ant-col-@{index}, .ant-col-xs-@{index}, .ant-col-sm-@{index}, .ant-col-md-@{index}, .ant-col-lg-@{index}";
.col((@index + 1), ~"@{list}, @{item}");
}
.col(@index, @list) when (@index > @grid-columns) {
@@ -33,11 +33,11 @@
.float-grid-columns(@class) {
.col(@index) { // initial
- @item: ~".col@{class}-@{index}";
+ @item: ~".ant-col@{class}-@{index}";
.col((@index + 1), @item);
}
.col(@index, @list) when (@index =< @grid-columns) { // general
- @item: ~".col@{class}-@{index}";
+ @item: ~".ant-col@{class}-@{index}";
.col((@index + 1), ~"@{list}, @{item}");
}
.col(@index, @list) when (@index > @grid-columns) { // terminal
@@ -51,33 +51,33 @@
// lesshint false
.loop-grid-columns(@index, @class) when (@index > 0) {
- .col@{class}-@{index} {
+ .ant-col@{class}-@{index} {
display: block;
width: percentage((@index / @grid-columns));
}
- .col@{class}-push-@{index} {
+ .ant-col@{class}-push-@{index} {
left: percentage((@index / @grid-columns));
}
- .col@{class}-pull-@{index} {
+ .ant-col@{class}-pull-@{index} {
right: percentage((@index / @grid-columns));
}
- .col@{class}-offset-@{index} {
+ .ant-col@{class}-offset-@{index} {
margin-left: percentage((@index / @grid-columns));
}
- .col@{class}-order-@{index} {
+ .ant-col@{class}-order-@{index} {
order: @index;
}
.loop-grid-columns((@index - 1), @class);
}
.loop-grid-columns(@index, @class) when (@index = 0) {
- .col@{class}-@{index} {
+ .ant-col@{class}-@{index} {
display: none;
}
- .col-push-@{index} {
+ .ant-col-push-@{index} {
left: auto;
}
- .col-pull-@{index} {
+ .ant-col-pull-@{index} {
right: auto;
}
}
diff --git a/components/locale-provider/demo/all.md b/components/locale-provider/demo/all.md
index 22bb973090..39114fc464 100644
--- a/components/locale-provider/demo/all.md
+++ b/components/locale-provider/demo/all.md
@@ -77,7 +77,8 @@ const Page = React.createClass({
showSearch
titles={['', '']}
targetKeys={[]}
- render={item => item.title} />
+ render={item => item.title}
+ />
diff --git a/components/modal/demo/basic.md b/components/modal/demo/basic.md
index 15ef92c0ef..99f4c97055 100644
--- a/components/modal/demo/basic.md
+++ b/components/modal/demo/basic.md
@@ -34,7 +34,8 @@ const App = React.createClass({
diff --git a/components/select/demo/combobox.md b/components/select/demo/combobox.md
index e4b1555a0d..31ec65cc1f 100644
--- a/components/select/demo/combobox.md
+++ b/components/select/demo/combobox.md
@@ -34,7 +34,8 @@ const Test = React.createClass({
style={{ width: 200 }}
onChange={this.handleChange}
filterOption={false}
- placeholder="请输入账户名">
+ placeholder="请输入账户名"
+ >
{this.state.options}
);
diff --git a/components/select/demo/multiple.md b/components/select/demo/multiple.md
index 36103f71a5..656f9463f3 100644
--- a/components/select/demo/multiple.md
+++ b/components/select/demo/multiple.md
@@ -22,7 +22,8 @@ ReactDOM.render(
, mountNode);
diff --git a/components/select/demo/optgroup.md b/components/select/demo/optgroup.md
index ea9ca27309..7a0b52fbf2 100644
--- a/components/select/demo/optgroup.md
+++ b/components/select/demo/optgroup.md
@@ -18,7 +18,8 @@ ReactDOM.render(
diff --git a/components/select/demo/search.md b/components/select/demo/search.md
index e2593c0a0b..5bd4520e18 100644
--- a/components/select/demo/search.md
+++ b/components/select/demo/search.md
@@ -19,7 +19,8 @@ ReactDOM.render(
placeholder="请选择人员"
optionFilterProp="children"
notFoundContent="无法找到"
- onChange={handleChange}>
+ onChange={handleChange}
+ >
diff --git a/components/select/demo/tags.md b/components/select/demo/tags.md
index 6ff4160aa9..e340c7f915 100644
--- a/components/select/demo/tags.md
+++ b/components/select/demo/tags.md
@@ -22,7 +22,8 @@ ReactDOM.render(
, mountNode);
diff --git a/components/select/index.jsx b/components/select/index.jsx
index ceb0ec2686..864f0655ee 100644
--- a/components/select/index.jsx
+++ b/components/select/index.jsx
@@ -44,7 +44,8 @@ export default class Select extends React.Component {
+ notFoundContent={notFoundContent}
+ />
);
}
}
diff --git a/components/slider/demo/input-number.md b/components/slider/demo/input-number.md
index 8e3d9873d2..dde87b5019 100644
--- a/components/slider/demo/input-number.md
+++ b/components/slider/demo/input-number.md
@@ -27,7 +27,8 @@ const IntegerStep = React.createClass({
+ value={this.state.inputValue} onChange={this.onChange}
+ />
);
@@ -53,7 +54,8 @@ const DecimalStep = React.createClass({
+ value={this.state.inputValue} onChange={this.onChange}
+ />
);
diff --git a/components/spin/demo/nested.md b/components/spin/demo/nested.md
index 61470113b0..2f82930e21 100644
--- a/components/spin/demo/nested.md
+++ b/components/spin/demo/nested.md
@@ -19,7 +19,8 @@ const Card = React.createClass({
const container = (
+ type="info"
+ />
);
return (
diff --git a/components/spin/demo/tip.md b/components/spin/demo/tip.md
index 9843620ea2..887600ba65 100644
--- a/components/spin/demo/tip.md
+++ b/components/spin/demo/tip.md
@@ -12,7 +12,8 @@ ReactDOM.render(
+ type="info"
+ />
, mountNode);
````
diff --git a/components/table/demo/ajax.md b/components/table/demo/ajax.md
index 1a7d897ec3..96528649d7 100644
--- a/components/table/demo/ajax.md
+++ b/components/table/demo/ajax.md
@@ -89,7 +89,8 @@ const Test = React.createClass({
dataSource={this.state.data}
pagination={this.state.pagination}
loading={this.state.loading}
- onChange={this.handleTableChange} />
+ onChange={this.handleTableChange}
+ />
);
},
});
diff --git a/components/table/demo/expand.md b/components/table/demo/expand.md
index 3a88d1e8e7..204cf4c53e 100644
--- a/components/table/demo/expand.md
+++ b/components/table/demo/expand.md
@@ -25,6 +25,7 @@ ReactDOM.render(
{record.description}
}
dataSource={data}
- className="table" />
+ className="table"
+ />
, mountNode);
````
diff --git a/components/table/demo/row-selection-and-operation.md b/components/table/demo/row-selection-and-operation.md
index 1aa99d5cad..2b02e31c75 100644
--- a/components/table/demo/row-selection-and-operation.md
+++ b/components/table/demo/row-selection-and-operation.md
@@ -61,7 +61,8 @@ const App = React.createClass({
+ disabled={!hasSelected} loading={loading}
+ >操作
{hasSelected ? `选择了 ${selectedRowKeys.length} 个对象` : ''}
diff --git a/components/table/filterDropdown.jsx b/components/table/filterDropdown.jsx
index 36166ff95d..f913c9b8ce 100644
--- a/components/table/filterDropdown.jsx
+++ b/components/table/filterDropdown.jsx
@@ -113,16 +113,19 @@ export default class FilterMenu extends React.Component {
prefixCls="ant-dropdown-menu"
onSelect={this.setSelectedKeys}
onDeselect={this.setSelectedKeys}
- selectedKeys={this.state.selectedKeys}>
+ selectedKeys={this.state.selectedKeys}
+ >
{this.renderMenus(column.filters)}
@@ -137,7 +140,8 @@ export default class FilterMenu extends React.Component {
overlay={menus}
visible={this.state.visible}
onVisibleChange={this.onVisibleChange}
- closeOnSelect={false}>
+ closeOnSelect={false}
+ >
);
diff --git a/components/table/index.jsx b/components/table/index.jsx
index 8a3d23e4c7..b82bb0fe2c 100644
--- a/components/table/index.jsx
+++ b/components/table/index.jsx
@@ -430,7 +430,8 @@ export default class Table extends React.Component {
return (
this.handleRadioSelect(record, rowIndex, e)}
- value={rowIndex} checked={checked} />
+ value={rowIndex} checked={checked}
+ />
);
}
@@ -449,7 +450,8 @@ export default class Table extends React.Component {
}
return (
this.handleSelect(record, rowIndex, e)} />
+ onChange={(e) => this.handleSelect(record, rowIndex, e)}
+ />
);
}
@@ -498,7 +500,8 @@ export default class Table extends React.Component {
const checkboxAll = (
+ onChange={this.handleSelectAllRow}
+ />
);
selectionColumn = {
key: 'selection-column',
@@ -544,7 +547,8 @@ export default class Table extends React.Component {
filterDropdown = (
+ confirmFilter={this.handleFilter}
+ />
);
}
if (column.sorter) {
@@ -561,12 +565,14 @@ export default class Table extends React.Component {
this.toggleSortOrder('ascend', column)}>
+ onClick={() => this.toggleSortOrder('ascend', column)}
+ >
this.toggleSortOrder('descend', column)}>
+ onClick={() => this.toggleSortOrder('descend', column)}
+ >
@@ -612,7 +618,8 @@ export default class Table extends React.Component {
onChange={this.handlePageChange}
total={total}
size={size}
- onShowSizeChange={this.handleShowSizeChange} /> : null;
+ onShowSizeChange={this.handleShowSizeChange}
+ /> : null;
}
prepareParamsArguments(state) {
@@ -729,7 +736,8 @@ export default class Table extends React.Component {
columns={columns}
className={classString}
expandIconColumnIndex={(columns[0] && columns[0].key === 'selection-column') ? 1 : 0}
- expandIconAsCell={expandIconAsCell} />
+ expandIconAsCell={expandIconAsCell}
+ />
{emptyText}
);
diff --git a/components/tabs/demo/custom-add-trigger.md b/components/tabs/demo/custom-add-trigger.md
index e642ace3fc..87019fd265 100644
--- a/components/tabs/demo/custom-add-trigger.md
+++ b/components/tabs/demo/custom-add-trigger.md
@@ -54,7 +54,8 @@ const Demo = React.createClass({
+ type="editable-card" onEdit={this.onEdit}
+ >
{this.state.panes}
diff --git a/components/tabs/demo/editable-card.md b/components/tabs/demo/editable-card.md
index a462b4d778..98f92cd12e 100644
--- a/components/tabs/demo/editable-card.md
+++ b/components/tabs/demo/editable-card.md
@@ -50,7 +50,8 @@ const Demo = React.createClass({
render() {
return (
+ type="editable-card" onEdit={this.onEdit}
+ >
{this.state.panes}
);
diff --git a/components/tabs/demo/position.md b/components/tabs/demo/position.md
index 31b91ca01c..8ba2eddf4e 100644
--- a/components/tabs/demo/position.md
+++ b/components/tabs/demo/position.md
@@ -25,7 +25,8 @@ const Demo = React.createClass({
页签位置:
: null}
+ transitionLeave={false}
+ >
{showItems.length > 0
? showItems
: {notFoundContent || '列表为空'}
}
diff --git a/components/transfer/search.jsx b/components/transfer/search.jsx
index e802a65606..153fe7f806 100644
--- a/components/transfer/search.jsx
+++ b/components/transfer/search.jsx
@@ -31,7 +31,8 @@ export default class Search extends React.Component {
return (
+ namespace="ant-design" repo="ant-design"
+ />
diff --git a/site/theme/template/Home/Page1.jsx b/site/theme/template/Home/Page1.jsx
index 040365c076..1f196223b2 100644
--- a/site/theme/template/Home/Page1.jsx
+++ b/site/theme/template/Home/Page1.jsx
@@ -21,9 +21,11 @@ export default function Page1() {
return (
+ style={{ transform: 'translateX(-100px)', opacity: 0 }} hideProps={{ reverse: true }}
+ />
+ hideProps={{ child: null }}
+ >
最佳实践
近一年的中后台设计实践,积累了大量的优秀案例。
diff --git a/site/theme/template/Home/Page2.jsx b/site/theme/template/Home/Page2.jsx
index 2f770e2e7a..2d140dcae0 100644
--- a/site/theme/template/Home/Page2.jsx
+++ b/site/theme/template/Home/Page2.jsx
@@ -10,7 +10,8 @@ export default function Page2() {
+ hideProps={{ child: null }}
+ >
设计模式
总结中后台设计中反复出现的问题,并提供相应的解决方案。
@@ -23,7 +24,8 @@ export default function Page2() {
+ style={{ transform: 'translateX(100px)', opacity: 0 }} hideProps={{ reverse: true }}
+ />
);
}
diff --git a/site/theme/template/Home/Page3.jsx b/site/theme/template/Home/Page3.jsx
index 2e50d6e0f5..1a3f5b323b 100644
--- a/site/theme/template/Home/Page3.jsx
+++ b/site/theme/template/Home/Page3.jsx
@@ -9,9 +9,11 @@ export default function Page3() {
return (
+ style={{ transform: 'translateX(-100px)', opacity: 0 }} hideProps={{ reverse: true }}
+ />
+ hideProps={{ child: null }}
+ >
丰富的基础组件
丰富、灵活、实用的基础组件,为业务产品提供强有力的设计支持。
diff --git a/site/theme/template/Home/Page4.jsx b/site/theme/template/Home/Page4.jsx
index 3baacbee26..f16f32493e 100644
--- a/site/theme/template/Home/Page4.jsx
+++ b/site/theme/template/Home/Page4.jsx
@@ -7,12 +7,14 @@ export default function Page4() {
return (
+ hideProps={{ child: null }}
+ >
微小·确定·幸福
这是一套致力于提升『用户』和『设计者』使用体验的中后台设计语言。
+ style={{ transform: 'translateY(50px)', opacity: 0 }} hideProps={{ reverse: true }}
+ />
);
}
diff --git a/site/theme/template/Layout/Footer.jsx b/site/theme/template/Layout/Footer.jsx
index 84e2216cde..5486575e96 100644
--- a/site/theme/template/Layout/Footer.jsx
+++ b/site/theme/template/Layout/Footer.jsx
@@ -110,7 +110,8 @@ export default class Footer extends React.Component {
size="small"
dropdownMatchSelectWidth={false}
defaultValue={antdVersion}
- onChange={this.handleVersionChange}>
+ onChange={this.handleVersionChange}
+ >
{options}
diff --git a/site/theme/template/Layout/Header.jsx b/site/theme/template/Layout/Header.jsx
index bc9266e623..256971c83b 100644
--- a/site/theme/template/Layout/Header.jsx
+++ b/site/theme/template/Layout/Header.jsx
@@ -136,14 +136,16 @@ export default class Header extends React.Component {
+ type="menu"
+ />
Ant Design
+ lg={20} md={18} sm={17} xs={0} style={menuStyle}
+ >
diff --git a/site/theme/template/NotFound.jsx b/site/theme/template/NotFound.jsx
index 43fcf8f2b0..7c2dbdf059 100644
--- a/site/theme/template/NotFound.jsx
+++ b/site/theme/template/NotFound.jsx
@@ -10,7 +10,8 @@ export default function NotFound() {
+ }}
+ />
);
}
diff --git a/tests/layout.test.js b/tests/layout.test.js
index 32a0a6e816..22b1c5c93d 100644
--- a/tests/layout.test.js
+++ b/tests/layout.test.js
@@ -15,13 +15,13 @@ describe('Layout', function() {
);
const colNode = TestUtils.findRenderedDOMComponentWithTag(col, 'DIV');
- expect(colNode.className).toBe('col-2');
+ expect(colNode.className).toBe('ant-col-2');
});
it('should render Row', () => {
const row = TestUtils.renderIntoDocument(
);
const rowNode = TestUtils.findRenderedDOMComponentWithTag(row, 'DIV');
- expect(rowNode.className).toBe('row');
+ expect(rowNode.className).toBe('ant-row');
});
});