From bccf36798b122a2967160cdbf496e7545be69dfd Mon Sep 17 00:00:00 2001 From: afc163 Date: Fri, 27 Nov 2015 15:47:46 +0800 Subject: [PATCH] Updates --- changelog.html | 5 +- components/affix/index.html | 3 +- components/alert/index.html | 3 +- components/badge/ScrollNumber.jsx | 4 +- components/badge/index.html | 3 +- components/breadcrumb/index.html | 3 +- components/button/index.html | 3 +- components/calendar/index.html | 3 +- components/carousel/index.html | 3 +- components/checkbox/index.html | 3 +- components/collapse/index.html | 3 +- components/datepicker/index.html | 3 +- components/dropdown/index.html | 3 +- components/form/index.html | 3 +- components/icon/index.html | 3 +- components/input-number/index.html | 3 +- components/layout/index.html | 3 +- components/menu/index.html | 3 +- components/message/index.html | 3 +- components/modal/index.html | 3 +- components/notification/index.html | 3 +- components/pagination/index.html | 3 +- components/popconfirm/index.html | 3 +- components/popover/index.html | 3 +- components/progress/index.html | 3 +- components/queue-anim/index.html | 3 +- components/radio/demo/radiobutton.html | 4 +- components/radio/group.jsx | 2 +- components/radio/index.html | 7 +- components/select/index.html | 3 +- components/slider/index.html | 3 +- components/spin/index.html | 3 +- components/steps/index.html | 3 +- components/switch/index.html | 3 +- components/table/index.html | 10 +- components/tabs/index.html | 3 +- components/tag/index.html | 3 +- components/timeline/index.html | 3 +- components/timepicker/index.html | 3 +- components/tooltip/index.html | 3 +- components/tree/demo/special.html | 2 +- components/tree/index.html | 5 +- components/upload/index.html | 3 +- components/validation/index.html | 3 +- dist/antd.js | 2407 ++++++------- dist/antd.js.map | 2 +- dist/demo.js | 4273 +++++++++++------------- dist/demo.js.map | 2 +- docs/getting-started.html | 5 +- docs/install.html | 3 +- docs/introduce.html | 3 +- docs/upgrade-to-0.10.html | 3 +- index.html | 3 +- readme-zh-cn.html | 3 +- spec/colors.html | 3 +- spec/easing.html | 3 +- spec/font.html | 3 +- spec/introduce.html | 3 +- spec/layout/index.html | 3 +- spec/motion.html | 3 +- spec/page-transition.html | 3 +- spec/pattern.html | 3 +- spec/tools.html | 3 +- spec/typography.html | 3 +- static/style.css | 1 + style/components/index.less | 1 - style/components/typography.less | 4 - style/core/color.less | 0 style/core/index.less | 1 - style/readme.html | 3 +- 70 files changed, 3153 insertions(+), 3738 deletions(-) delete mode 100644 style/components/typography.less delete mode 100644 style/core/color.less diff --git a/changelog.html b/changelog.html index b2b31abf1..3445d079f 100644 --- a/changelog.html +++ b/changelog.html @@ -20,7 +20,7 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ';\n domainInput = '';\n }\n return '\\n \\n \\n \\n \\n \\n ' + domainScript + '\\n \\n \\n
\\n \\n ' + domainInput + '\\n \\n
\\n \\n \\n ';\n },\n\n initIframeSrc: function initIframeSrc() {\n if (this.domain) {\n this.getIframeNode().src = 'javascript:void((function(){\\n var d = document;\\n d.open();\\n d.domain=\\'' + this.domain + '\\';\\n d.write(\\'\\');\\n d.close();\\n })())';\n }\n },\n\n initIframe: function initIframe() {\n var iframeNode = this.getIframeNode();\n var win = iframeNode.contentWindow;\n var doc = undefined;\n this.domain = this.domain || '';\n this.initIframeSrc();\n try {\n doc = win.document;\n } catch (e) {\n this.domain = document.domain;\n this.initIframeSrc();\n win = iframeNode.contentWindow;\n doc = win.document;\n }\n doc.open('text/html', 'replace');\n doc.write(this.getIframeHTML(this.domain));\n doc.close();\n this.getFormInputNode().onchange = this.onChange;\n },\n\n enableIframe: function enableIframe() {\n this.loading = false;\n this.getIframeNode().style.display = '';\n },\n\n disabledIframe: function disabledIframe() {\n this.loading = true;\n this.getIframeNode().style.display = 'none';\n },\n\n updateIframeWH: function updateIframeWH() {\n var rootNode = _reactDom2['default'].findDOMNode(this);\n var iframeNode = this.getIframeNode();\n iframeNode.style.height = rootNode.offsetHeight + 'px';\n iframeNode.style.width = rootNode.offsetWidth + 'px';\n },\n\n render: function render() {\n return _react2['default'].createElement(\n 'span',\n { style: { position: 'relative', zIndex: 0 } },\n _react2['default'].createElement('iframe', { ref: 'iframe',\n onLoad: this.onLoad,\n style: iframeStyle }),\n this.props.children\n );\n }\n});\n\nexports['default'] = IframeUploader;\nmodule.exports = exports['default'];\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/rc-upload/lib/IframeUploader.js\n ** module id = 354\n ** module chunks = 0\n **/","import React from 'react';\nimport Animate from 'rc-animate';\nimport Icon from '../icon';\nconst prefixCls = 'ant-upload';\nimport { Line } from '../progress';\n\nexport default React.createClass({\n getDefaultProps() {\n return {\n items: [],\n progressAttr: {\n strokeWidth: 3,\n showInfo: false\n }\n };\n },\n handleClose(file) {\n this.props.onRemove(file);\n },\n render() {\n let list = this.props.items.map((file) => {\n let progress;\n let infoUploadingClass = '';\n if (file.status === 'uploading') {\n progress =
\n \n
;\n infoUploadingClass = ' ' + prefixCls + '-list-item-uploading';\n }\n return (\n
\n
\n \n {file.name}\n \n
\n { progress }\n
\n );\n });\n return
\n \n {list}\n \n
;\n }\n});\n\n\n\n/** WEBPACK FOOTER **\n ** ./components/upload/uploadList.jsx\n **/","export default function getFileItem(file, fileList) {\n let matchWay = (!file.uid) ? 'byName' : 'byUid';\n let target = fileList.filter((item) => {\n if (matchWay === 'byName') {\n return item.name === file.name;\n } else {\n return item.uid === file.uid;\n }\n })[0];\n return target;\n}\n\n\n\n/** WEBPACK FOOTER **\n ** ./components/upload/getFileItem.js\n **/","import React from 'react';\nimport Animate from 'rc-animate';\nimport ScrollNumber from './ScrollNumber';\n\nclass AntBadge extends React.Component {\n constructor(props) {\n super(props);\n }\n\n render() {\n let { count, prefixCls } = this.props;\n const dot = this.props.dot;\n\n count = count >= 100 ? '99+' : count;\n\n // dot mode don't need count\n if (dot) {\n count = '';\n }\n\n // null undefined \"\" \"0\" 0\n const hidden = (!count || count === '0') && !dot;\n const className = prefixCls + (dot ? '-dot' : '-count');\n\n return (\n \n {this.props.children}\n \n {\n hidden ? null :\n \n }\n \n \n );\n }\n}\n\nAntBadge.defaultProps = {\n prefixCls: 'ant-badge',\n count: null,\n dot: false,\n};\n\nAntBadge.propTypes = {\n count: React.PropTypes.oneOfType([\n React.PropTypes.string,\n React.PropTypes.number\n ]),\n dot: React.PropTypes.bool,\n};\n\nexport default AntBadge;\n\n\n\n/** WEBPACK FOOTER **\n ** ./components/badge/index.jsx\n **/","import React, { createElement } from 'react';\nimport assign from 'object-assign';\n\nfunction getNumberArray(num) {\n return num ?\n num.toString().split('').reverse().map(i => Number(i)) : [];\n}\n\nclass AntScrollNumber extends React.Component {\n constructor(props) {\n super(props);\n this.state = {\n animateStarted: true,\n count: props.count\n };\n }\n\n getPositionByNum(num, i) {\n if (this.state.animateStarted) {\n return 10 + num;\n }\n const currentDigit = getNumberArray(this.state.count)[i];\n const lastDigit = getNumberArray(this.lastCount)[i];\n // 同方向则在同一侧切换数字\n if (this.state.count > this.lastCount) {\n if (currentDigit >= lastDigit) {\n return 10 + num;\n } else {\n return 20 + num;\n }\n } else {\n if (currentDigit <= lastDigit) {\n return 10 + num;\n } else {\n return num;\n }\n }\n }\n\n componentWillReceiveProps(nextProps) {\n if ('count' in nextProps && nextProps.count) {\n if (this.lastCount === this.state.count) {\n return;\n }\n this.lastCount = this.state.count;\n // 复原数字初始位置\n this.setState({\n animateStarted: true,\n }, () => {\n // 等待数字位置复原完毕\n // 开始设置完整的数字\n setTimeout(() => {\n this.setState({\n animateStarted: false,\n count: nextProps.count,\n }, () => {\n this.props.onAnimated();\n });\n }, 5);\n });\n }\n }\n\n renderNumberList() {\n const childrenToReturn = [];\n for (let i = 0; i < 30; i++) {\n childrenToReturn.push(

{i % 10}

);\n }\n return childrenToReturn;\n }\n\n renderCurrentNumber(num, i) {\n const position = this.getPositionByNum(num, i);\n const height = this.props.height;\n const removeTransition = this.state.animateStarted ||\n (getNumberArray(this.lastCount)[i] === undefined);\n return createElement('span', {\n className: `${this.props.prefixCls}-only`,\n style: {\n transition: removeTransition && 'none',\n transform: 'translate3d(0, ' + (-position * height) + 'px, 0)',\n height: height,\n },\n key: i,\n }, this.renderNumberList());\n }\n\n renderNumberElement() {\n const state = this.state;\n if (!state.count || isNaN(state.count)) {\n return state.count;\n }\n return getNumberArray(state.count)\n .map((num, i) => this.renderCurrentNumber(num, i)).reverse();\n }\n\n render() {\n const props = assign({}, this.props, {\n className: `${this.props.prefixCls} ${this.props.className}`\n });\n if (typeof document !== 'undefined' && typeof window !== 'undefined') {\n return createElement(\n this.props.component,\n props,\n this.renderNumberElement()\n );\n } else {\n return createElement(\n this.props.component,\n props,\n props.count\n );\n }\n }\n}\n\nAntScrollNumber.defaultProps = {\n prefixCls: 'ant-scroll-number',\n count: null,\n component: 'sup',\n onAnimated: function() {},\n height: 20\n};\n\nAntScrollNumber.propTypes = {\n count: React.PropTypes.oneOfType([\n React.PropTypes.string,\n React.PropTypes.number\n ]),\n component: React.PropTypes.string,\n onAnimated: React.PropTypes.func,\n height: React.PropTypes.number,\n};\n\nexport default AntScrollNumber;\n\n\n\n/** WEBPACK FOOTER **\n ** ./components/badge/ScrollNumber.jsx\n **/","import React from 'react';\nimport Menu from 'rc-menu';\nimport animation from '../common/openAnimation';\n\nfunction noop() {\n}\n\nconst AntMenu = React.createClass({\n getDefaultProps() {\n return {\n prefixCls: 'ant-menu',\n onClick: noop,\n onOpen: noop,\n onClose: noop,\n className: '',\n theme: 'light', // or dark\n };\n },\n getInitialState() {\n return {\n openKeys: []\n };\n },\n handleClick(e) {\n this.setState({\n openKeys: []\n });\n this.props.onClick(e);\n },\n handleOpenKeys(e) {\n this.setState({\n openKeys: e.openKeys\n });\n this.props.onOpen();\n },\n handleCloseKeys(e) {\n this.setState({\n openKeys: e.openKeys\n });\n this.props.onClose();\n },\n render() {\n let openAnimation = '';\n switch (this.props.mode) {\n case 'horizontal':\n openAnimation = 'slide-up';\n break;\n case 'vertical':\n openAnimation = 'zoom-big';\n break;\n case 'inline':\n openAnimation = animation;\n break;\n default:\n }\n\n let props = {\n openKeys: this.state.openKeys,\n onClick: this.handleClick,\n onOpen: this.handleOpenKeys,\n onClose: this.handleCloseKeys,\n };\n const className = this.props.className + ' ' + this.props.prefixCls + '-' + this.props.theme;\n if (this.props.mode === 'inline') {\n return ;\n } else {\n return ;\n }\n }\n});\n\nAntMenu.Divider = Menu.Divider;\nAntMenu.Item = Menu.Item;\nAntMenu.SubMenu = Menu.SubMenu;\n\nexport default AntMenu;\n\n\n\n/** WEBPACK FOOTER **\n ** ./components/menu/index.jsx\n **/","import React from 'react';\n\nlet Timeline = React.createClass({\n getDefaultProps() {\n return {\n prefixCls: 'ant-timeline'\n };\n },\n render() {\n let children = this.props.children;\n return (\n
    \n {React.Children.map(children, function (ele, idx) {\n let np = {\n timelineLast: idx === children.length - 1,\n pending: this.props.pending\n };\n return React.cloneElement(ele, np);\n }, this)}\n
\n );\n }\n});\n\nTimeline.Item = React.createClass({\n getDefaultProps() {\n return {\n prefixCls: 'ant-timeline',\n color: 'blue',\n pending: false\n };\n },\n render() {\n let props = this.props;\n let prefixCls = props.prefixCls;\n let color = props.color;\n let pending = props.pending;\n let timelineLast = props.timelineLast;\n let endCls = pending && timelineLast ? prefixCls + '-item-last' : '';\n let last = pending && timelineLast ?
: null;\n let lastTailShow = (timelineLast && !pending) ? 'none' : 'block';\n\n return (\n
  • \n
    \n
    \n
    {props.children}
    \n {last}\n
  • \n );\n }\n});\n\nexport default Timeline;\n\n\n\n/** WEBPACK FOOTER **\n ** ./components/timeline/index.jsx\n **/","import { Row } from '../layout';\nexport default Row;\n\n\n\n/** WEBPACK FOOTER **\n ** ./components/row/index.js\n **/","import Row from './row';\nimport Col from './col';\n\nexport {\n Row,\n Col,\n};\n\n\n\n/** WEBPACK FOOTER **\n ** ./components/layout/index.jsx\n **/","import React from 'react';\nimport classNames from 'classnames';\n\nconst Row = React.createClass({\n propTypes: {\n type: React.PropTypes.string,\n align: React.PropTypes.string,\n justify: React.PropTypes.string,\n className: React.PropTypes.string,\n children: React.PropTypes.node,\n },\n render() {\n const { type, justify, align, className, ...others } = this.props;\n const classes = classNames({\n 'row': true,\n ['row-' + type]: type,\n ['row-' + type + '-' + justify]: justify,\n ['row-' + type + '-' + align]: align,\n [className]: className,\n });\n return
    { this.props.children }
    ;\n },\n});\n\nexport default Row;\n\n\n\n/** WEBPACK FOOTER **\n ** ./components/layout/row.jsx\n **/","import React from 'react';\nimport classNames from 'classnames';\n\nconst Col = React.createClass({\n propTypes: {\n span: React.PropTypes.string,\n order: React.PropTypes.string,\n offset: React.PropTypes.string,\n push: React.PropTypes.string,\n pull: React.PropTypes.string,\n className: React.PropTypes.string,\n children: React.PropTypes.node,\n },\n render() {\n const {span, order, offset, push, pull, className, ...others} = this.props;\n const classes = classNames({\n ['col-' + span]: span,\n ['col-order-' + order]: order,\n ['col-offset-' + offset]: offset,\n ['col-push-' + push]: push,\n ['col-pull-' + pull]: pull,\n [className]: className,\n });\n return
    { this.props.children }
    ;\n },\n});\n\nexport default Col;\n\n\n\n/** WEBPACK FOOTER **\n ** ./components/layout/col.jsx\n **/","import { Col } from '../layout';\nexport default Col;\n\n\n\n/** WEBPACK FOOTER **\n ** ./components/col/index.js\n **/","import Form from './Form';\nimport FormItem from './FormItem';\nimport ValueMixin from './ValueMixin';\nimport Input from '../input';\n\nForm.Item = FormItem;\nForm.ValueMixin = ValueMixin;\n\n// 对于 import { Form, Input } from 'antd/lib/form/';\n// 的方式做向下兼容\n// https://github.com/ant-design/ant-design/pull/566\nForm.Form = Form;\nForm.Input = Input;\n\nexport default Form;\n\n\n\n/** WEBPACK FOOTER **\n ** ./components/form/index.jsx\n **/","import React from 'react';\nimport classNames from 'classnames';\n\nclass Form extends React.Component {\n render() {\n const prefixCls = this.props.prefixCls;\n const formClassName = {\n [`${prefixCls}-horizontal`]: this.props.horizontal,\n [`${prefixCls}-inline`]: this.props.inline,\n };\n const classes = classNames(formClassName);\n\n return (\n
    \n {this.props.children}\n
    \n );\n }\n}\n\nForm.propTypes = {\n prefixCls: React.PropTypes.string,\n horizontal: React.PropTypes.bool,\n inline: React.PropTypes.bool,\n children: React.PropTypes.any,\n onSubmit: React.PropTypes.func,\n};\n\nForm.defaultProps = {\n prefixCls: 'ant-form',\n};\n\nmodule.exports = Form;\n\n\n\n/** WEBPACK FOOTER **\n ** ./components/form/Form.jsx\n **/","import React from 'react';\nimport classNames from 'classnames';\n\nfunction prefixClsFn(prefixCls, ...args) {\n return args.map((s)=> {\n return prefixCls + '-' + s;\n }).join(' ');\n}\n\nclass FormItem extends React.Component {\n _getLayoutClass(colDef) {\n if (!colDef) {\n return '';\n }\n const {span, offset} = colDef;\n const col = span ? 'col-' + span : '';\n const offsetCol = offset ? ' col-offset-' + offset : '';\n return col + offsetCol;\n }\n\n renderHelp() {\n const prefixCls = this.props.prefixCls;\n return (\n
    \n {this.props.help}\n
    \n );\n }\n\n renderValidateWrapper(c1, c2) {\n let classes = '';\n if (this.props.validateStatus) {\n classes = classNames(\n {\n 'has-feedback': this.props.hasFeedback,\n 'has-success': this.props.validateStatus === 'success',\n 'has-warning': this.props.validateStatus === 'warning',\n 'has-error': this.props.validateStatus === 'error',\n 'is-validating': this.props.validateStatus === 'validating',\n }\n );\n }\n return (\n
    \n {c1} {c2}\n
    \n );\n }\n\n renderWrapper(children) {\n const wrapperCol = this.props.wrapperCol;\n return (\n
    \n {children}\n
    \n );\n }\n\n renderLabel() {\n const labelCol = this.props.labelCol;\n const required = this.props.required ? 'required' : '';\n\n return this.props.label ? (\n \n ) : null;\n }\n\n renderChildren() {\n return [\n this.renderLabel(),\n this.renderWrapper(\n this.renderValidateWrapper(\n this.props.children,\n this.renderHelp()\n )\n ),\n ];\n }\n\n // 判断是否要 `.ant-form-item-compact` 样式类\n _isCompact(children) {\n const compactControls = ['checkbox', 'radio', 'radio-group', 'static', 'file'];\n let isCompact = false;\n\n if (!Array.isArray(children)) {\n children = [children];\n }\n children.map((child, i) => {\n const type = child.props && child.props.type;\n let prefixCls = child.props && child.props.prefixCls;\n prefixCls = prefixCls ? prefixCls.substring(prefixCls.indexOf('-') + 1) : '';\n\n if ((type && compactControls.indexOf(type) > -1) || (prefixCls && compactControls.indexOf(prefixCls) > -1)) {\n isCompact = true;\n } else if (child.props && typeof child.props.children === 'object') {\n isCompact = this._isCompact(child.props.children);\n }\n });\n\n return isCompact;\n }\n\n renderFormItem(children) {\n const props = this.props;\n const prefixCls = props.prefixCls;\n const itemClassName = {\n [`${prefixCls}-item`]: true,\n [`${prefixCls}-item-compact`]: this._isCompact(props.children),\n };\n\n return (\n
    \n {children}\n
    \n );\n }\n\n render() {\n const children = this.renderChildren();\n return this.renderFormItem(children);\n }\n}\n\nFormItem.propTypes = {\n prefixCls: React.PropTypes.string,\n label: React.PropTypes.node,\n labelCol: React.PropTypes.object,\n help: React.PropTypes.node,\n validateStatus: React.PropTypes.oneOf(['', 'success', 'warning', 'error', 'validating']),\n hasFeedback: React.PropTypes.bool,\n wrapperCol: React.PropTypes.object,\n className: React.PropTypes.string,\n children: React.PropTypes.node,\n};\n\nFormItem.defaultProps = {\n hasFeedback: false,\n required: false,\n prefixCls: 'ant-form',\n};\n\nmodule.exports = FormItem;\n\n\n\n/** WEBPACK FOOTER **\n ** ./components/form/FormItem.jsx\n **/","function merge() {\n const ret = {};\n const args = [].slice.call(arguments, 0);\n args.forEach((a)=> {\n Object.keys(a).forEach((k)=> {\n ret[k] = a[k];\n });\n });\n return ret;\n}\n\nconst ValueMixin = {\n setValue(field, e) {\n let v = e;\n const target = e && e.target;\n if (target) {\n if ((target.nodeName + '').toLowerCase() === 'input' &&\n target.type === 'checkbox') {\n v = target.checked;\n } else {\n v = e.target.value;\n }\n }\n const newFormData = {};\n newFormData[field] = v;\n this.setState({\n formData: merge(this.state.formData, newFormData),\n });\n },\n};\n\nexport default ValueMixin;\n\n\n\n/** WEBPACK FOOTER **\n ** ./components/form/ValueMixin.jsx\n **/","import React from 'react';\n\nfunction prefixClsFn(prefixCls, ...args) {\n return args.map((s)=> {\n return prefixCls + '-' + s;\n }).join(' ');\n}\n\nfunction ieGT9() {\n if (typeof document === undefined) {\n return false;\n }\n const documentMode = document.documentMode || 0;\n return documentMode > 9;\n}\n\nclass Group extends React.Component {\n render() {\n return (\n
    \n {this.props.children}\n
    \n );\n }\n}\n\nGroup.propTypes = {\n className: React.PropTypes.string,\n children: React.PropTypes.any,\n};\n\nGroup.defaultProps = {\n className: 'ant-input-group',\n};\n\n\nclass Input extends React.Component {\n renderLabledInput(children) {\n const props = this.props;\n const wrapperClassName = prefixClsFn(props.prefixCls, 'input-group');\n const addonClassName = prefixClsFn(wrapperClassName, 'addon');\n const addonBefore = props.addonBefore ? (\n \n {props.addonBefore}\n \n ) : null;\n\n const addonAfter = props.addonAfter ? (\n \n {props.addonAfter}\n \n ) : null;\n\n return (\n
    \n {addonBefore}\n {children}\n {addonAfter}\n
    \n );\n }\n\n renderInput() {\n const props = this.props;\n const prefixCls = props.prefixCls;\n let inputClassName = prefixClsFn(prefixCls, 'input');\n if (!props.type) {\n return props.children;\n }\n\n switch (props.size) {\n case 'small': inputClassName = prefixClsFn(prefixCls, 'input', 'input-sm'); break;\n case 'large': inputClassName = prefixClsFn(prefixCls, 'input', 'input-lg'); break;\n default:\n }\n let placeholder = props.placeholder;\n if(placeholder && ieGT9()){\n placeholder = null;\n }\n switch (props.type) {\n case 'textarea':\n return