merge master

This commit is contained in:
zombiej 2018-11-30 14:48:37 +08:00
commit 9f5d421cd6
359 changed files with 1960 additions and 807 deletions

View File

@ -4,7 +4,6 @@ components/*/__tests__/type.tsx
!components/*/__tests__/**/*.js !components/*/__tests__/**/*.js
!components/*/demo/* !components/*/demo/*
!.*.js !.*.js
# Docs templates # Docs templates
site/theme/template/IconDisplay/*.js site/theme/template/IconDisplay/*.js
site/theme/template/IconDisplay/*.jsx site/theme/template/IconDisplay/*.jsx

View File

@ -14,33 +14,18 @@ const eslintrc = {
'babel', 'babel',
], ],
rules: { rules: {
'func-names': 0,
'arrow-body-style': 0,
'react/sort-comp': 0,
'react/prop-types': 0,
'react/jsx-first-prop-new-line': 0,
'react/jsx-one-expression-per-line': 0, 'react/jsx-one-expression-per-line': 0,
'react/prop-types': 0,
'react/forbid-prop-types': 0, 'react/forbid-prop-types': 0,
'import/no-extraneous-dependencies': ['error', {
devDependencies: ['site/**', 'tests/**', 'scripts/**', '**/*.test.js', '**/__tests__/*', '*.config.js', '**/*.md'],
}],
'react/jsx-filename-extension': [1, { extensions: ['.js', '.jsx', '.md'] }], 'react/jsx-filename-extension': [1, { extensions: ['.js', '.jsx', '.md'] }],
'import/extensions': 0,
'import/no-unresolved': 0,
'import/no-extraneous-dependencies': 0,
'prefer-destructuring': 0,
'no-param-reassign': 0,
'no-return-assign': 0,
'max-len': 0,
'consistent-return': 0,
'no-redeclare': 0,
'react/require-extension': 0,
'jsx-a11y/no-static-element-interactions': 0, 'jsx-a11y/no-static-element-interactions': 0,
'jsx-a11y/anchor-has-content': 0, 'jsx-a11y/anchor-has-content': 0,
'jsx-a11y/click-events-have-key-events': 0, 'jsx-a11y/click-events-have-key-events': 0,
'jsx-a11y/anchor-is-valid': 0, 'jsx-a11y/anchor-is-valid': 0,
'react/no-danger': 0,
'comma-dangle': ['error', 'always-multiline'], 'comma-dangle': ['error', 'always-multiline'],
'function-paren-newline': 0,
'object-curly-newline': 0,
'no-restricted-globals': 0,
}, },
}; };
@ -61,9 +46,13 @@ if (process.env.RUN_ENV === 'DEMO') {
'react/no-access-state-in-setstate': 0, 'react/no-access-state-in-setstate': 0,
'react/destructuring-assignment': 0, 'react/destructuring-assignment': 0,
'react/no-multi-comp': 0, 'react/no-multi-comp': 0,
'react/prefer-stateless-function': 0,
'jsx-a11y/href-no-hash': 0, 'jsx-a11y/href-no-hash': 0,
'import/newline-after-import': 0, 'prefer-destructuring': 0, // TODO: remove later
'max-len': 0, // TODO: remove later
'consistent-return': 0, // TODO: remove later
'no-return-assign': 0, // TODO: remove later
'no-param-reassign': 0, // TODO: remove later
'import/no-extraneous-dependencies': 0,
}); });
} }

View File

@ -1,5 +1,5 @@
<!-- <!--
⚠️ ⚠️ ⚠️ IMPORTANT: Please use the following link to create a new issue: ⚠️ ⚠️ ⚠️ IMPORTANT: Please use the following link to create a new issue: ⚠️ ⚠️ ⚠️
http://new-issue.ant.design http://new-issue.ant.design
@ -7,7 +7,7 @@ If your issue was not created using the app above, it will be closed immediately
--> -->
<!-- <!--
⚠️ ⚠️ ⚠️ 注意:请使用下面的链接来新建 issue ⚠️ ⚠️ ⚠️ 注意:请使用下面的链接来新建 issue ⚠️ ⚠️ ⚠️
http://new-issue.ant.design http://new-issue.ant.design

View File

@ -1,12 +1,12 @@
First of all, thank you for your contribution! :-) First of all, thank you for your contribution! :-)
Please makes sure that these checkboxes are checked before submitting your PR, thank you! Please makes sure that these checkboxes are checked before submitting your pull request, thank you!
* [ ] Make sure that you propose PR to right branch: bugfix for `master`, feature for branch `feature`. * [ ] Make sure that you propose pull request to right branch: bugfix for `master`, feature for branch `feature`.
* [ ] Make sure that you follow antd's [code convention](https://github.com/ant-design/ant-design/wiki/Code-convention-for-antd). * [ ] Make sure that you follow antd's [code convention](https://github.com/ant-design/ant-design/wiki/Code-convention-for-antd).
* [ ] Run `npm run lint` and fix those errors before submitting in order to keep consistent code style. * [ ] Run `npm run lint` and fix those errors before submitting in order to keep consistent code style.
* [ ] Rebase before creating a PR to keep commit history clear. * [ ] Rebase before creating a pull request to keep commit history clear.
* [ ] Add some descriptions and refer relative issues for you PR. * [ ] Add some descriptions and refer relative issues for you pull request.
Extra checklist: Extra checklist:

2
.gitignore vendored
View File

@ -38,8 +38,8 @@ components/**/*.jsx
!components/**/__tests__/*.js !components/**/__tests__/*.js
!components/**/__tests__/*.js.snap !components/**/__tests__/*.js.snap
/.history /.history
# Docs templates # Docs templates
site/theme/template/IconDisplay/*.js site/theme/template/IconDisplay/*.js
site/theme/template/IconDisplay/*.jsx site/theme/template/IconDisplay/*.jsx
site/theme/template/IconDisplay/fields.js site/theme/template/IconDisplay/fields.js
*.tmp

View File

@ -31,7 +31,7 @@ module.exports = {
'\\.js$': './node_modules/antd-tools/lib/jest/codePreprocessor', '\\.js$': './node_modules/antd-tools/lib/jest/codePreprocessor',
'\\.md$': './node_modules/antd-tools/lib/jest/demoPreprocessor', '\\.md$': './node_modules/antd-tools/lib/jest/demoPreprocessor',
}, },
testRegex: libDir === 'dist' ? 'demo\\.test\\.js$' : '.*\\.test\\.js$', testRegex: `${libDir === 'dist' ? 'demo' : '.*'}\\.test\\.js$`,
collectCoverageFrom: [ collectCoverageFrom: [
'components/**/*.{ts,tsx}', 'components/**/*.{ts,tsx}',
'!components/*/style/index.tsx', '!components/*/style/index.tsx',

View File

@ -1,3 +1,4 @@
// jest config for server render environment
module.exports = { module.exports = {
setupFiles: [ setupFiles: [
'./tests/setup.js', './tests/setup.js',

View File

@ -3,7 +3,7 @@ sudo: false
language: node_js language: node_js
node_js: node_js:
- 10 - 11
cache: cache:
directories: directories:

View File

@ -75,6 +75,7 @@ Cordaro <elvis07@163.com>
D & R <jdz321@qq.com> D & R <jdz321@qq.com>
Daewoong Moon <wiziple@gmail.com> Daewoong Moon <wiziple@gmail.com>
Damian Green <damian.green@microlease.com> Damian Green <damian.green@microlease.com>
Damian Green <damian@gcoders.com>
Dan Minshew <ofenixculpa@gmail.com> Dan Minshew <ofenixculpa@gmail.com>
Dane David <dndavid102@gmail.com> Dane David <dndavid102@gmail.com>
Daniel Gomez <dgomez@orangeloops.com> Daniel Gomez <dgomez@orangeloops.com>
@ -201,6 +202,7 @@ Knacktus <knacktus@gmail.com>
Kyle Kelley <rgbkrk@gmail.com> Kyle Kelley <rgbkrk@gmail.com>
Kyle Rosenberg <kyle.rosenberg@gmail.com> Kyle Rosenberg <kyle.rosenberg@gmail.com>
LLinFan- <catfoursi@qq.com> LLinFan- <catfoursi@qq.com>
Laith <laith24@gmail.com>
Larry Laski <larry.laski@gmail.com> Larry Laski <larry.laski@gmail.com>
LeeHarlan <709886167@qq.com> LeeHarlan <709886167@qq.com>
LeezQ <lizhenq2009@gmail.com> LeezQ <lizhenq2009@gmail.com>
@ -390,6 +392,7 @@ afc163 <afc163@gmail.com>
agent-z <1607291079@qq.com> agent-z <1607291079@qq.com>
ahalimkara <ahalimkara@gmail.com> ahalimkara <ahalimkara@gmail.com>
alex <379118572@qq.com> alex <379118572@qq.com>
arifemrecelik <ce.arifemre@gmail.com>
ascoders <576625322@qq.com> ascoders <576625322@qq.com>
ashishg-qburst <ashishg@qburst.com> ashishg-qburst <ashishg@qburst.com>
bLue <tbdblue@gmail.com> bLue <tbdblue@gmail.com>
@ -431,6 +434,7 @@ ezpub <ez.foro@gmail.com>
feng zhi hao <fzhihao@outlook.com> feng zhi hao <fzhihao@outlook.com>
fengmk2 <m@fengmk2.com> fengmk2 <m@fengmk2.com>
flashback313 <windmark2012@gmail.com> flashback313 <windmark2012@gmail.com>
frezc <504021398@qq.com>
genie <genie88@163.com> genie <genie88@163.com>
gregahren <grega.hren@gmail.com> gregahren <grega.hren@gmail.com>
guifu <picodoth@gmail.com> guifu <picodoth@gmail.com>
@ -546,6 +550,7 @@ snail <120216220@qq.com>
sojournerc <cmeyer@zvelo.com> sojournerc <cmeyer@zvelo.com>
sorrycc <sorrycc@gmail.com> sorrycc <sorrycc@gmail.com>
sosohime <theziming@126.com> sosohime <theziming@126.com>
spideeee <spideeee@github.com>
stickmy <stickmyc@gmail.com> stickmy <stickmyc@gmail.com>
swindme <swindme@163.com> swindme <swindme@163.com>
syssam <s.y.s.sam.sys@gmail.com> syssam <s.y.s.sam.sys@gmail.com>

View File

@ -19,13 +19,13 @@ timeline: true
`2018-11-24` `2018-11-24`
- 🌟 Checkbox provides status css class.[#13199](https://github.com/ant-design/ant-design/issues/13199) [@walker27](https://github.com/walker27) - 🐞 Fix disabled Checkbox label cursor style. [#13199](https://github.com/ant-design/ant-design/issues/13199) [@walker27](https://github.com/walker27)
- 🐞 Fix TimePicker input exceeds the boundary of container.[#13194](https://github.com/ant-design/ant-design/issues/13194) - 🐞 Fix TimePicker input exceeds the boundary of container. [#13194](https://github.com/ant-design/ant-design/issues/13194)
- 🌟 Adjust Table sort order from desc -> asc to asc -> desc.[#13069](https://github.com/ant-design/ant-design/pull/13069) [@OvestLabs](https://github.com/OvestLabs) - 🌟 Adjust Table sort order from `desc -> asc` to `asc -> desc`. [#13069](https://github.com/ant-design/ant-design/pull/13069) [@OvestLabs](https://github.com/OvestLabs)
- 🐞 Fix Switch can be operated when loading.[#13219](https://github.com/ant-design/ant-design/pull/13219) [@jojoLockLock](https://github.com/jojoLockLock) - 🐞 Fix Switch can be operated when loading. [#13219](https://github.com/ant-design/ant-design/pull/13219) [@jojoLockLock](https://github.com/jojoLockLock)
- 🐞 Fix Carousel can not be interactive in fade mode.[#13215](https://github.com/ant-design/ant-design/issues/13215) - 🐞 Fix Carousel can not be interactive in fade mode. [#13215](https://github.com/ant-design/ant-design/issues/13215)
- 🌟 DatePicker add `tabIndex` prop.[#13265](https://github.com/ant-design/ant-design/pull/13265) [@arifemrecelik](https://github.com/arifemrecelik) - 🐞 Fix DatePicker don't support `tabIndex` prop. [#13265](https://github.com/ant-design/ant-design/pull/13265) [@arifemrecelik](https://github.com/arifemrecelik)
- 🌟 TreeSelect do not call `loadData` when searching.[#13245](https://github.com/ant-design/ant-design/issues/13245) - 🐞 TreeSelect won't call `loadData` when searching to avoid lagging problem. [#13245](https://github.com/ant-design/ant-design/issues/13245)
# 3.10.8 # 3.10.8

View File

@ -19,13 +19,13 @@ timeline: true
`2018-11-24` `2018-11-24`
- 🌟 Checkbox 添加状态相关 css class。[#13199](https://github.com/ant-design/ant-design/issues/13199) [@walker27](https://github.com/walker27) - 🐞 修复 Checkbox 标签名鼠标失效样式没有生效的问题。[#13199](https://github.com/ant-design/ant-design/issues/13199) [@walker27](https://github.com/walker27)
- 🐞 修复 TimePicker 输入框超出边界的样式问题。[#13194](https://github.com/ant-design/ant-design/issues/13194) - 🐞 修复 TimePicker 输入框超出边界的样式问题。[#13194](https://github.com/ant-design/ant-design/issues/13194)
- 🌟 Table 排序调整为先升序后降序。[#13069](https://github.com/ant-design/ant-design/pull/13069) [@OvestLabs](https://github.com/OvestLabs) - 🌟 Table 排序调整为先升序后降序。[#13069](https://github.com/ant-design/ant-design/pull/13069) [@OvestLabs](https://github.com/OvestLabs)
- 🐞 修复 loading 状态下Switch 仍然可以被操作的问题。[#13219](https://github.com/ant-design/ant-design/pull/13219) [@jojoLockLock](https://github.com/jojoLockLock) - 🐞 修复 loading 状态下Switch 仍然可以被操作的问题。[#13219](https://github.com/ant-design/ant-design/pull/13219) [@jojoLockLock](https://github.com/jojoLockLock)
- 🐞 修复 Carousel 组件渐显效果下轮播区域无法点击的问题。[#13215](https://github.com/ant-design/ant-design/issues/13215) - 🐞 修复 Carousel 组件渐显效果下轮播区域无法点击的问题。[#13215](https://github.com/ant-design/ant-design/issues/13215)
- 🌟 DatePicker 添加 `tabIndex` 支持。[#13265](https://github.com/ant-design/ant-design/pull/13265) [@arifemrecelik](https://github.com/arifemrecelik) - 🐞 修复 DatePicker 对 `tabIndex` 属性的支持。[#13265](https://github.com/ant-design/ant-design/pull/13265) [@arifemrecelik](https://github.com/arifemrecelik)
- 🌟 TreeSelect 现在在搜索时不再调用 `loadData` 以避免卡死。[#13245](https://github.com/ant-design/ant-design/issues/13245) - 🐞 TreeSelect 现在在搜索时不再调用 `loadData` 以避免卡死。[#13245](https://github.com/ant-design/ant-design/issues/13245)
# 3.10.8 # 3.10.8

View File

@ -40,7 +40,7 @@ Project maintainers who do not follow or enforce the Code of Conduct in good fai
## Attribution ## Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version] This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version].
[homepage]: http://contributor-covenant.org [homepage]: http://contributor-covenant.org
[version]: http://contributor-covenant.org/version/1/4/ [version]: http://contributor-covenant.org/version/1/4/

View File

@ -1,6 +1,6 @@
MIT LICENSE MIT LICENSE
Copyright (c) 2015-present Alipay.com, https://www.alipay.com/ Copyright (c) 2015-present Ant UED, https://xtech.antfin.com/
Permission is hereby granted, free of charge, to any person obtaining Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the a copy of this software and associated documentation files (the

View File

@ -79,11 +79,11 @@ import 'antd/dist/antd.css'; // or 'antd/dist/antd.less'
- [组件库](http://ant.design/docs/react/introduce) - [组件库](http://ant.design/docs/react/introduce)
- [Ant Design Pro](http://pro.ant.design/) - [Ant Design Pro](http://pro.ant.design/)
- [更新日志](CHANGELOG.en-US.md) - [更新日志](CHANGELOG.en-US.md)
- [脚手架市场](http://scaffold.ant.design)
- [React 底层基础组件](http://react-component.github.io/) - [React 底层基础组件](http://react-component.github.io/)
- [移动端组件](http://mobile.ant.design) - [移动端组件](http://mobile.ant.design)
- [首页模板集](https://landing.ant.design)
- [动效](https://motion.ant.design) - [动效](https://motion.ant.design)
- [Landing 模板集](https://landing.ant.design) - [脚手架市场](http://scaffold.ant.design)
- [设计规范速查手册](https://github.com/ant-design/ant-design/wiki/Ant-Design-%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80%E7%AE%80%E7%89%88) - [设计规范速查手册](https://github.com/ant-design/ant-design/wiki/Ant-Design-%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80%E7%AE%80%E7%89%88)
- [开发者说明](https://github.com/ant-design/ant-design/wiki/Development) - [开发者说明](https://github.com/ant-design/ant-design/wiki/Development)
- [版本发布规则](https://github.com/ant-design/ant-design/wiki/%E8%BD%AE%E5%80%BC%E8%A7%84%E5%88%99%E5%92%8C%E7%89%88%E6%9C%AC%E5%8F%91%E5%B8%83%E6%B5%81%E7%A8%8B) - [版本发布规则](https://github.com/ant-design/ant-design/wiki/%E8%BD%AE%E5%80%BC%E8%A7%84%E5%88%99%E5%92%8C%E7%89%88%E6%9C%AC%E5%8F%91%E5%B8%83%E6%B5%81%E7%A8%8B)

View File

@ -79,11 +79,11 @@ See [i18n](http://ant.design/docs/react/i18n).
- [Components](http://ant.design/docs/react/introduce) - [Components](http://ant.design/docs/react/introduce)
- [Ant Design Pro](http://pro.ant.design/) - [Ant Design Pro](http://pro.ant.design/)
- [Change Log](CHANGELOG.en-US.md) - [Change Log](CHANGELOG.en-US.md)
- [Scaffold Market](http://scaffold.ant.design)
- [rc-components](http://react-component.github.io/) - [rc-components](http://react-component.github.io/)
- [Mobile UI](http://mobile.ant.design) - [Mobile UI](http://mobile.ant.design)
- [Landing Pages](https://landing.ant.design)
- [Motion](https://motion.ant.design) - [Motion](https://motion.ant.design)
- [Landing Templates](https://landing.ant.design) - [Scaffold Market](http://scaffold.ant.design)
- [Developer Instruction](https://github.com/ant-design/ant-design/wiki/Development) - [Developer Instruction](https://github.com/ant-design/ant-design/wiki/Development)
- [Versioning Release Note](https://github.com/ant-design/ant-design/wiki/%E8%BD%AE%E5%80%BC%E8%A7%84%E5%88%99%E5%92%8C%E7%89%88%E6%9C%AC%E5%8F%91%E5%B8%83%E6%B5%81%E7%A8%8B) - [Versioning Release Note](https://github.com/ant-design/ant-design/wiki/%E8%BD%AE%E5%80%BC%E8%A7%84%E5%88%99%E5%92%8C%E7%89%88%E6%9C%AC%E5%8F%91%E5%B8%83%E6%B5%81%E7%A8%8B)
- [FAQ](https://ant.design/docs/react/faq) - [FAQ](https://ant.design/docs/react/faq)

View File

@ -12,9 +12,7 @@ class AffixMounter extends React.Component {
}); });
} }
getTarget = () => { getTarget = () => this.container
return this.container;
}
render() { render() {
return ( return (
@ -34,7 +32,7 @@ class AffixMounter extends React.Component {
> >
<Affix <Affix
target={() => this.container} target={() => this.container}
ref={ele => this.affix = ele} ref={(ele) => { this.affix = ele; }}
{...this.props} {...this.props}
> >
<Button type="primary"> <Button type="primary">
@ -59,11 +57,9 @@ describe('Affix Render', () => {
}); });
const scrollTo = (top) => { const scrollTo = (top) => {
wrapper.instance().affix.fixedNode.parentNode.getBoundingClientRect = jest.fn(() => { wrapper.instance().affix.fixedNode.parentNode.getBoundingClientRect = jest.fn(() => ({
return { bottom: 100, height: 28, left: 0, right: 0, top: 50 - top, width: 195,
bottom: 100, height: 28, left: 0, right: 0, top: 50 - top, width: 195, }));
};
});
wrapper.instance().container.scrollTop = top; wrapper.instance().container.scrollTop = top;
events.scroll({ events.scroll({
type: 'scroll', type: 'scroll',

View File

@ -27,5 +27,6 @@ ReactDOM.render(
<br /> <br />
<Alert type="error" message="Error text" banner /> <Alert type="error" message="Error text" banner />
</div>, </div>,
mountNode); mountNode
);
```` ````

View File

@ -18,7 +18,8 @@ import { Alert } from 'antd';
ReactDOM.render( ReactDOM.render(
<Alert message="Success Text" type="success" />, <Alert message="Success Text" type="success" />,
mountNode); mountNode
);
```` ````
<style> <style>

View File

@ -16,7 +16,7 @@ To show close button.
````jsx ````jsx
import { Alert } from 'antd'; import { Alert } from 'antd';
const onClose = function (e) { const onClose = (e) => {
console.log(e, 'I was closed.'); console.log(e, 'I was closed.');
}; };
@ -36,5 +36,6 @@ ReactDOM.render(
onClose={onClose} onClose={onClose}
/> />
</div>, </div>,
mountNode); mountNode
);
```` ````

View File

@ -18,5 +18,6 @@ import { Alert } from 'antd';
ReactDOM.render( ReactDOM.render(
<Alert message="Info Text" type="info" closeText="Close Now" />, <Alert message="Info Text" type="info" closeText="Close Now" />,
mountNode); mountNode
);
```` ````

View File

@ -55,5 +55,6 @@ ReactDOM.render(
showIcon showIcon
/> />
</div>, </div>,
mountNode); mountNode
);
```` ````

View File

@ -39,5 +39,6 @@ ReactDOM.render(
type="error" type="error"
/> />
</div>, </div>,
mountNode); mountNode
);
```` ````

View File

@ -47,5 +47,6 @@ ReactDOM.render(
showIcon showIcon
/> />
</div>, </div>,
mountNode); mountNode
);
```` ````

View File

@ -46,5 +46,6 @@ class App extends React.Component {
ReactDOM.render( ReactDOM.render(
<App />, <App />,
mountNode); mountNode
);
```` ````

View File

@ -23,5 +23,6 @@ ReactDOM.render(
<Alert message="Warning Text" type="warning" /> <Alert message="Warning Text" type="warning" />
<Alert message="Error Text" type="error" /> <Alert message="Error Text" type="error" />
</div>, </div>,
mountNode); mountNode
);
```` ````

View File

@ -92,7 +92,7 @@ describe('Anchor Render', () => {
let anchorInstance = null; let anchorInstance = null;
function AnchorUpdate({ href }) { function AnchorUpdate({ href }) {
return ( return (
<Anchor ref={c => anchorInstance = c}> <Anchor ref={(c) => { anchorInstance = c; }}>
<Link href={href} title="API" /> <Link href={href} title="API" />
</Anchor> </Anchor>
); );
@ -107,7 +107,7 @@ describe('Anchor Render', () => {
it('Anchor onClick event', () => { it('Anchor onClick event', () => {
let event; let event;
let link; let link;
const handleClick = (...arg) => ([event, link] = arg); const handleClick = (...arg) => { [event, link] = arg; };
const href = '#API'; const href = '#API';
const title = 'API'; const title = 'API';

View File

@ -27,7 +27,8 @@ ReactDOM.render(
<Link href="#Link-Props" title="Link Props" /> <Link href="#Link-Props" title="Link Props" />
</Link> </Link>
</Anchor>, </Anchor>,
mountNode); mountNode
);
``` ```
<style> <style>

View File

@ -32,5 +32,6 @@ ReactDOM.render(
<Link href="#Link-Props" title="Link Props" /> <Link href="#Link-Props" title="Link Props" />
</Link> </Link>
</Anchor>, </Anchor>,
mountNode); mountNode
);
``` ```

View File

@ -27,5 +27,6 @@ ReactDOM.render(
<Link href="#Link-Props" title="Link Props" /> <Link href="#Link-Props" title="Link Props" />
</Link> </Link>
</Anchor>, </Anchor>,
mountNode); mountNode
);
``` ```

View File

@ -7,6 +7,7 @@ exports[`renders ./components/auto-complete/demo/basic.md correctly 1`] = `
> >
<div <div
aria-autocomplete="list" aria-autocomplete="list"
aria-controls="test-uuid"
aria-expanded="false" aria-expanded="false"
aria-haspopup="true" aria-haspopup="true"
class="ant-select-selection class="ant-select-selection
@ -82,6 +83,7 @@ exports[`renders ./components/auto-complete/demo/certain-category.md correctly 1
> >
<div <div
aria-autocomplete="list" aria-autocomplete="list"
aria-controls="test-uuid"
aria-expanded="false" aria-expanded="false"
aria-haspopup="true" aria-haspopup="true"
class="ant-select-selection class="ant-select-selection
@ -179,6 +181,7 @@ exports[`renders ./components/auto-complete/demo/custom.md correctly 1`] = `
> >
<div <div
aria-autocomplete="list" aria-autocomplete="list"
aria-controls="test-uuid"
aria-expanded="false" aria-expanded="false"
aria-haspopup="true" aria-haspopup="true"
class="ant-select-selection class="ant-select-selection
@ -243,6 +246,7 @@ exports[`renders ./components/auto-complete/demo/non-case-sensitive.md correctly
> >
<div <div
aria-autocomplete="list" aria-autocomplete="list"
aria-controls="test-uuid"
aria-expanded="false" aria-expanded="false"
aria-haspopup="true" aria-haspopup="true"
class="ant-select-selection class="ant-select-selection
@ -314,6 +318,7 @@ exports[`renders ./components/auto-complete/demo/options.md correctly 1`] = `
> >
<div <div
aria-autocomplete="list" aria-autocomplete="list"
aria-controls="test-uuid"
aria-expanded="false" aria-expanded="false"
aria-haspopup="true" aria-haspopup="true"
class="ant-select-selection class="ant-select-selection
@ -389,6 +394,7 @@ exports[`renders ./components/auto-complete/demo/uncertain-category.md correctly
> >
<div <div
aria-autocomplete="list" aria-autocomplete="list"
aria-controls="test-uuid"
aria-expanded="false" aria-expanded="false"
aria-haspopup="true" aria-haspopup="true"
class="ant-select-selection class="ant-select-selection

View File

@ -35,9 +35,7 @@ class Complete extends React.Component {
render() { render() {
const { result } = this.state; const { result } = this.state;
const children = result.map((email) => { const children = result.map(email => <Option key={email}>{email}</Option>);
return <Option key={email}>{email}</Option>;
});
return ( return (
<AutoComplete <AutoComplete
style={{ width: 200 }} style={{ width: 200 }}

View File

@ -15,7 +15,9 @@ Demonstration of [Lookup Patterns: Uncertain Category](https://ant.design/docs/s
Basic Usage, set datasource of autocomplete with `dataSource` property. Basic Usage, set datasource of autocomplete with `dataSource` property.
````jsx ````jsx
import { Icon, Button, Input, AutoComplete } from 'antd'; import {
Icon, Button, Input, AutoComplete,
} from 'antd';
const Option = AutoComplete.Option; const Option = AutoComplete.Option;

View File

@ -25,5 +25,6 @@ ReactDOM.render(
<Badge dot><Avatar shape="square" icon="user" /></Badge> <Badge dot><Avatar shape="square" icon="user" /></Badge>
</span> </span>
</div>, </div>,
mountNode); mountNode
);
```` ````

View File

@ -31,7 +31,8 @@ ReactDOM.render(
<Avatar shape="square" size="small" icon="user" /> <Avatar shape="square" size="small" icon="user" />
</div> </div>
</div>, </div>,
mountNode); mountNode
);
```` ````
<style> <style>

View File

@ -25,7 +25,8 @@ ReactDOM.render(
<Avatar style={{ color: '#f56a00', backgroundColor: '#fde3cf' }}>U</Avatar> <Avatar style={{ color: '#f56a00', backgroundColor: '#fde3cf' }}>U</Avatar>
<Avatar style={{ backgroundColor: '#87d068' }} icon="user" /> <Avatar style={{ backgroundColor: '#87d068' }} icon="user" />
</div>, </div>,
mountNode); mountNode
);
```` ````
<style> <style>

View File

@ -28,7 +28,8 @@ ReactDOM.render(
<a href="#" className="head-example" /> <a href="#" className="head-example" />
</Badge> </Badge>
</div>, </div>,
mountNode); mountNode
);
```` ````
<style> <style>

View File

@ -14,7 +14,9 @@ title:
The count will be animated as it changes. The count will be animated as it changes.
````jsx ````jsx
import { Badge, Button, Icon, Switch } from 'antd'; import {
Badge, Button, Icon, Switch,
} from 'antd';
const ButtonGroup = Button.Group; const ButtonGroup = Button.Group;

View File

@ -29,7 +29,8 @@ ReactDOM.render(
<a href="#">Link something</a> <a href="#">Link something</a>
</Badge> </Badge>
</div>, </div>,
mountNode); mountNode
);
```` ````
<style> <style>

View File

@ -22,5 +22,6 @@ ReactDOM.render(
<span className="head-example" /> <span className="head-example" />
</Badge> </Badge>
</a>, </a>,
mountNode); mountNode
);
```` ````

View File

@ -24,7 +24,8 @@ ReactDOM.render(
<Badge count={4} style={{ backgroundColor: '#fff', color: '#999', boxShadow: '0 0 0 1px #d9d9d9 inset' }} /> <Badge count={4} style={{ backgroundColor: '#fff', color: '#999', boxShadow: '0 0 0 1px #d9d9d9 inset' }} />
<Badge count={109} style={{ backgroundColor: '#52c41a' }} /> <Badge count={109} style={{ backgroundColor: '#52c41a' }} />
</div>, </div>,
mountNode); mountNode
);
```` ````
<style> <style>

View File

@ -31,5 +31,6 @@ ReactDOM.render(
<a href="#" className="head-example" /> <a href="#" className="head-example" />
</Badge> </Badge>
</div>, </div>,
mountNode); mountNode
);
```` ````

View File

@ -34,5 +34,6 @@ ReactDOM.render(
<br /> <br />
<Badge status="warning" text="Warning" /> <Badge status="warning" text="Warning" />
</div>, </div>,
mountNode); mountNode
);
```` ````

View File

@ -22,7 +22,8 @@ ReactDOM.render(
<a href="#" className="head-example" /> <a href="#" className="head-example" />
</Badge> </Badge>
</div>, </div>,
mountNode); mountNode
);
```` ````
<style> <style>

View File

@ -1,5 +1,7 @@
import React from 'react'; import React from 'react';
import { Route, Switch, Link, withRouter, MemoryRouter } from 'react-router-dom'; import {
Route, Switch, Link, withRouter, MemoryRouter,
} from 'react-router-dom';
import { mount } from 'enzyme'; import { mount } from 'enzyme';
import Breadcrumb from '../index'; import Breadcrumb from '../index';

View File

@ -23,5 +23,6 @@ ReactDOM.render(
<Breadcrumb.Item><a href="">Application List</a></Breadcrumb.Item> <Breadcrumb.Item><a href="">Application List</a></Breadcrumb.Item>
<Breadcrumb.Item>An Application</Breadcrumb.Item> <Breadcrumb.Item>An Application</Breadcrumb.Item>
</Breadcrumb>, </Breadcrumb>,
mountNode); mountNode
);
```` ````

View File

@ -16,7 +16,9 @@ title:
Used together with `react-router@4` or other router. Used together with `react-router@4` or other router.
````jsx ````jsx
import { HashRouter as Router, Route, Switch, Link, withRouter } from 'react-router-dom'; import {
HashRouter as Router, Route, Switch, Link, withRouter,
} from 'react-router-dom';
import { Breadcrumb, Alert } from 'antd'; import { Breadcrumb, Alert } from 'antd';
const Apps = () => ( const Apps = () => (
@ -77,7 +79,8 @@ ReactDOM.render(
<Router> <Router>
<Home /> <Home />
</Router>, </Router>,
mountNode); mountNode
);
```` ````
````css ````css

View File

@ -16,7 +16,9 @@ title:
Used together with `react-router@2` `react-router@3`. Used together with `react-router@2` `react-router@3`.
````jsx ````jsx
import { Router, Route, Link, hashHistory } from 'react-router'; import {
Router, Route, Link, hashHistory,
} from 'react-router';
import { Breadcrumb, Alert } from 'antd'; import { Breadcrumb, Alert } from 'antd';
const Apps = () => ( const Apps = () => (
@ -52,7 +54,8 @@ ReactDOM.render(
</Route> </Route>
</Route> </Route>
</Router>, </Router>,
mountNode); mountNode
);
```` ````
````css ````css

View File

@ -23,5 +23,6 @@ ReactDOM.render(
<Breadcrumb.Item href="">Application List</Breadcrumb.Item> <Breadcrumb.Item href="">Application List</Breadcrumb.Item>
<Breadcrumb.Item>An Application</Breadcrumb.Item> <Breadcrumb.Item>An Application</Breadcrumb.Item>
</Breadcrumb>, </Breadcrumb>,
mountNode); mountNode
);
```` ````

View File

@ -29,5 +29,6 @@ ReactDOM.render(
Application Application
</Breadcrumb.Item> </Breadcrumb.Item>
</Breadcrumb>, </Breadcrumb>,
mountNode); mountNode
);
```` ````

View File

@ -23,5 +23,6 @@ ReactDOM.render(
<Button type="dashed">Dashed</Button> <Button type="dashed">Dashed</Button>
<Button type="danger">Danger</Button> <Button type="danger">Danger</Button>
</div>, </div>,
mountNode); mountNode
);
```` ````

View File

@ -23,5 +23,6 @@ ReactDOM.render(
<Button type="dashed" block>Dashed</Button> <Button type="dashed" block>Dashed</Button>
<Button type="danger" block>danger</Button> <Button type="danger" block>danger</Button>
</div>, </div>,
mountNode); mountNode
);
```` ````

View File

@ -23,5 +23,6 @@ ReactDOM.render(
<Button type="dashed" ghost>Dashed</Button> <Button type="dashed" ghost>Dashed</Button>
<Button type="danger" ghost>danger</Button> <Button type="danger" ghost>danger</Button>
</div>, </div>,
mountNode); mountNode
);
```` ````

View File

@ -15,7 +15,9 @@ If you need several buttons, we recommend that you use 1 primary button + n seco
````jsx ````jsx
import { Button, Menu, Dropdown, Icon } from 'antd'; import {
Button, Menu, Dropdown, Icon,
} from 'antd';
function handleMenuClick(e) { function handleMenuClick(e) {
console.log('click', e); console.log('click', e);

View File

@ -102,7 +102,7 @@
padding-left: 29px; padding-left: 29px;
pointer-events: none; pointer-events: none;
position: relative; position: relative;
.@{iconfont-css-prefix} { .@{iconfont-css-prefix}:not(:last-child) {
margin-left: -14px; margin-left: -14px;
} }
} }

View File

@ -12,6 +12,7 @@ exports[`renders ./components/calendar/demo/basic.md correctly 1`] = `
> >
<div <div
aria-autocomplete="list" aria-autocomplete="list"
aria-controls="test-uuid"
aria-expanded="false" aria-expanded="false"
aria-haspopup="true" aria-haspopup="true"
class="ant-select-selection class="ant-select-selection
@ -60,6 +61,7 @@ exports[`renders ./components/calendar/demo/basic.md correctly 1`] = `
> >
<div <div
aria-autocomplete="list" aria-autocomplete="list"
aria-controls="test-uuid"
aria-expanded="false" aria-expanded="false"
aria-haspopup="true" aria-haspopup="true"
class="ant-select-selection class="ant-select-selection
@ -1053,6 +1055,7 @@ exports[`renders ./components/calendar/demo/card.md correctly 1`] = `
> >
<div <div
aria-autocomplete="list" aria-autocomplete="list"
aria-controls="test-uuid"
aria-expanded="false" aria-expanded="false"
aria-haspopup="true" aria-haspopup="true"
class="ant-select-selection class="ant-select-selection
@ -1101,6 +1104,7 @@ exports[`renders ./components/calendar/demo/card.md correctly 1`] = `
> >
<div <div
aria-autocomplete="list" aria-autocomplete="list"
aria-controls="test-uuid"
aria-expanded="false" aria-expanded="false"
aria-haspopup="true" aria-haspopup="true"
class="ant-select-selection class="ant-select-selection
@ -2092,6 +2096,7 @@ exports[`renders ./components/calendar/demo/notice-calendar.md correctly 1`] = `
> >
<div <div
aria-autocomplete="list" aria-autocomplete="list"
aria-controls="test-uuid"
aria-expanded="false" aria-expanded="false"
aria-haspopup="true" aria-haspopup="true"
class="ant-select-selection class="ant-select-selection
@ -2140,6 +2145,7 @@ exports[`renders ./components/calendar/demo/notice-calendar.md correctly 1`] = `
> >
<div <div
aria-autocomplete="list" aria-autocomplete="list"
aria-controls="test-uuid"
aria-expanded="false" aria-expanded="false"
aria-haspopup="true" aria-haspopup="true"
class="ant-select-selection class="ant-select-selection
@ -3541,6 +3547,7 @@ exports[`renders ./components/calendar/demo/select.md correctly 1`] = `
> >
<div <div
aria-autocomplete="list" aria-autocomplete="list"
aria-controls="test-uuid"
aria-expanded="false" aria-expanded="false"
aria-haspopup="true" aria-haspopup="true"
class="ant-select-selection class="ant-select-selection
@ -3589,6 +3596,7 @@ exports[`renders ./components/calendar/demo/select.md correctly 1`] = `
> >
<div <div
aria-autocomplete="list" aria-autocomplete="list"
aria-controls="test-uuid"
aria-expanded="false" aria-expanded="false"
aria-haspopup="true" aria-haspopup="true"
class="ant-select-selection class="ant-select-selection

View File

@ -12,6 +12,7 @@ exports[`Calendar Calendar should support locale 1`] = `
> >
<div <div
aria-autocomplete="list" aria-autocomplete="list"
aria-controls="test-uuid"
aria-expanded="false" aria-expanded="false"
aria-haspopup="true" aria-haspopup="true"
class="ant-select-selection class="ant-select-selection
@ -59,6 +60,7 @@ exports[`Calendar Calendar should support locale 1`] = `
> >
<div <div
aria-autocomplete="list" aria-autocomplete="list"
aria-controls="test-uuid"
aria-expanded="false" aria-expanded="false"
aria-haspopup="true" aria-haspopup="true"
class="ant-select-selection class="ant-select-selection

View File

@ -22,5 +22,6 @@ function onPanelChange(value, mode) {
ReactDOM.render( ReactDOM.render(
<Calendar onPanelChange={onPanelChange} />, <Calendar onPanelChange={onPanelChange} />,
mountNode); mountNode
);
```` ````

View File

@ -24,5 +24,6 @@ ReactDOM.render(
<div style={{ width: 300, border: '1px solid #d9d9d9', borderRadius: 4 }}> <div style={{ width: 300, border: '1px solid #d9d9d9', borderRadius: 4 }}>
<Calendar fullscreen={false} onPanelChange={onPanelChange} /> <Calendar fullscreen={false} onPanelChange={onPanelChange} />
</div>, </div>,
mountNode); mountNode
);
```` ````

View File

@ -77,7 +77,8 @@ function monthCellRender(value) {
ReactDOM.render( ReactDOM.render(
<Calendar dateCellRender={dateCellRender} monthCellRender={monthCellRender} />, <Calendar dateCellRender={dateCellRender} monthCellRender={monthCellRender} />,
mountNode); mountNode
);
```` ````
````css ````css

View File

@ -907,6 +907,11 @@ exports[`renders ./components/card/demo/tabs.md correctly 1`] = `
</div> </div>
</div> </div>
</div> </div>
<div
role="presentation"
style="width:0;height:0;overflow:hidden"
tabindex="0"
/>
<div <div
class="ant-tabs-content ant-tabs-content-animated ant-tabs-top-content" class="ant-tabs-content ant-tabs-content-animated ant-tabs-top-content"
style="margin-left:0%" style="margin-left:0%"
@ -915,13 +920,29 @@ exports[`renders ./components/card/demo/tabs.md correctly 1`] = `
aria-hidden="false" aria-hidden="false"
class="ant-tabs-tabpane ant-tabs-tabpane-active" class="ant-tabs-tabpane ant-tabs-tabpane-active"
role="tabpanel" role="tabpanel"
/> >
<div
role="presentation"
style="width:0;height:0;overflow:hidden"
tabindex="0"
/>
<div
role="presentation"
style="width:0;height:0;overflow:hidden"
tabindex="0"
/>
</div>
<div <div
aria-hidden="true" aria-hidden="true"
class="ant-tabs-tabpane ant-tabs-tabpane-inactive" class="ant-tabs-tabpane ant-tabs-tabpane-inactive"
role="tabpanel" role="tabpanel"
/> />
</div> </div>
<div
role="presentation"
style="width:0;height:0;overflow:hidden"
tabindex="0"
/>
</div> </div>
</div> </div>
<div <div
@ -1050,6 +1071,11 @@ exports[`renders ./components/card/demo/tabs.md correctly 1`] = `
</div> </div>
</div> </div>
</div> </div>
<div
role="presentation"
style="width:0;height:0;overflow:hidden"
tabindex="0"
/>
<div <div
class="ant-tabs-content ant-tabs-content-animated ant-tabs-top-content" class="ant-tabs-content ant-tabs-content-animated ant-tabs-top-content"
style="margin-left:-100%" style="margin-left:-100%"
@ -1063,13 +1089,29 @@ exports[`renders ./components/card/demo/tabs.md correctly 1`] = `
aria-hidden="false" aria-hidden="false"
class="ant-tabs-tabpane ant-tabs-tabpane-active" class="ant-tabs-tabpane ant-tabs-tabpane-active"
role="tabpanel" role="tabpanel"
/> >
<div
role="presentation"
style="width:0;height:0;overflow:hidden"
tabindex="0"
/>
<div
role="presentation"
style="width:0;height:0;overflow:hidden"
tabindex="0"
/>
</div>
<div <div
aria-hidden="true" aria-hidden="true"
class="ant-tabs-tabpane ant-tabs-tabpane-inactive" class="ant-tabs-tabpane ant-tabs-tabpane-inactive"
role="tabpanel" role="tabpanel"
/> />
</div> </div>
<div
role="presentation"
style="width:0;height:0;overflow:hidden"
tabindex="0"
/>
</div> </div>
</div> </div>
<div <div

View File

@ -26,7 +26,8 @@ ReactDOM.render(
<p>Card content</p> <p>Card content</p>
<p>Card content</p> <p>Card content</p>
</Card>, </Card>,
mountNode); mountNode
);
```` ````
<style> <style>

View File

@ -24,5 +24,6 @@ ReactDOM.render(
<p>Card content</p> <p>Card content</p>
</Card> </Card>
</div>, </div>,
mountNode); mountNode
);
```` ````

View File

@ -30,5 +30,6 @@ ReactDOM.render(
description="www.instagram.com" description="www.instagram.com"
/> />
</Card>, </Card>,
mountNode); mountNode
);
```` ````

View File

@ -31,5 +31,6 @@ ReactDOM.render(
<Card.Grid style={gridStyle}>Content</Card.Grid> <Card.Grid style={gridStyle}>Content</Card.Grid>
<Card.Grid style={gridStyle}>Content</Card.Grid> <Card.Grid style={gridStyle}>Content</Card.Grid>
</Card>, </Card>,
mountNode); mountNode
);
```` ````

View File

@ -30,5 +30,6 @@ ReactDOM.render(
</Col> </Col>
</Row> </Row>
</div>, </div>,
mountNode); mountNode
);
```` ````

View File

@ -44,5 +44,6 @@ ReactDOM.render(
Inner Card content Inner Card content
</Card> </Card>
</Card>, </Card>,
mountNode); mountNode
);
```` ````

View File

@ -14,7 +14,9 @@ title:
Shows a loading indicator while the contents of the card is being fetched. Shows a loading indicator while the contents of the card is being fetched.
````jsx ````jsx
import { Skeleton, Switch, Card, Icon, Avatar } from 'antd'; import {
Skeleton, Switch, Card, Icon, Avatar,
} from 'antd';
const { Meta } = Card; const { Meta } = Card;

View File

@ -30,5 +30,6 @@ ReactDOM.render(
description="This is the description" description="This is the description"
/> />
</Card>, </Card>,
mountNode); mountNode
);
```` ````

View File

@ -22,5 +22,6 @@ ReactDOM.render(
<p>Card content</p> <p>Card content</p>
<p>Card content</p> <p>Card content</p>
</Card>, </Card>,
mountNode); mountNode
);
```` ````

View File

@ -49,7 +49,7 @@ describe('Carousel', () => {
it('cancel resize listener when unmount', async () => { it('cancel resize listener when unmount', async () => {
const wrapper = mount(<Carousel autoplay><div>1</div><div>2</div><div>3</div></Carousel>); const wrapper = mount(<Carousel autoplay><div>1</div><div>2</div><div>3</div></Carousel>);
const onWindowResized = wrapper.instance().onWindowResized; const { onWindowResized } = wrapper.instance();
const spy = jest.spyOn(wrapper.instance().onWindowResized, 'cancel'); const spy = jest.spyOn(wrapper.instance().onWindowResized, 'cancel');
const spy2 = jest.spyOn(window, 'removeEventListener'); const spy2 = jest.spyOn(window, 'removeEventListener');
wrapper.unmount(); wrapper.unmount();

View File

@ -23,7 +23,8 @@ ReactDOM.render(
<div><h3>3</h3></div> <div><h3>3</h3></div>
<div><h3>4</h3></div> <div><h3>4</h3></div>
</Carousel>, </Carousel>,
mountNode); mountNode
);
```` ````
````css ````css

View File

@ -27,7 +27,8 @@ ReactDOM.render(
<div><h3>3</h3></div> <div><h3>3</h3></div>
<div><h3>4</h3></div> <div><h3>4</h3></div>
</Carousel>, </Carousel>,
mountNode); mountNode
);
```` ````
````css ````css

View File

@ -23,7 +23,8 @@ ReactDOM.render(
<div><h3>3</h3></div> <div><h3>3</h3></div>
<div><h3>4</h3></div> <div><h3>4</h3></div>
</Carousel>, </Carousel>,
mountNode); mountNode
);
```` ````
````css ````css

View File

@ -23,7 +23,8 @@ ReactDOM.render(
<div><h3>3</h3></div> <div><h3>3</h3></div>
<div><h3>4</h3></div> <div><h3>4</h3></div>
</Carousel>, </Carousel>,
mountNode); mountNode
);
```` ````
````css ````css

View File

@ -46,5 +46,6 @@ function onChange(value) {
ReactDOM.render( ReactDOM.render(
<Cascader options={options} onChange={onChange} placeholder="Please select" />, <Cascader options={options} onChange={onChange} placeholder="Please select" />,
mountNode); mountNode
);
```` ````

View File

@ -46,5 +46,6 @@ function onChange(value) {
ReactDOM.render( ReactDOM.render(
<Cascader options={options} onChange={onChange} changeOnSelect />, <Cascader options={options} onChange={onChange} changeOnSelect />,
mountNode); mountNode
);
```` ````

View File

@ -66,5 +66,6 @@ ReactDOM.render(
displayRender={displayRender} displayRender={displayRender}
style={{ width: '100%' }} style={{ width: '100%' }}
/>, />,
mountNode); mountNode
);
```` ````

View File

@ -46,5 +46,6 @@ function onChange(value) {
ReactDOM.render( ReactDOM.render(
<Cascader defaultValue={['zhejiang', 'hangzhou', 'xihu']} options={options} onChange={onChange} />, <Cascader defaultValue={['zhejiang', 'hangzhou', 'xihu']} options={options} onChange={onChange} />,
mountNode); mountNode
);
```` ````

View File

@ -47,5 +47,6 @@ function onChange(value) {
ReactDOM.render( ReactDOM.render(
<Cascader options={options} onChange={onChange} />, <Cascader options={options} onChange={onChange} />,
mountNode); mountNode
);
```` ````

View File

@ -46,5 +46,6 @@ function onChange(value) {
ReactDOM.render( ReactDOM.render(
<Cascader fieldNames={{ label: 'name', value: 'code', children: 'items' }} options={options} onChange={onChange} placeholder="Please select" />, <Cascader fieldNames={{ label: 'name', value: 'code', children: 'items' }} options={options} onChange={onChange} placeholder="Please select" />,
mountNode); mountNode
);
```` ````

View File

@ -56,5 +56,6 @@ ReactDOM.render(
displayRender={displayRender} displayRender={displayRender}
onChange={onChange} onChange={onChange}
/>, />,
mountNode); mountNode
);
```` ````

View File

@ -50,5 +50,6 @@ ReactDOM.render(
<Cascader options={options} onChange={onChange} /><br /><br /> <Cascader options={options} onChange={onChange} /><br /><br />
<Cascader size="small" options={options} onChange={onChange} /><br /><br /> <Cascader size="small" options={options} onChange={onChange} /><br /><br />
</div>, </div>,
mountNode); mountNode
);
```` ````

View File

@ -61,5 +61,6 @@ ReactDOM.render(
placeholder="Please select" placeholder="Please select"
/> />
</div>, </div>,
mountNode); mountNode
);
```` ````

View File

@ -22,5 +22,6 @@ function onChange(e) {
ReactDOM.render( ReactDOM.render(
<Checkbox onChange={onChange}>Checkbox</Checkbox>, <Checkbox onChange={onChange}>Checkbox</Checkbox>,
mountNode); mountNode
);
```` ````

View File

@ -28,6 +28,22 @@ class App extends React.Component {
checkAll: false, checkAll: false,
}; };
onChange = (checkedList) => {
this.setState({
checkedList,
indeterminate: !!checkedList.length && (checkedList.length < plainOptions.length),
checkAll: checkedList.length === plainOptions.length,
});
}
onCheckAllChange = (e) => {
this.setState({
checkedList: e.target.checked ? plainOptions : [],
indeterminate: false,
checkAll: e.target.checked,
});
}
render() { render() {
return ( return (
<div> <div>
@ -45,22 +61,6 @@ class App extends React.Component {
</div> </div>
); );
} }
onChange = (checkedList) => {
this.setState({
checkedList,
indeterminate: !!checkedList.length && (checkedList.length < plainOptions.length),
checkAll: checkedList.length === plainOptions.length,
});
}
onCheckAllChange = (e) => {
this.setState({
checkedList: e.target.checked ? plainOptions : [],
indeterminate: false,
checkAll: e.target.checked,
});
}
} }
ReactDOM.render(<App />, mountNode); ReactDOM.render(<App />, mountNode);

View File

@ -22,6 +22,21 @@ class App extends React.Component {
disabled: false, disabled: false,
}; };
toggleChecked = () => {
this.setState({ checked: !this.state.checked });
}
toggleDisable = () => {
this.setState({ disabled: !this.state.disabled });
}
onChange = (e) => {
console.log('checked = ', e.target.checked);
this.setState({
checked: e.target.checked,
});
}
render() { render() {
const label = `${this.state.checked ? 'Checked' : 'Unchecked'}-${this.state.disabled ? 'Disabled' : 'Enabled'}`; const label = `${this.state.checked ? 'Checked' : 'Unchecked'}-${this.state.disabled ? 'Disabled' : 'Enabled'}`;
return ( return (
@ -55,21 +70,6 @@ class App extends React.Component {
</div> </div>
); );
} }
toggleChecked = () => {
this.setState({ checked: !this.state.checked });
}
toggleDisable = () => {
this.setState({ disabled: !this.state.disabled });
}
onChange = (e) => {
console.log('checked = ', e.target.checked);
this.setState({
checked: e.target.checked,
});
}
} }
ReactDOM.render(<App />, mountNode); ReactDOM.render(<App />, mountNode);

View File

@ -22,5 +22,6 @@ ReactDOM.render(
<br /> <br />
<Checkbox defaultChecked disabled /> <Checkbox defaultChecked disabled />
</div>, </div>,
mountNode); mountNode
);
```` ````

View File

@ -42,5 +42,6 @@ ReactDOM.render(
<br /><br /> <br /><br />
<CheckboxGroup options={optionsWithDisabled} disabled defaultValue={['Apple']} onChange={onChange} /> <CheckboxGroup options={optionsWithDisabled} disabled defaultValue={['Apple']} onChange={onChange} />
</div>, </div>,
mountNode); mountNode
);
```` ````

View File

@ -36,5 +36,6 @@ ReactDOM.render(
<p>{text}</p> <p>{text}</p>
</Panel> </Panel>
</Collapse>, </Collapse>,
mountNode); mountNode
);
```` ````

View File

@ -40,7 +40,8 @@ ReactDOM.render(
<p>{text}</p> <p>{text}</p>
</Panel> </Panel>
</Collapse>, </Collapse>,
mountNode); mountNode
);
```` ````
<style> <style>

View File

@ -38,5 +38,6 @@ ReactDOM.render(
{text} {text}
</Panel> </Panel>
</Collapse>, </Collapse>,
mountNode); mountNode
);
```` ````

View File

@ -44,5 +44,6 @@ ReactDOM.render(
<p>{text}</p> <p>{text}</p>
</Panel> </Panel>
</Collapse>, </Collapse>,
mountNode); mountNode
);
```` ````

View File

@ -44,5 +44,6 @@ ReactDOM.render(
<p>{text}</p> <p>{text}</p>
</Panel> </Panel>
</Collapse>, </Collapse>,
mountNode); mountNode
);
```` ````

View File

@ -37,5 +37,6 @@ ReactDOM.render(
<p>{text}</p> <p>{text}</p>
</Panel> </Panel>
</Collapse>, </Collapse>,
mountNode); mountNode
);
```` ````

View File

@ -80,16 +80,17 @@ describe('DatePicker', () => {
onChange = (value) => { onChange = (value) => {
let { cleared } = this.state; let { cleared } = this.state;
let newValue = value;
if (cleared) { if (cleared) {
value = moment(moment(value).format('YYYY-MM-DD 12:12:12')); newValue = moment(moment(value).format('YYYY-MM-DD 12:12:12'));
cleared = false; cleared = false;
} }
if (!value) { if (!newValue) {
cleared = true; cleared = true;
} }
this.setState({ value, cleared }); this.setState({ value: newValue, cleared });
} }
render() { render() {

View File

@ -83,7 +83,13 @@ describe('RangePicker with showTime', () => {
const onChangeFn = jest.fn(); const onChangeFn = jest.fn();
const onOpenChangeFn = jest.fn(); const onOpenChangeFn = jest.fn();
const wrapper = mount( const wrapper = mount(
<RangePicker showTime open onOk={onOkFn} onChange={onChangeFn} onOpenChange={onOpenChangeFn} /> <RangePicker
showTime
open
onOk={onOkFn}
onChange={onChangeFn}
onOpenChange={onOpenChangeFn}
/>
); );
const calendarWrapper = mount(wrapper.find('Trigger').instance().getComponent()); const calendarWrapper = mount(wrapper.find('Trigger').instance().getComponent());

View File

@ -32,5 +32,6 @@ ReactDOM.render(
<br /> <br />
<WeekPicker onChange={onChange} placeholder="Select week" /> <WeekPicker onChange={onChange} placeholder="Select week" />
</div>, </div>,
mountNode); mountNode
);
```` ````

View File

@ -49,5 +49,6 @@ ReactDOM.render(
}} }}
/> />
</div>, </div>,
mountNode); mountNode
);
```` ````

View File

@ -31,5 +31,6 @@ ReactDOM.render(
disabled disabled
/> />
</div>, </div>,
mountNode); mountNode
);
```` ````

View File

@ -26,5 +26,6 @@ ReactDOM.render(
<RangePicker renderExtraFooter={() => 'extra footer'} showTime /> <RangePicker renderExtraFooter={() => 'extra footer'} showTime />
<MonthPicker renderExtraFooter={() => 'extra footer'} placeholder="Select month" /> <MonthPicker renderExtraFooter={() => 'extra footer'} placeholder="Select month" />
</div>, </div>,
mountNode); mountNode
);
```` ````

Some files were not shown because too many files have changed in this diff Show More