mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-27 20:49:53 +08:00
merge master
This commit is contained in:
commit
9f5d421cd6
@ -4,7 +4,6 @@ components/*/__tests__/type.tsx
|
||||
!components/*/__tests__/**/*.js
|
||||
!components/*/demo/*
|
||||
!.*.js
|
||||
|
||||
# Docs templates
|
||||
site/theme/template/IconDisplay/*.js
|
||||
site/theme/template/IconDisplay/*.jsx
|
||||
|
31
.eslintrc.js
31
.eslintrc.js
@ -14,33 +14,18 @@ const eslintrc = {
|
||||
'babel',
|
||||
],
|
||||
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/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'] }],
|
||||
'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/anchor-has-content': 0,
|
||||
'jsx-a11y/click-events-have-key-events': 0,
|
||||
'jsx-a11y/anchor-is-valid': 0,
|
||||
'react/no-danger': 0,
|
||||
'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/destructuring-assignment': 0,
|
||||
'react/no-multi-comp': 0,
|
||||
'react/prefer-stateless-function': 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,
|
||||
});
|
||||
}
|
||||
|
||||
|
4
.github/ISSUE_TEMPLATE.md
vendored
4
.github/ISSUE_TEMPLATE.md
vendored
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
|
8
.github/PULL_REQUEST_TEMPLATE.md
vendored
8
.github/PULL_REQUEST_TEMPLATE.md
vendored
@ -1,12 +1,12 @@
|
||||
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).
|
||||
* [ ] 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.
|
||||
* [ ] Add some descriptions and refer relative issues for you PR.
|
||||
* [ ] Rebase before creating a pull request to keep commit history clear.
|
||||
* [ ] Add some descriptions and refer relative issues for you pull request.
|
||||
|
||||
Extra checklist:
|
||||
|
||||
|
2
.gitignore
vendored
2
.gitignore
vendored
@ -38,8 +38,8 @@ components/**/*.jsx
|
||||
!components/**/__tests__/*.js
|
||||
!components/**/__tests__/*.js.snap
|
||||
/.history
|
||||
|
||||
# Docs templates
|
||||
site/theme/template/IconDisplay/*.js
|
||||
site/theme/template/IconDisplay/*.jsx
|
||||
site/theme/template/IconDisplay/fields.js
|
||||
*.tmp
|
||||
|
2
.jest.js
2
.jest.js
@ -31,7 +31,7 @@ module.exports = {
|
||||
'\\.js$': './node_modules/antd-tools/lib/jest/codePreprocessor',
|
||||
'\\.md$': './node_modules/antd-tools/lib/jest/demoPreprocessor',
|
||||
},
|
||||
testRegex: libDir === 'dist' ? 'demo\\.test\\.js$' : '.*\\.test\\.js$',
|
||||
testRegex: `${libDir === 'dist' ? 'demo' : '.*'}\\.test\\.js$`,
|
||||
collectCoverageFrom: [
|
||||
'components/**/*.{ts,tsx}',
|
||||
'!components/*/style/index.tsx',
|
||||
|
@ -1,3 +1,4 @@
|
||||
// jest config for server render environment
|
||||
module.exports = {
|
||||
setupFiles: [
|
||||
'./tests/setup.js',
|
||||
|
@ -3,7 +3,7 @@ sudo: false
|
||||
language: node_js
|
||||
|
||||
node_js:
|
||||
- 10
|
||||
- 11
|
||||
|
||||
cache:
|
||||
directories:
|
||||
|
@ -75,6 +75,7 @@ Cordaro <elvis07@163.com>
|
||||
D & R <jdz321@qq.com>
|
||||
Daewoong Moon <wiziple@gmail.com>
|
||||
Damian Green <damian.green@microlease.com>
|
||||
Damian Green <damian@gcoders.com>
|
||||
Dan Minshew <ofenixculpa@gmail.com>
|
||||
Dane David <dndavid102@gmail.com>
|
||||
Daniel Gomez <dgomez@orangeloops.com>
|
||||
@ -201,6 +202,7 @@ Knacktus <knacktus@gmail.com>
|
||||
Kyle Kelley <rgbkrk@gmail.com>
|
||||
Kyle Rosenberg <kyle.rosenberg@gmail.com>
|
||||
LLinFan- <catfoursi@qq.com>
|
||||
Laith <laith24@gmail.com>
|
||||
Larry Laski <larry.laski@gmail.com>
|
||||
LeeHarlan <709886167@qq.com>
|
||||
LeezQ <lizhenq2009@gmail.com>
|
||||
@ -390,6 +392,7 @@ afc163 <afc163@gmail.com>
|
||||
agent-z <1607291079@qq.com>
|
||||
ahalimkara <ahalimkara@gmail.com>
|
||||
alex <379118572@qq.com>
|
||||
arifemrecelik <ce.arifemre@gmail.com>
|
||||
ascoders <576625322@qq.com>
|
||||
ashishg-qburst <ashishg@qburst.com>
|
||||
bLue <tbdblue@gmail.com>
|
||||
@ -431,6 +434,7 @@ ezpub <ez.foro@gmail.com>
|
||||
feng zhi hao <fzhihao@outlook.com>
|
||||
fengmk2 <m@fengmk2.com>
|
||||
flashback313 <windmark2012@gmail.com>
|
||||
frezc <504021398@qq.com>
|
||||
genie <genie88@163.com>
|
||||
gregahren <grega.hren@gmail.com>
|
||||
guifu <picodoth@gmail.com>
|
||||
@ -546,6 +550,7 @@ snail <120216220@qq.com>
|
||||
sojournerc <cmeyer@zvelo.com>
|
||||
sorrycc <sorrycc@gmail.com>
|
||||
sosohime <theziming@126.com>
|
||||
spideeee <spideeee@github.com>
|
||||
stickmy <stickmyc@gmail.com>
|
||||
swindme <swindme@163.com>
|
||||
syssam <s.y.s.sam.sys@gmail.com>
|
||||
|
@ -19,13 +19,13 @@ timeline: true
|
||||
|
||||
`2018-11-24`
|
||||
|
||||
- 🌟 Checkbox provides status css class.[#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)
|
||||
- 🌟 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 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)
|
||||
- 🌟 TreeSelect do not call `loadData` when searching.[#13245](https://github.com/ant-design/ant-design/issues/13245)
|
||||
- 🐞 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)
|
||||
- 🌟 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 Carousel can not be interactive in fade mode. [#13215](https://github.com/ant-design/ant-design/issues/13215)
|
||||
- 🐞 Fix DatePicker don't support `tabIndex` prop. [#13265](https://github.com/ant-design/ant-design/pull/13265) [@arifemrecelik](https://github.com/arifemrecelik)
|
||||
- 🐞 TreeSelect won't call `loadData` when searching to avoid lagging problem. [#13245](https://github.com/ant-design/ant-design/issues/13245)
|
||||
|
||||
# 3.10.8
|
||||
|
||||
|
@ -19,13 +19,13 @@ timeline: true
|
||||
|
||||
`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)
|
||||
- 🌟 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)
|
||||
- 🐞 修复 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)
|
||||
- 🌟 TreeSelect 现在在搜索时不再调用 `loadData` 以避免卡死。[#13245](https://github.com/ant-design/ant-design/issues/13245)
|
||||
- 🐞 修复 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)
|
||||
|
||||
# 3.10.8
|
||||
|
||||
|
@ -40,7 +40,7 @@ Project maintainers who do not follow or enforce the Code of Conduct in good fai
|
||||
|
||||
## 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
|
||||
[version]: http://contributor-covenant.org/version/1/4/
|
||||
|
2
LICENSE
2
LICENSE
@ -1,6 +1,6 @@
|
||||
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
|
||||
a copy of this software and associated documentation files (the
|
||||
|
@ -79,11 +79,11 @@ import 'antd/dist/antd.css'; // or 'antd/dist/antd.less'
|
||||
- [组件库](http://ant.design/docs/react/introduce)
|
||||
- [Ant Design Pro](http://pro.ant.design/)
|
||||
- [更新日志](CHANGELOG.en-US.md)
|
||||
- [脚手架市场](http://scaffold.ant.design)
|
||||
- [React 底层基础组件](http://react-component.github.io/)
|
||||
- [移动端组件](http://mobile.ant.design)
|
||||
- [首页模板集](https://landing.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/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)
|
||||
|
@ -79,11 +79,11 @@ See [i18n](http://ant.design/docs/react/i18n).
|
||||
- [Components](http://ant.design/docs/react/introduce)
|
||||
- [Ant Design Pro](http://pro.ant.design/)
|
||||
- [Change Log](CHANGELOG.en-US.md)
|
||||
- [Scaffold Market](http://scaffold.ant.design)
|
||||
- [rc-components](http://react-component.github.io/)
|
||||
- [Mobile UI](http://mobile.ant.design)
|
||||
- [Landing Pages](https://landing.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)
|
||||
- [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)
|
||||
|
@ -12,9 +12,7 @@ class AffixMounter extends React.Component {
|
||||
});
|
||||
}
|
||||
|
||||
getTarget = () => {
|
||||
return this.container;
|
||||
}
|
||||
getTarget = () => this.container
|
||||
|
||||
render() {
|
||||
return (
|
||||
@ -34,7 +32,7 @@ class AffixMounter extends React.Component {
|
||||
>
|
||||
<Affix
|
||||
target={() => this.container}
|
||||
ref={ele => this.affix = ele}
|
||||
ref={(ele) => { this.affix = ele; }}
|
||||
{...this.props}
|
||||
>
|
||||
<Button type="primary">
|
||||
@ -59,11 +57,9 @@ describe('Affix Render', () => {
|
||||
});
|
||||
|
||||
const scrollTo = (top) => {
|
||||
wrapper.instance().affix.fixedNode.parentNode.getBoundingClientRect = jest.fn(() => {
|
||||
return {
|
||||
bottom: 100, height: 28, left: 0, right: 0, top: 50 - top, width: 195,
|
||||
};
|
||||
});
|
||||
wrapper.instance().affix.fixedNode.parentNode.getBoundingClientRect = jest.fn(() => ({
|
||||
bottom: 100, height: 28, left: 0, right: 0, top: 50 - top, width: 195,
|
||||
}));
|
||||
wrapper.instance().container.scrollTop = top;
|
||||
events.scroll({
|
||||
type: 'scroll',
|
||||
|
@ -27,5 +27,6 @@ ReactDOM.render(
|
||||
<br />
|
||||
<Alert type="error" message="Error text" banner />
|
||||
</div>,
|
||||
mountNode);
|
||||
mountNode
|
||||
);
|
||||
````
|
||||
|
@ -18,7 +18,8 @@ import { Alert } from 'antd';
|
||||
|
||||
ReactDOM.render(
|
||||
<Alert message="Success Text" type="success" />,
|
||||
mountNode);
|
||||
mountNode
|
||||
);
|
||||
````
|
||||
|
||||
<style>
|
||||
|
@ -16,7 +16,7 @@ To show close button.
|
||||
````jsx
|
||||
import { Alert } from 'antd';
|
||||
|
||||
const onClose = function (e) {
|
||||
const onClose = (e) => {
|
||||
console.log(e, 'I was closed.');
|
||||
};
|
||||
|
||||
@ -36,5 +36,6 @@ ReactDOM.render(
|
||||
onClose={onClose}
|
||||
/>
|
||||
</div>,
|
||||
mountNode);
|
||||
mountNode
|
||||
);
|
||||
````
|
||||
|
@ -18,5 +18,6 @@ import { Alert } from 'antd';
|
||||
|
||||
ReactDOM.render(
|
||||
<Alert message="Info Text" type="info" closeText="Close Now" />,
|
||||
mountNode);
|
||||
mountNode
|
||||
);
|
||||
````
|
||||
|
@ -55,5 +55,6 @@ ReactDOM.render(
|
||||
showIcon
|
||||
/>
|
||||
</div>,
|
||||
mountNode);
|
||||
mountNode
|
||||
);
|
||||
````
|
||||
|
@ -39,5 +39,6 @@ ReactDOM.render(
|
||||
type="error"
|
||||
/>
|
||||
</div>,
|
||||
mountNode);
|
||||
mountNode
|
||||
);
|
||||
````
|
||||
|
@ -47,5 +47,6 @@ ReactDOM.render(
|
||||
showIcon
|
||||
/>
|
||||
</div>,
|
||||
mountNode);
|
||||
mountNode
|
||||
);
|
||||
````
|
||||
|
@ -46,5 +46,6 @@ class App extends React.Component {
|
||||
|
||||
ReactDOM.render(
|
||||
<App />,
|
||||
mountNode);
|
||||
mountNode
|
||||
);
|
||||
````
|
||||
|
@ -23,5 +23,6 @@ ReactDOM.render(
|
||||
<Alert message="Warning Text" type="warning" />
|
||||
<Alert message="Error Text" type="error" />
|
||||
</div>,
|
||||
mountNode);
|
||||
mountNode
|
||||
);
|
||||
````
|
||||
|
@ -92,7 +92,7 @@ describe('Anchor Render', () => {
|
||||
let anchorInstance = null;
|
||||
function AnchorUpdate({ href }) {
|
||||
return (
|
||||
<Anchor ref={c => anchorInstance = c}>
|
||||
<Anchor ref={(c) => { anchorInstance = c; }}>
|
||||
<Link href={href} title="API" />
|
||||
</Anchor>
|
||||
);
|
||||
@ -107,7 +107,7 @@ describe('Anchor Render', () => {
|
||||
it('Anchor onClick event', () => {
|
||||
let event;
|
||||
let link;
|
||||
const handleClick = (...arg) => ([event, link] = arg);
|
||||
const handleClick = (...arg) => { [event, link] = arg; };
|
||||
|
||||
const href = '#API';
|
||||
const title = 'API';
|
||||
|
@ -27,7 +27,8 @@ ReactDOM.render(
|
||||
<Link href="#Link-Props" title="Link Props" />
|
||||
</Link>
|
||||
</Anchor>,
|
||||
mountNode);
|
||||
mountNode
|
||||
);
|
||||
```
|
||||
|
||||
<style>
|
||||
|
@ -32,5 +32,6 @@ ReactDOM.render(
|
||||
<Link href="#Link-Props" title="Link Props" />
|
||||
</Link>
|
||||
</Anchor>,
|
||||
mountNode);
|
||||
mountNode
|
||||
);
|
||||
```
|
||||
|
@ -27,5 +27,6 @@ ReactDOM.render(
|
||||
<Link href="#Link-Props" title="Link Props" />
|
||||
</Link>
|
||||
</Anchor>,
|
||||
mountNode);
|
||||
mountNode
|
||||
);
|
||||
```
|
||||
|
@ -7,6 +7,7 @@ exports[`renders ./components/auto-complete/demo/basic.md correctly 1`] = `
|
||||
>
|
||||
<div
|
||||
aria-autocomplete="list"
|
||||
aria-controls="test-uuid"
|
||||
aria-expanded="false"
|
||||
aria-haspopup="true"
|
||||
class="ant-select-selection
|
||||
@ -82,6 +83,7 @@ exports[`renders ./components/auto-complete/demo/certain-category.md correctly 1
|
||||
>
|
||||
<div
|
||||
aria-autocomplete="list"
|
||||
aria-controls="test-uuid"
|
||||
aria-expanded="false"
|
||||
aria-haspopup="true"
|
||||
class="ant-select-selection
|
||||
@ -179,6 +181,7 @@ exports[`renders ./components/auto-complete/demo/custom.md correctly 1`] = `
|
||||
>
|
||||
<div
|
||||
aria-autocomplete="list"
|
||||
aria-controls="test-uuid"
|
||||
aria-expanded="false"
|
||||
aria-haspopup="true"
|
||||
class="ant-select-selection
|
||||
@ -243,6 +246,7 @@ exports[`renders ./components/auto-complete/demo/non-case-sensitive.md correctly
|
||||
>
|
||||
<div
|
||||
aria-autocomplete="list"
|
||||
aria-controls="test-uuid"
|
||||
aria-expanded="false"
|
||||
aria-haspopup="true"
|
||||
class="ant-select-selection
|
||||
@ -314,6 +318,7 @@ exports[`renders ./components/auto-complete/demo/options.md correctly 1`] = `
|
||||
>
|
||||
<div
|
||||
aria-autocomplete="list"
|
||||
aria-controls="test-uuid"
|
||||
aria-expanded="false"
|
||||
aria-haspopup="true"
|
||||
class="ant-select-selection
|
||||
@ -389,6 +394,7 @@ exports[`renders ./components/auto-complete/demo/uncertain-category.md correctly
|
||||
>
|
||||
<div
|
||||
aria-autocomplete="list"
|
||||
aria-controls="test-uuid"
|
||||
aria-expanded="false"
|
||||
aria-haspopup="true"
|
||||
class="ant-select-selection
|
||||
|
@ -35,9 +35,7 @@ class Complete extends React.Component {
|
||||
|
||||
render() {
|
||||
const { result } = this.state;
|
||||
const children = result.map((email) => {
|
||||
return <Option key={email}>{email}</Option>;
|
||||
});
|
||||
const children = result.map(email => <Option key={email}>{email}</Option>);
|
||||
return (
|
||||
<AutoComplete
|
||||
style={{ width: 200 }}
|
||||
|
@ -15,7 +15,9 @@ Demonstration of [Lookup Patterns: Uncertain Category](https://ant.design/docs/s
|
||||
Basic Usage, set datasource of autocomplete with `dataSource` property.
|
||||
|
||||
````jsx
|
||||
import { Icon, Button, Input, AutoComplete } from 'antd';
|
||||
import {
|
||||
Icon, Button, Input, AutoComplete,
|
||||
} from 'antd';
|
||||
|
||||
const Option = AutoComplete.Option;
|
||||
|
||||
|
@ -25,5 +25,6 @@ ReactDOM.render(
|
||||
<Badge dot><Avatar shape="square" icon="user" /></Badge>
|
||||
</span>
|
||||
</div>,
|
||||
mountNode);
|
||||
mountNode
|
||||
);
|
||||
````
|
||||
|
@ -31,7 +31,8 @@ ReactDOM.render(
|
||||
<Avatar shape="square" size="small" icon="user" />
|
||||
</div>
|
||||
</div>,
|
||||
mountNode);
|
||||
mountNode
|
||||
);
|
||||
````
|
||||
|
||||
<style>
|
||||
|
@ -25,7 +25,8 @@ ReactDOM.render(
|
||||
<Avatar style={{ color: '#f56a00', backgroundColor: '#fde3cf' }}>U</Avatar>
|
||||
<Avatar style={{ backgroundColor: '#87d068' }} icon="user" />
|
||||
</div>,
|
||||
mountNode);
|
||||
mountNode
|
||||
);
|
||||
````
|
||||
|
||||
<style>
|
||||
|
@ -28,7 +28,8 @@ ReactDOM.render(
|
||||
<a href="#" className="head-example" />
|
||||
</Badge>
|
||||
</div>,
|
||||
mountNode);
|
||||
mountNode
|
||||
);
|
||||
````
|
||||
|
||||
<style>
|
||||
|
@ -14,7 +14,9 @@ title:
|
||||
The count will be animated as it changes.
|
||||
|
||||
````jsx
|
||||
import { Badge, Button, Icon, Switch } from 'antd';
|
||||
import {
|
||||
Badge, Button, Icon, Switch,
|
||||
} from 'antd';
|
||||
|
||||
const ButtonGroup = Button.Group;
|
||||
|
||||
|
@ -29,7 +29,8 @@ ReactDOM.render(
|
||||
<a href="#">Link something</a>
|
||||
</Badge>
|
||||
</div>,
|
||||
mountNode);
|
||||
mountNode
|
||||
);
|
||||
````
|
||||
|
||||
<style>
|
||||
|
@ -22,5 +22,6 @@ ReactDOM.render(
|
||||
<span className="head-example" />
|
||||
</Badge>
|
||||
</a>,
|
||||
mountNode);
|
||||
mountNode
|
||||
);
|
||||
````
|
||||
|
@ -24,7 +24,8 @@ ReactDOM.render(
|
||||
<Badge count={4} style={{ backgroundColor: '#fff', color: '#999', boxShadow: '0 0 0 1px #d9d9d9 inset' }} />
|
||||
<Badge count={109} style={{ backgroundColor: '#52c41a' }} />
|
||||
</div>,
|
||||
mountNode);
|
||||
mountNode
|
||||
);
|
||||
````
|
||||
|
||||
<style>
|
||||
|
@ -31,5 +31,6 @@ ReactDOM.render(
|
||||
<a href="#" className="head-example" />
|
||||
</Badge>
|
||||
</div>,
|
||||
mountNode);
|
||||
mountNode
|
||||
);
|
||||
````
|
||||
|
@ -34,5 +34,6 @@ ReactDOM.render(
|
||||
<br />
|
||||
<Badge status="warning" text="Warning" />
|
||||
</div>,
|
||||
mountNode);
|
||||
mountNode
|
||||
);
|
||||
````
|
||||
|
@ -22,7 +22,8 @@ ReactDOM.render(
|
||||
<a href="#" className="head-example" />
|
||||
</Badge>
|
||||
</div>,
|
||||
mountNode);
|
||||
mountNode
|
||||
);
|
||||
````
|
||||
|
||||
<style>
|
||||
|
@ -1,5 +1,7 @@
|
||||
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 Breadcrumb from '../index';
|
||||
|
||||
|
@ -23,5 +23,6 @@ ReactDOM.render(
|
||||
<Breadcrumb.Item><a href="">Application List</a></Breadcrumb.Item>
|
||||
<Breadcrumb.Item>An Application</Breadcrumb.Item>
|
||||
</Breadcrumb>,
|
||||
mountNode);
|
||||
mountNode
|
||||
);
|
||||
````
|
||||
|
@ -16,7 +16,9 @@ title:
|
||||
Used together with `react-router@4` or other router.
|
||||
|
||||
````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';
|
||||
|
||||
const Apps = () => (
|
||||
@ -77,7 +79,8 @@ ReactDOM.render(
|
||||
<Router>
|
||||
<Home />
|
||||
</Router>,
|
||||
mountNode);
|
||||
mountNode
|
||||
);
|
||||
````
|
||||
|
||||
````css
|
||||
|
@ -16,7 +16,9 @@ title:
|
||||
Used together with `react-router@2` `react-router@3`.
|
||||
|
||||
````jsx
|
||||
import { Router, Route, Link, hashHistory } from 'react-router';
|
||||
import {
|
||||
Router, Route, Link, hashHistory,
|
||||
} from 'react-router';
|
||||
import { Breadcrumb, Alert } from 'antd';
|
||||
|
||||
const Apps = () => (
|
||||
@ -52,7 +54,8 @@ ReactDOM.render(
|
||||
</Route>
|
||||
</Route>
|
||||
</Router>,
|
||||
mountNode);
|
||||
mountNode
|
||||
);
|
||||
````
|
||||
|
||||
````css
|
||||
|
@ -23,5 +23,6 @@ ReactDOM.render(
|
||||
<Breadcrumb.Item href="">Application List</Breadcrumb.Item>
|
||||
<Breadcrumb.Item>An Application</Breadcrumb.Item>
|
||||
</Breadcrumb>,
|
||||
mountNode);
|
||||
mountNode
|
||||
);
|
||||
````
|
||||
|
@ -29,5 +29,6 @@ ReactDOM.render(
|
||||
Application
|
||||
</Breadcrumb.Item>
|
||||
</Breadcrumb>,
|
||||
mountNode);
|
||||
mountNode
|
||||
);
|
||||
````
|
||||
|
@ -23,5 +23,6 @@ ReactDOM.render(
|
||||
<Button type="dashed">Dashed</Button>
|
||||
<Button type="danger">Danger</Button>
|
||||
</div>,
|
||||
mountNode);
|
||||
mountNode
|
||||
);
|
||||
````
|
||||
|
@ -23,5 +23,6 @@ ReactDOM.render(
|
||||
<Button type="dashed" block>Dashed</Button>
|
||||
<Button type="danger" block>danger</Button>
|
||||
</div>,
|
||||
mountNode);
|
||||
mountNode
|
||||
);
|
||||
````
|
||||
|
@ -23,5 +23,6 @@ ReactDOM.render(
|
||||
<Button type="dashed" ghost>Dashed</Button>
|
||||
<Button type="danger" ghost>danger</Button>
|
||||
</div>,
|
||||
mountNode);
|
||||
mountNode
|
||||
);
|
||||
````
|
||||
|
@ -15,7 +15,9 @@ If you need several buttons, we recommend that you use 1 primary button + n seco
|
||||
|
||||
|
||||
````jsx
|
||||
import { Button, Menu, Dropdown, Icon } from 'antd';
|
||||
import {
|
||||
Button, Menu, Dropdown, Icon,
|
||||
} from 'antd';
|
||||
|
||||
function handleMenuClick(e) {
|
||||
console.log('click', e);
|
||||
|
@ -102,7 +102,7 @@
|
||||
padding-left: 29px;
|
||||
pointer-events: none;
|
||||
position: relative;
|
||||
.@{iconfont-css-prefix} {
|
||||
.@{iconfont-css-prefix}:not(:last-child) {
|
||||
margin-left: -14px;
|
||||
}
|
||||
}
|
||||
|
@ -12,6 +12,7 @@ exports[`renders ./components/calendar/demo/basic.md correctly 1`] = `
|
||||
>
|
||||
<div
|
||||
aria-autocomplete="list"
|
||||
aria-controls="test-uuid"
|
||||
aria-expanded="false"
|
||||
aria-haspopup="true"
|
||||
class="ant-select-selection
|
||||
@ -60,6 +61,7 @@ exports[`renders ./components/calendar/demo/basic.md correctly 1`] = `
|
||||
>
|
||||
<div
|
||||
aria-autocomplete="list"
|
||||
aria-controls="test-uuid"
|
||||
aria-expanded="false"
|
||||
aria-haspopup="true"
|
||||
class="ant-select-selection
|
||||
@ -1053,6 +1055,7 @@ exports[`renders ./components/calendar/demo/card.md correctly 1`] = `
|
||||
>
|
||||
<div
|
||||
aria-autocomplete="list"
|
||||
aria-controls="test-uuid"
|
||||
aria-expanded="false"
|
||||
aria-haspopup="true"
|
||||
class="ant-select-selection
|
||||
@ -1101,6 +1104,7 @@ exports[`renders ./components/calendar/demo/card.md correctly 1`] = `
|
||||
>
|
||||
<div
|
||||
aria-autocomplete="list"
|
||||
aria-controls="test-uuid"
|
||||
aria-expanded="false"
|
||||
aria-haspopup="true"
|
||||
class="ant-select-selection
|
||||
@ -2092,6 +2096,7 @@ exports[`renders ./components/calendar/demo/notice-calendar.md correctly 1`] = `
|
||||
>
|
||||
<div
|
||||
aria-autocomplete="list"
|
||||
aria-controls="test-uuid"
|
||||
aria-expanded="false"
|
||||
aria-haspopup="true"
|
||||
class="ant-select-selection
|
||||
@ -2140,6 +2145,7 @@ exports[`renders ./components/calendar/demo/notice-calendar.md correctly 1`] = `
|
||||
>
|
||||
<div
|
||||
aria-autocomplete="list"
|
||||
aria-controls="test-uuid"
|
||||
aria-expanded="false"
|
||||
aria-haspopup="true"
|
||||
class="ant-select-selection
|
||||
@ -3541,6 +3547,7 @@ exports[`renders ./components/calendar/demo/select.md correctly 1`] = `
|
||||
>
|
||||
<div
|
||||
aria-autocomplete="list"
|
||||
aria-controls="test-uuid"
|
||||
aria-expanded="false"
|
||||
aria-haspopup="true"
|
||||
class="ant-select-selection
|
||||
@ -3589,6 +3596,7 @@ exports[`renders ./components/calendar/demo/select.md correctly 1`] = `
|
||||
>
|
||||
<div
|
||||
aria-autocomplete="list"
|
||||
aria-controls="test-uuid"
|
||||
aria-expanded="false"
|
||||
aria-haspopup="true"
|
||||
class="ant-select-selection
|
||||
|
@ -12,6 +12,7 @@ exports[`Calendar Calendar should support locale 1`] = `
|
||||
>
|
||||
<div
|
||||
aria-autocomplete="list"
|
||||
aria-controls="test-uuid"
|
||||
aria-expanded="false"
|
||||
aria-haspopup="true"
|
||||
class="ant-select-selection
|
||||
@ -59,6 +60,7 @@ exports[`Calendar Calendar should support locale 1`] = `
|
||||
>
|
||||
<div
|
||||
aria-autocomplete="list"
|
||||
aria-controls="test-uuid"
|
||||
aria-expanded="false"
|
||||
aria-haspopup="true"
|
||||
class="ant-select-selection
|
||||
|
@ -22,5 +22,6 @@ function onPanelChange(value, mode) {
|
||||
|
||||
ReactDOM.render(
|
||||
<Calendar onPanelChange={onPanelChange} />,
|
||||
mountNode);
|
||||
mountNode
|
||||
);
|
||||
````
|
||||
|
@ -24,5 +24,6 @@ ReactDOM.render(
|
||||
<div style={{ width: 300, border: '1px solid #d9d9d9', borderRadius: 4 }}>
|
||||
<Calendar fullscreen={false} onPanelChange={onPanelChange} />
|
||||
</div>,
|
||||
mountNode);
|
||||
mountNode
|
||||
);
|
||||
````
|
||||
|
@ -77,7 +77,8 @@ function monthCellRender(value) {
|
||||
|
||||
ReactDOM.render(
|
||||
<Calendar dateCellRender={dateCellRender} monthCellRender={monthCellRender} />,
|
||||
mountNode);
|
||||
mountNode
|
||||
);
|
||||
````
|
||||
|
||||
````css
|
||||
|
@ -907,6 +907,11 @@ exports[`renders ./components/card/demo/tabs.md correctly 1`] = `
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
role="presentation"
|
||||
style="width:0;height:0;overflow:hidden"
|
||||
tabindex="0"
|
||||
/>
|
||||
<div
|
||||
class="ant-tabs-content ant-tabs-content-animated ant-tabs-top-content"
|
||||
style="margin-left:0%"
|
||||
@ -915,13 +920,29 @@ exports[`renders ./components/card/demo/tabs.md correctly 1`] = `
|
||||
aria-hidden="false"
|
||||
class="ant-tabs-tabpane ant-tabs-tabpane-active"
|
||||
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
|
||||
aria-hidden="true"
|
||||
class="ant-tabs-tabpane ant-tabs-tabpane-inactive"
|
||||
role="tabpanel"
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
role="presentation"
|
||||
style="width:0;height:0;overflow:hidden"
|
||||
tabindex="0"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
@ -1050,6 +1071,11 @@ exports[`renders ./components/card/demo/tabs.md correctly 1`] = `
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
role="presentation"
|
||||
style="width:0;height:0;overflow:hidden"
|
||||
tabindex="0"
|
||||
/>
|
||||
<div
|
||||
class="ant-tabs-content ant-tabs-content-animated ant-tabs-top-content"
|
||||
style="margin-left:-100%"
|
||||
@ -1063,13 +1089,29 @@ exports[`renders ./components/card/demo/tabs.md correctly 1`] = `
|
||||
aria-hidden="false"
|
||||
class="ant-tabs-tabpane ant-tabs-tabpane-active"
|
||||
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
|
||||
aria-hidden="true"
|
||||
class="ant-tabs-tabpane ant-tabs-tabpane-inactive"
|
||||
role="tabpanel"
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
role="presentation"
|
||||
style="width:0;height:0;overflow:hidden"
|
||||
tabindex="0"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
|
@ -26,7 +26,8 @@ ReactDOM.render(
|
||||
<p>Card content</p>
|
||||
<p>Card content</p>
|
||||
</Card>,
|
||||
mountNode);
|
||||
mountNode
|
||||
);
|
||||
````
|
||||
|
||||
<style>
|
||||
|
@ -24,5 +24,6 @@ ReactDOM.render(
|
||||
<p>Card content</p>
|
||||
</Card>
|
||||
</div>,
|
||||
mountNode);
|
||||
mountNode
|
||||
);
|
||||
````
|
||||
|
@ -30,5 +30,6 @@ ReactDOM.render(
|
||||
description="www.instagram.com"
|
||||
/>
|
||||
</Card>,
|
||||
mountNode);
|
||||
mountNode
|
||||
);
|
||||
````
|
||||
|
@ -31,5 +31,6 @@ ReactDOM.render(
|
||||
<Card.Grid style={gridStyle}>Content</Card.Grid>
|
||||
<Card.Grid style={gridStyle}>Content</Card.Grid>
|
||||
</Card>,
|
||||
mountNode);
|
||||
mountNode
|
||||
);
|
||||
````
|
||||
|
@ -30,5 +30,6 @@ ReactDOM.render(
|
||||
</Col>
|
||||
</Row>
|
||||
</div>,
|
||||
mountNode);
|
||||
mountNode
|
||||
);
|
||||
````
|
||||
|
@ -44,5 +44,6 @@ ReactDOM.render(
|
||||
Inner Card content
|
||||
</Card>
|
||||
</Card>,
|
||||
mountNode);
|
||||
mountNode
|
||||
);
|
||||
````
|
||||
|
@ -14,7 +14,9 @@ title:
|
||||
Shows a loading indicator while the contents of the card is being fetched.
|
||||
|
||||
````jsx
|
||||
import { Skeleton, Switch, Card, Icon, Avatar } from 'antd';
|
||||
import {
|
||||
Skeleton, Switch, Card, Icon, Avatar,
|
||||
} from 'antd';
|
||||
|
||||
const { Meta } = Card;
|
||||
|
||||
|
@ -30,5 +30,6 @@ ReactDOM.render(
|
||||
description="This is the description"
|
||||
/>
|
||||
</Card>,
|
||||
mountNode);
|
||||
mountNode
|
||||
);
|
||||
````
|
||||
|
@ -22,5 +22,6 @@ ReactDOM.render(
|
||||
<p>Card content</p>
|
||||
<p>Card content</p>
|
||||
</Card>,
|
||||
mountNode);
|
||||
mountNode
|
||||
);
|
||||
````
|
||||
|
@ -49,7 +49,7 @@ describe('Carousel', () => {
|
||||
|
||||
it('cancel resize listener when unmount', async () => {
|
||||
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 spy2 = jest.spyOn(window, 'removeEventListener');
|
||||
wrapper.unmount();
|
||||
|
@ -23,7 +23,8 @@ ReactDOM.render(
|
||||
<div><h3>3</h3></div>
|
||||
<div><h3>4</h3></div>
|
||||
</Carousel>,
|
||||
mountNode);
|
||||
mountNode
|
||||
);
|
||||
````
|
||||
|
||||
````css
|
||||
|
@ -27,7 +27,8 @@ ReactDOM.render(
|
||||
<div><h3>3</h3></div>
|
||||
<div><h3>4</h3></div>
|
||||
</Carousel>,
|
||||
mountNode);
|
||||
mountNode
|
||||
);
|
||||
````
|
||||
|
||||
````css
|
||||
|
@ -23,7 +23,8 @@ ReactDOM.render(
|
||||
<div><h3>3</h3></div>
|
||||
<div><h3>4</h3></div>
|
||||
</Carousel>,
|
||||
mountNode);
|
||||
mountNode
|
||||
);
|
||||
````
|
||||
|
||||
````css
|
||||
|
@ -23,7 +23,8 @@ ReactDOM.render(
|
||||
<div><h3>3</h3></div>
|
||||
<div><h3>4</h3></div>
|
||||
</Carousel>,
|
||||
mountNode);
|
||||
mountNode
|
||||
);
|
||||
````
|
||||
|
||||
````css
|
||||
|
@ -46,5 +46,6 @@ function onChange(value) {
|
||||
|
||||
ReactDOM.render(
|
||||
<Cascader options={options} onChange={onChange} placeholder="Please select" />,
|
||||
mountNode);
|
||||
mountNode
|
||||
);
|
||||
````
|
||||
|
@ -46,5 +46,6 @@ function onChange(value) {
|
||||
|
||||
ReactDOM.render(
|
||||
<Cascader options={options} onChange={onChange} changeOnSelect />,
|
||||
mountNode);
|
||||
mountNode
|
||||
);
|
||||
````
|
||||
|
@ -66,5 +66,6 @@ ReactDOM.render(
|
||||
displayRender={displayRender}
|
||||
style={{ width: '100%' }}
|
||||
/>,
|
||||
mountNode);
|
||||
mountNode
|
||||
);
|
||||
````
|
||||
|
@ -46,5 +46,6 @@ function onChange(value) {
|
||||
|
||||
ReactDOM.render(
|
||||
<Cascader defaultValue={['zhejiang', 'hangzhou', 'xihu']} options={options} onChange={onChange} />,
|
||||
mountNode);
|
||||
mountNode
|
||||
);
|
||||
````
|
||||
|
@ -47,5 +47,6 @@ function onChange(value) {
|
||||
|
||||
ReactDOM.render(
|
||||
<Cascader options={options} onChange={onChange} />,
|
||||
mountNode);
|
||||
mountNode
|
||||
);
|
||||
````
|
||||
|
@ -46,5 +46,6 @@ function onChange(value) {
|
||||
|
||||
ReactDOM.render(
|
||||
<Cascader fieldNames={{ label: 'name', value: 'code', children: 'items' }} options={options} onChange={onChange} placeholder="Please select" />,
|
||||
mountNode);
|
||||
mountNode
|
||||
);
|
||||
````
|
||||
|
@ -56,5 +56,6 @@ ReactDOM.render(
|
||||
displayRender={displayRender}
|
||||
onChange={onChange}
|
||||
/>,
|
||||
mountNode);
|
||||
mountNode
|
||||
);
|
||||
````
|
||||
|
@ -50,5 +50,6 @@ ReactDOM.render(
|
||||
<Cascader options={options} onChange={onChange} /><br /><br />
|
||||
<Cascader size="small" options={options} onChange={onChange} /><br /><br />
|
||||
</div>,
|
||||
mountNode);
|
||||
mountNode
|
||||
);
|
||||
````
|
||||
|
@ -61,5 +61,6 @@ ReactDOM.render(
|
||||
placeholder="Please select"
|
||||
/>
|
||||
</div>,
|
||||
mountNode);
|
||||
mountNode
|
||||
);
|
||||
````
|
||||
|
@ -22,5 +22,6 @@ function onChange(e) {
|
||||
|
||||
ReactDOM.render(
|
||||
<Checkbox onChange={onChange}>Checkbox</Checkbox>,
|
||||
mountNode);
|
||||
mountNode
|
||||
);
|
||||
````
|
||||
|
@ -28,6 +28,22 @@ class App extends React.Component {
|
||||
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() {
|
||||
return (
|
||||
<div>
|
||||
@ -45,22 +61,6 @@ class App extends React.Component {
|
||||
</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);
|
||||
|
@ -22,6 +22,21 @@ class App extends React.Component {
|
||||
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() {
|
||||
const label = `${this.state.checked ? 'Checked' : 'Unchecked'}-${this.state.disabled ? 'Disabled' : 'Enabled'}`;
|
||||
return (
|
||||
@ -55,21 +70,6 @@ class App extends React.Component {
|
||||
</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);
|
||||
|
@ -22,5 +22,6 @@ ReactDOM.render(
|
||||
<br />
|
||||
<Checkbox defaultChecked disabled />
|
||||
</div>,
|
||||
mountNode);
|
||||
mountNode
|
||||
);
|
||||
````
|
||||
|
@ -42,5 +42,6 @@ ReactDOM.render(
|
||||
<br /><br />
|
||||
<CheckboxGroup options={optionsWithDisabled} disabled defaultValue={['Apple']} onChange={onChange} />
|
||||
</div>,
|
||||
mountNode);
|
||||
mountNode
|
||||
);
|
||||
````
|
||||
|
@ -36,5 +36,6 @@ ReactDOM.render(
|
||||
<p>{text}</p>
|
||||
</Panel>
|
||||
</Collapse>,
|
||||
mountNode);
|
||||
mountNode
|
||||
);
|
||||
````
|
||||
|
@ -40,7 +40,8 @@ ReactDOM.render(
|
||||
<p>{text}</p>
|
||||
</Panel>
|
||||
</Collapse>,
|
||||
mountNode);
|
||||
mountNode
|
||||
);
|
||||
````
|
||||
|
||||
<style>
|
||||
|
@ -38,5 +38,6 @@ ReactDOM.render(
|
||||
{text}
|
||||
</Panel>
|
||||
</Collapse>,
|
||||
mountNode);
|
||||
mountNode
|
||||
);
|
||||
````
|
||||
|
@ -44,5 +44,6 @@ ReactDOM.render(
|
||||
<p>{text}</p>
|
||||
</Panel>
|
||||
</Collapse>,
|
||||
mountNode);
|
||||
mountNode
|
||||
);
|
||||
````
|
||||
|
@ -44,5 +44,6 @@ ReactDOM.render(
|
||||
<p>{text}</p>
|
||||
</Panel>
|
||||
</Collapse>,
|
||||
mountNode);
|
||||
mountNode
|
||||
);
|
||||
````
|
||||
|
@ -37,5 +37,6 @@ ReactDOM.render(
|
||||
<p>{text}</p>
|
||||
</Panel>
|
||||
</Collapse>,
|
||||
mountNode);
|
||||
mountNode
|
||||
);
|
||||
````
|
||||
|
@ -80,16 +80,17 @@ describe('DatePicker', () => {
|
||||
onChange = (value) => {
|
||||
let { cleared } = this.state;
|
||||
|
||||
let newValue = value;
|
||||
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;
|
||||
}
|
||||
|
||||
if (!value) {
|
||||
if (!newValue) {
|
||||
cleared = true;
|
||||
}
|
||||
|
||||
this.setState({ value, cleared });
|
||||
this.setState({ value: newValue, cleared });
|
||||
}
|
||||
|
||||
render() {
|
||||
|
@ -83,7 +83,13 @@ describe('RangePicker with showTime', () => {
|
||||
const onChangeFn = jest.fn();
|
||||
const onOpenChangeFn = jest.fn();
|
||||
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());
|
||||
|
@ -32,5 +32,6 @@ ReactDOM.render(
|
||||
<br />
|
||||
<WeekPicker onChange={onChange} placeholder="Select week" />
|
||||
</div>,
|
||||
mountNode);
|
||||
mountNode
|
||||
);
|
||||
````
|
||||
|
@ -49,5 +49,6 @@ ReactDOM.render(
|
||||
}}
|
||||
/>
|
||||
</div>,
|
||||
mountNode);
|
||||
mountNode
|
||||
);
|
||||
````
|
||||
|
@ -31,5 +31,6 @@ ReactDOM.render(
|
||||
disabled
|
||||
/>
|
||||
</div>,
|
||||
mountNode);
|
||||
mountNode
|
||||
);
|
||||
````
|
||||
|
@ -26,5 +26,6 @@ ReactDOM.render(
|
||||
<RangePicker renderExtraFooter={() => 'extra footer'} showTime />
|
||||
<MonthPicker renderExtraFooter={() => 'extra footer'} placeholder="Select month" />
|
||||
</div>,
|
||||
mountNode);
|
||||
mountNode
|
||||
);
|
||||
````
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user