Comparing version 0.9.1-beta1 to 0.9.1-beta10
@@ -9,3 +9,3 @@ # 更新日志 | ||
* 新增 [timeline](http://ant.design/components/timeline) 和 [badge](http://ant.design/components/badge) 组件。 | ||
* 新增 [timeline](components/timeline/) 和 [badge](components/badge/) 组件。 | ||
* 优化弹出层类组件的动画效果,使其更加流畅。 | ||
@@ -12,0 +12,0 @@ * 部分文案更新。 |
@@ -54,19 +54,14 @@ 'use strict'; | ||
propTypes: { | ||
router: _react2['default'].PropTypes.object | ||
router: _react2['default'].PropTypes.object, | ||
routes: _react2['default'].PropTypes.array, | ||
params: _react2['default'].PropTypes.object | ||
}, | ||
contextTypes: { | ||
router: _react2['default'].PropTypes.object | ||
}, | ||
render: function render() { | ||
var _this = this; | ||
var crumbs = undefined, | ||
routes = undefined, | ||
params = undefined; | ||
var crumbs = undefined; | ||
var ReactRouter = this.props.router; | ||
if (this.context.router && ReactRouter) { | ||
var routes = this.props.routes; | ||
var params = this.props.params; | ||
if (routes && routes.length > 0 && ReactRouter) { | ||
(function () { | ||
var Link = ReactRouter.Link; | ||
routes = _this.context.router.state.branch; | ||
params = _this.context.router.state.params; | ||
crumbs = routes.map(function (route, i) { | ||
@@ -77,2 +72,3 @@ var name = route.breadcrumbName.replace(/\:(.*)/g, function (replacement, key) { | ||
var link = undefined; | ||
var path = route.path.indexOf('/') === 0 ? route.path : '/' + route.path; | ||
if (i === routes.length - 1) { | ||
@@ -87,3 +83,3 @@ link = _react2['default'].createElement( | ||
Link, | ||
{ to: route.path, params: params }, | ||
{ to: path, params: params }, | ||
name | ||
@@ -90,0 +86,0 @@ ); |
@@ -54,2 +54,2 @@ require('./index.css'); | ||
antd.version = '0.9.1-beta1'; | ||
antd.version = '0.9.1-beta10'; |
@@ -17,5 +17,6 @@ 'use strict'; | ||
var div = undefined; | ||
exports['default'] = function (props) { | ||
var div = document.createElement('div'); | ||
document.body.appendChild(div); | ||
exports['default'] = function (props) { | ||
var d = undefined; | ||
@@ -35,2 +36,3 @@ props = props || {}; | ||
}); | ||
_react2['default'].unmountComponentAtNode(div); | ||
} | ||
@@ -135,7 +137,2 @@ | ||
if (!div) { | ||
div = document.createElement('div'); | ||
document.body.appendChild(div); | ||
} | ||
_react2['default'].render(_react2['default'].createElement( | ||
@@ -142,0 +139,0 @@ _index2['default'], |
@@ -25,12 +25,18 @@ 'use strict'; | ||
size: 'default', | ||
maxDescriptionWidth: 100 | ||
maxDescriptionWidth: 100, | ||
current: 0 | ||
}; | ||
}, | ||
render: function render() { | ||
var maxDescriptionWidth = this.props.maxDescriptionWidth; | ||
if (this.props.direction === 'vertical') { | ||
maxDescriptionWidth = 'auto'; | ||
} | ||
return _react2['default'].createElement( | ||
_rcSteps2['default'], | ||
{ size: this.props.size, | ||
current: this.props.current, | ||
direction: this.props.direction, | ||
iconPrefix: this.props.iconPrefix, | ||
maxDescriptionWidth: this.props.maxDescriptionWidth, | ||
maxDescriptionWidth: maxDescriptionWidth, | ||
prefixCls: this.props.prefixCls }, | ||
@@ -37,0 +43,0 @@ this.props.children |
@@ -548,13 +548,15 @@ 'use strict'; | ||
var emptyText = undefined; | ||
var emptyClass = ''; | ||
if (!data || data.length === 0) { | ||
emptyText = _react2['default'].createElement( | ||
'div', | ||
{ className: 'ant-table-empty' }, | ||
{ className: 'ant-table-placeholder' }, | ||
_react2['default'].createElement('i', { className: 'anticon anticon-frown' }), | ||
'暂无数据' | ||
); | ||
emptyClass = ' ant-table-empty'; | ||
} | ||
return _react2['default'].createElement( | ||
'div', | ||
{ className: 'clearfix' }, | ||
{ className: 'clearfix' + emptyClass }, | ||
_react2['default'].createElement(_rcTable2['default'], _extends({}, this.props, { | ||
@@ -561,0 +563,0 @@ data: data, |
@@ -35,2 +35,17 @@ 'use strict'; | ||
// Fix IE file.status problem | ||
// via coping a new Object | ||
function fileToObject(file) { | ||
return { | ||
lastModified: file.lastModified, | ||
lastModifiedDate: file.lastModifiedDate, | ||
name: file.filename || file.name, | ||
size: file.size, | ||
type: file.type, | ||
uid: file.uid, | ||
response: file.response, | ||
error: file.error | ||
}; | ||
} | ||
var AntUpload = _react2['default'].createClass({ | ||
@@ -45,14 +60,18 @@ displayName: 'AntUpload', | ||
onStart: function onStart(file) { | ||
var targetItem = undefined; | ||
var nextFileList = this.state.fileList.concat(); | ||
if (file.length > 0) { | ||
file.forEach(function (f) { | ||
targetItem = file.map(function (f) { | ||
f = fileToObject(f); | ||
f.status = 'uploading'; | ||
return f; | ||
}); | ||
nextFileList = nextFileList.concat(file); | ||
} else { | ||
file.status = 'uploading'; | ||
nextFileList.push(file); | ||
targetItem = fileToObject(file); | ||
targetItem.status = 'uploading'; | ||
nextFileList.push(targetItem); | ||
} | ||
this.onChange({ | ||
file: file, | ||
file: targetItem, | ||
fileList: nextFileList | ||
@@ -62,3 +81,3 @@ }); | ||
removeFile: function removeFile(file) { | ||
var fileList = this.state.fileList.concat(); | ||
var fileList = this.state.fileList; | ||
var targetItem = (0, _getFileItem2['default'])(file, fileList); | ||
@@ -73,3 +92,13 @@ var index = fileList.indexOf(targetItem); | ||
onSuccess: function onSuccess(response, file) { | ||
var fileList = this.state.fileList.concat(); | ||
// 服务器端需要返回标准 json 字符串 | ||
// 否则视为失败 | ||
try { | ||
if (typeof response === 'string') { | ||
JSON.parse(response); | ||
} | ||
} catch (e) { | ||
this.onError(new Error('No response'), response, file); | ||
return; | ||
} | ||
var fileList = this.state.fileList; | ||
var targetItem = (0, _getFileItem2['default'])(file, fileList); | ||
@@ -82,3 +111,3 @@ // 之前已经删除 | ||
file: targetItem, | ||
fileList: this.state.fileList | ||
fileList: fileList | ||
}); | ||
@@ -99,6 +128,8 @@ } | ||
onError: function onError(error, response, file) { | ||
file.error = error; | ||
file.response = response; | ||
file.status = 'error'; | ||
this.handleRemove(file); | ||
var fileList = this.state.fileList; | ||
var targetItem = (0, _getFileItem2['default'])(file, fileList); | ||
targetItem.error = error; | ||
targetItem.response = response; | ||
targetItem.status = 'error'; | ||
this.handleRemove(targetItem); | ||
}, | ||
@@ -105,0 +136,0 @@ handleRemove: function handleRemove(file) { |
{ | ||
"name": "antd", | ||
"version": "0.9.1-beta1", | ||
"version": "0.9.1-beta10", | ||
"stableVersion": "0.9.0", | ||
@@ -36,3 +36,3 @@ "title": "Ant Design", | ||
"css-animation": "~1.1.0", | ||
"enter-animation": "~0.4.9", | ||
"enter-animation": "~0.5.0", | ||
"gregorian-calendar": "~3.0.0", | ||
@@ -49,3 +49,3 @@ "gregorian-calendar-format": "~3.0.1", | ||
"rc-input-number": "~2.0.1", | ||
"rc-menu": "~4.4.2", | ||
"rc-menu": "~4.6.0", | ||
"rc-notification": "~1.1.0", | ||
@@ -57,3 +57,3 @@ "rc-pagination": "~1.1.0", | ||
"rc-slider": "~1.4.0", | ||
"rc-steps": "~1.2.3", | ||
"rc-steps": "~1.3.2", | ||
"rc-switch": "~1.2.0", | ||
@@ -64,3 +64,3 @@ "rc-table": "~3.2.0", | ||
"rc-tree": "~0.15.4", | ||
"rc-upload": "~1.4.0", | ||
"rc-upload": "~1.5.0", | ||
"rc-util": "~2.0.3", | ||
@@ -73,3 +73,3 @@ "react-slick": "~0.7.0", | ||
"devDependencies": { | ||
"autoprefixer-loader": "^2.0.0", | ||
"autoprefixer-loader": "^3.1.0", | ||
"babel": "^5.8.12", | ||
@@ -95,3 +95,3 @@ "babel-core": "^5.8.12", | ||
"precommit-hook": "^1.0.7", | ||
"react-router": "1.0.0-beta3", | ||
"react-router": "1.0.0-rc1", | ||
"webpack": "^1.10.1", | ||
@@ -105,3 +105,4 @@ "webpack-dev-middleware": "^1.2.0" | ||
"clean": "rm -rf _site dist", | ||
"deploy": "rm -rf node_modules && node scripts/install.js && npm run clean && webpack && webpack --config webpack.config.min.js && NODE_ENV=PRODUCTION nico build && node scripts/deploy.js", | ||
"deploy": "rm -rf node_modules && node scripts/install.js && npm run just-deploy", | ||
"just-deploy": "npm run clean && webpack && webpack --config webpack.config.min.js && NODE_ENV=PRODUCTION nico build && node scripts/deploy.js", | ||
"lint": "eslint components index.js --ext '.js,.jsx'", | ||
@@ -108,0 +109,0 @@ "lesslint": "lesslint style", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
351285
12423
+ Addedenter-animation@0.5.0(transitive)
+ Addedrc-menu@4.6.2(transitive)
+ Addedrc-steps@1.3.3(transitive)
+ Addedrc-upload@1.5.9(transitive)
- Removedenter-animation@0.4.9(transitive)
- Removedrc-menu@4.4.5(transitive)
- Removedrc-steps@1.2.4(transitive)
- Removedrc-upload@1.4.4(transitive)
Updatedenter-animation@~0.5.0
Updatedrc-menu@~4.6.0
Updatedrc-steps@~1.3.2
Updatedrc-upload@~1.5.0