Merge branch 'master' into antd-3.0

This commit is contained in:
afc163 2017-09-20 17:13:32 +08:00
commit 2f7b75562c
9 changed files with 45 additions and 22 deletions

View File

@ -21,9 +21,11 @@ If you want to read change logs before `2.0.0`, please visit [GitHub](https://gi
`2017-09-15`
- 🐞 Fixed Form `getFieldDecoratorOptions` missing property of `normalize` and `validateFirst`. [#7552](https://github.com/ant-design/ant-design/issues/7552) [@meteor91](https://github.com/meteor91) [@mitchelldemler](https://github.com/mitchelldemler)
- 🐞 Fix title and extra content position of narrow Card. [#7604](https://github.com/ant-design/ant-design/issues/7604)
- 🐞 Revert [#7142](https://github.com/ant-design/ant-design/issues/7142) to fixing empty style of Table.
- 🐞 Fix inlineCollapsed style of MenuItemGroup. [#7109](https://github.com/ant-design/ant-design/issues/7109)
- 🐞 Revert [#7142](https://github.com/ant-design/ant-design/issues/7142) to fix empty data style of Table.
- 🐞 Fix Form `getFieldDecoratorOptions` missing types of `normalize` and `validateFirst`. [#7552](https://github.com/ant-design/ant-design/issues/7552) [@meteor91](https://github.com/meteor91) [@mitchelldemler](https://github.com/mitchelldemler)
- 🐞 Fix Modal `zIndex` type. [#7624](https://github.com/ant-design/ant-design/issues/7624)
- 🌟 Improve tree node loading icon position. [#7584](https://github.com/ant-design/ant-design/issues/7584)
- 🌟 Update a lot of components's English doc. [@khalibloo](https://github.com/khalibloo)

View File

@ -21,9 +21,11 @@ timeline: true
`2017-09-15`
- 🐞 修复了 Form `getFieldDecoratorOptions` 缺失 `normalize` 以及 `validateFirst` 属性定义的问题。[#7552](https://github.com/ant-design/ant-design/issues/7552) [@meteor91](https://github.com/meteor91) [@mitchelldemler](https://github.com/mitchelldemler)
- 🐞 修复了 Card Extra 内容过多样式错乱的问题。[#7604](https://github.com/ant-design/ant-design/issues/7604)
- 🐞 修复了分组 Menu 收缩时的错位问题。[#7109](https://github.com/ant-design/ant-design/issues/7109)
- 🐞 回滚 [#7142](https://github.com/ant-design/ant-design/issues/7142) 里对固定列表格空数据的样式优化,修复带来的一系列样式问题。
- 🐞 修复了 Form `getFieldDecoratorOptions` 缺失 `normalize` 以及 `validateFirst` 属性定义的问题。[#7552](https://github.com/ant-design/ant-design/issues/7552) [@meteor91](https://github.com/meteor91) [@mitchelldemler](https://github.com/mitchelldemler)
- 🐞 修复了 Modal 的 `zIndex` 属性定义。[#7624](https://github.com/ant-design/ant-design/issues/7624)
- 🌟 优化了 Tree 加载中图标的显示位置。[#7584](https://github.com/ant-design/ant-design/issues/7584)
- 🌟 优化了大量组件的英文文档。[@khalibloo](https://github.com/khalibloo)

View File

@ -161,7 +161,7 @@ export default class Affix extends React.Component<AffixProps, any> {
});
this.setPlaceholderStyle({
width,
height: affixNode.offsetHeight,
height: elemSize.height,
});
} else if (
scrollTop < elemOffset.top + elemSize.height + (offsetBottom as number) - targetInnerHeight &&
@ -178,7 +178,7 @@ export default class Affix extends React.Component<AffixProps, any> {
});
this.setPlaceholderStyle({
width,
height: affixNode.offsetHeight,
height: elemOffset.height,
});
} else {
const { affixStyle } = this.state;

View File

@ -251,6 +251,9 @@
}
&&-compact {
display: inline-block;
.clearfix;
& > * {
border-radius: 0;
border-right-width: 0;

View File

@ -202,7 +202,7 @@
}
&-middle {
.@{table-prefix-cls}-thead > tr > th:not(.@{table-prefix-cls}-selection-column),
.@{table-prefix-cls}-thead > tr > th,
.@{table-prefix-cls}-tbody > tr > td {
padding: 10px 8px;
}

View File

@ -123,6 +123,8 @@
"mockdate": "^2.0.1",
"moment-timezone": "^0.5.5",
"pre-commit": "^1.2.2",
"preact": "^8.2.5",
"preact-compat": "^3.17.0",
"querystring": "^0.2.0",
"rc-queue-anim": "^1.0.1",
"rc-scroll-anim": "^1.0.3",
@ -160,7 +162,8 @@
"dist": "antd-tools run dist",
"compile": "antd-tools run compile",
"tsc": "tsc",
"start": "cross-env NODE_ENV=development node ./scripts/generateColorLess.js && bisheng start -c ./site/bisheng.config.js --no-livereload",
"start": "node ./scripts/generateColorLess.js && cross-env NODE_ENV=development bisheng start -c ./site/bisheng.config.js --no-livereload",
"start:preact": "node ./scripts/generateColorLess.js && cross-env NODE_ENV=development REACT_ENV=preact bisheng start -c ./site/bisheng.config.js --no-livereload",
"site": "cross-env NODE_ENV=production bisheng build --ssr -c ./site/bisheng.config.js",
"deploy": "antd-tools run clean && npm run site && node ./scripts/generateColorLess.js && bisheng gh-pages --push-only",
"pub": "antd-tools run pub",

View File

@ -2,6 +2,7 @@ const path = require('path');
const CSSSplitWebpackPlugin = require('css-split-webpack-plugin').default;
const isDev = process.env.NODE_ENV === 'development';
const usePreact = process.env.REACT_ENV === 'preact';
module.exports = {
port: 8001,
@ -65,11 +66,21 @@ module.exports = {
config.externals = {
'react-router-dom': 'ReactRouterDOM',
};
if (isDev) {
Object.assign(config.externals, {
if (usePreact) {
config.resolve.alias = {
...config.resolve.alias,
react: 'preact-compat',
'react-dom': 'preact-compat',
'create-react-class': 'preact-compat/lib/create-react-class',
'react-router': 'react-router',
};
} else {
config.externals = {
...config.externals,
react: 'React',
'react-dom': 'ReactDOM',
});
};
}
config.babel.plugins.push([
@ -84,7 +95,9 @@ module.exports = {
return config;
},
htmlTemplateExtraData: {
isDev,
usePreact,
},
};

View File

@ -109,13 +109,15 @@
</head>
<body>
<div id="react-content">
{% if isDev %}
<script src="https://as.alipayobjects.com/g/component/??react/15.6.1/react.js,react/15.6.1/react-dom.js"></script>
{% else %}
<script src="https://as.alipayobjects.com/g/component/??react/15.6.1/react.min.js,react/15.6.1/react-dom.min.js"></script>
{% endif %}
{{ content | safe }}
</div>
{% if not usePreact %}
{% if isDev %}
<script src="https://as.alipayobjects.com/g/component/??react/15.6.1/react.js,react/15.6.1/react-dom.js"></script>
{% else %}
<script src="https://as.alipayobjects.com/g/component/??react/15.6.1/react.min.js,react/15.6.1/react-dom.min.js"></script>
{% endif %}
{% endif %}
<script src="{{ root }}common.js"></script>
<script src="{{ root }}index.js"></script>
</body>

View File

@ -170,22 +170,20 @@ export default class MainContent extends React.Component {
}
flattenMenu(menu) {
if (menu.type === Menu.Item) {
if (menu && menu.type && !menu.type.isSubMenu && !menu.type.isMenuItemGroup) {
return menu;
}
if (Array.isArray(menu)) {
return menu.reduce((acc, item) => acc.concat(this.flattenMenu(item)), []);
}
return this.flattenMenu(menu.props.children);
return this.flattenMenu((menu.props && menu.props.children) || menu.children);
}
getFooterNav(menuItems, activeMenuItem) {
const menuItemsList = this.flattenMenu(menuItems);
let activeMenuItemIndex = -1;
menuItemsList.forEach((menuItem, i) => {
if (menuItem.key === activeMenuItem) {
if (menuItem && menuItem.key === activeMenuItem) {
activeMenuItemIndex = i;
}
});
@ -236,12 +234,12 @@ export default class MainContent extends React.Component {
<section className="prev-next-nav">
{
prev ?
React.cloneElement(prev.props.children, { className: 'prev-page' }) :
React.cloneElement(prev.props.children || prev.children[0], { className: 'prev-page' }) :
null
}
{
next ?
React.cloneElement(next.props.children, { className: 'next-page' }) :
React.cloneElement(next.props.children || next.children[0], { className: 'next-page' }) :
null
}
</section>