Merge pull request #18274 from ant-design/master

Merge master into feature
This commit is contained in:
偏右 2019-08-14 21:44:20 +08:00 committed by GitHub
commit 19fc777351
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
121 changed files with 671 additions and 491 deletions

View File

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

View File

@ -24,13 +24,14 @@ const eslintrc = {
// https://github.com/typescript-eslint/typescript-eslint/issues/46#issuecomment-470486034
overrides: [
{
files: ['*.tsx'],
files: ['*.ts', '*.tsx'],
rules: {
'@typescript-eslint/no-unused-vars': [2, { args: 'none' }],
},
},
],
rules: {
camelcase: 0,
'react/jsx-one-expression-per-line': 0,
'react/prop-types': 0,
'react/forbid-prop-types': 0,
@ -56,6 +57,8 @@ const eslintrc = {
'jsx-a11y/anchor-is-valid': 0,
'comma-dangle': ['error', 'always-multiline'],
'react/jsx-filename-extension': 0,
'react/state-in-constructor': 0,
'react/jsx-props-no-spreading': 0,
'prefer-destructuring': 0, // TODO: remove later
'consistent-return': 0, // TODO: remove later
'no-return-assign': 0, // TODO: remove later
@ -78,6 +81,8 @@ const eslintrc = {
'react/display-name': 0,
// ban this for Number.isNaN needs polyfill
'no-restricted-globals': 0,
'max-classes-per-file': 0,
'react/static-property-placement': 0,
},
};
@ -100,6 +105,8 @@ if (process.env.RUN_ENV === 'DEMO') {
'react/no-multi-comp': 0,
'jsx-a11y/href-no-hash': 0,
'import/no-extraneous-dependencies': 0,
'import/no-unresolved': 0,
'jsx-a11y/control-has-associated-label': 0,
});
}

View File

@ -8,7 +8,7 @@ action "Deploy" {
runs = [
"sh",
"-c",
"git remote set-url origin https://${DEPLOY_TOKEN}@github.com/ant-design/ant-design.git && npm install && npm run deploy"
"git config user.name antd-actions-bot && git config --local user.email support+actions@github.com && git remote set-url origin https://${DEPLOY_TOKEN}@github.com/ant-design/ant-design.git && npm install && npm run deploy"
],
secrets = ["DEPLOY_TOKEN"]
}

19
.github/workflows/nodejs.yml vendored Normal file
View File

@ -0,0 +1,19 @@
name: Node CI
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Use Node.js 10.x
uses: actions/setup-node@v1
with:
version: 10.x
- name: npm install, build, and test
run: |
npm install
npm run test-all

View File

@ -15,6 +15,31 @@ timeline: true
---
## 3.21.4
`2019-08-09`
- 🐞 Fix the problem that Dropdown.Button requires `title` props.
## 3.21.3
`2019-08-09`
- Timeline
- 🐞 Fix the problem that `content` content does not wrap when it is too long. [#18092](https://github.com/ant-design/ant-design/pull/18092) [@xrkffgg](https://github.com/xrkffgg)
- 🐞 Fixed inconsistency in styles in `alternate` and `right` modes and width overflow of `content`. [#18093](https://github.com/ant-design/ant-design/pull/18093) [@xrkffgg](https://github.com/xrkffgg)
- 🐞 Fix Tabs content with margin collapse with navigation. [#18112](https://github.com/ant-design/ant-design/pull/18112)
- 🐞 Fix Textarea `autosize` shows scrollbar after resize. [#18114](https://github.com/ant-design/ant-design/pull/18114)
- 🐞 Fix Tooltip not work correctly on `disabled` Checkbox. [#18138](https://github.com/ant-design/ant-design/pull/18138)
- 🐞 Fix a Button line-height align issue. [#18139](https://github.com/ant-design/ant-design/pull/18139)
- 🐞 Fix missing `blur` and `focus` methods on Mentions. [#18132](https://github.com/ant-design/ant-design/pull/18132) [@yoyo837](https://github.com/yoyo837)
- 🐞 Fix missing `title` on Button. [#18130](https://github.com/ant-design/ant-design/pull/18130) [@yoyo837](https://github.com/yoyo837)
- 🐞 Fix Upload throw File not defined in IE9. [#18115](https://github.com/ant-design/ant-design/pull/18115)
- 🐞 Fix Input clear icon not align correctly. [#18151](https://github.com/ant-design/ant-design/pull/18151)
- 🐞 Fix Card broken style when using Button as `actions`. [#18179](https://github.com/ant-design/ant-design/pull/18179)
- 🐞 Fix the problem that Modal.confirm can't set `getContainer`. [#18182](https://github.com/ant-design/ant-design/pull/18182)
- ⌨️ Improve Divider accessibility by adding role="separator". [#18116](https://github.com/ant-design/ant-design/pull/18116)
## 3.21.2
`2019-08-06`
@ -960,7 +985,6 @@ timeline: true
- 🐞 Fixed Table `Cannot read property 'children' of undefined` error when customize `column.title` as ReactNode. [#13542](https://github.com/ant-design/ant-design/issues/13542) [@geraldchen890806](https://github.com/geraldchen890806)
- 🐞 Fixed another border problem of Button when customized less variable `@border-width-base`. [#13534](https://github.com/ant-design/ant-design/issues/13534) [@morenyang](https://github.com/morenyang)
- 🐞 Fixed Upload don't support resolve `Blob` object when `beforeUpload` returns a Promise. [#13528](https://github.com/ant-design/ant-design/pull/13528/) [@huanz](https://github.com/huanz)
- https://github.com/ant-design/ant-design/pull/13536
- 🐞 Fixed two props of Dropdown TypeScript definitions. [#13536](https://github.com/ant-design/ant-design/pull/13536) [@wangxingkang](https://github.com/wangxingkang)
## 3.11.1

View File

@ -15,6 +15,31 @@ timeline: true
---
## 3.21.4
`2019-08-09`
- 🐞 修复 Dropdown.Button 的 `title` 类型。
## 3.21.3
`2019-08-09`
- Timeline
- 🐞 修复 `content` 内容连续过长时不换行的问题。[#18092](https://github.com/ant-design/ant-design/pull/18092) [@xrkffgg](https://github.com/xrkffgg)
- 🐞 修复 `alternate``right` 模式下样式不一致和 `content` 的宽度溢出的问题。 [#18093](https://github.com/ant-design/ant-design/pull/18093) [@xrkffgg](https://github.com/xrkffgg)
- 🐞 修复 Tabs 内容带有 margin 时会与标题相互作用的问题。[#18112](https://github.com/ant-design/ant-design/pull/18112)
- 🐞 修复 Textarea `autosize` 在调整尺寸后仍然显示滚动条的问题。[#18114](https://github.com/ant-design/ant-design/pull/18114)
- 🐞 修复 Tooltip 在 `disabled` Checkbox 上不能正确工作的问题。[#18138](https://github.com/ant-design/ant-design/pull/18138)
- 🐞 修复 Button 的行高对齐问题。[#18139](https://github.com/ant-design/ant-design/pull/18139)
- 🐞 修复 Mentions 没有 `blur``focus` 方法的问题。[#18132](https://github.com/ant-design/ant-design/pull/18132) [@yoyo837](https://github.com/yoyo837)
- 🐞 修复 Button 无法设置 `title` 的问题。[#18130](https://github.com/ant-design/ant-design/pull/18130) [@yoyo837](https://github.com/yoyo837)
- 🐞 修复 Upload 在 IE9 下报 File 未定义的问题。[#18115](https://github.com/ant-design/ant-design/pull/18115)
- 🐞 修复 Input 清除图标不居中对齐的问题。[#18151](https://github.com/ant-design/ant-design/pull/18151)
- 🐞 修复 Card `actions` 内使用 Button 的样式问题。[#18179](https://github.com/ant-design/ant-design/pull/18179)
- 🐞 修复 Modal.confirm 无法设置 `getContainer` 的问题。[#18182](https://github.com/ant-design/ant-design/pull/18182)
- ⌨️ 增强 Divider 可访问性支持。[#18116](https://github.com/ant-design/ant-design/pull/18116)
## 3.21.2
`2019-08-06`
@ -957,7 +982,6 @@ timeline: true
- 🐞 修复 Table 使用自定义列头时报 `Cannot read property 'children' of undefined` 的问题。[#13542](https://github.com/ant-design/ant-design/issues/13542) [@geraldchen890806](https://github.com/geraldchen890806)
- 🐞 修复另一个 Input 在自定义了 less 变量 `@border-width-base` 时的边框问题。[#13534](https://github.com/ant-design/ant-design/pull/13534) [@morenyang](https://github.com/morenyang)
- 🐞 修复 Upload 的 `beforeUpload` 方法返回 Promise 时不支持 resolve `Blob` 对象的问题。[#13528](https://github.com/ant-design/ant-design/pull/13528/) [@huanz](https://github.com/huanz)
- https://github.com/ant-design/ant-design/pull/13536
- 🐞 修复 Dropdown 两个属性的 TypeScript 定义。[#13536](https://github.com/ant-design/ant-design/pull/13536) [@wangxingkang](https://github.com/wangxingkang)
## 3.11.1

View File

@ -143,7 +143,7 @@ describe('Test utils function', () => {
it('bindAnimationEvent should return when node is null', () => {
const wrapper = mount(
<Wave>
<button type="button" disabled />
<button type="button" disabled>button</button>
</Wave>,
).instance();
expect(wrapper.bindAnimationEvent()).toBe(undefined);
@ -152,7 +152,7 @@ describe('Test utils function', () => {
it('bindAnimationEvent.onClick should return when children is hidden', () => {
const wrapper = mount(
<Wave>
<button type="button" style={{ display: 'none' }} />
<button type="button" style={{ display: 'none' }}>button</button>
</Wave>,
).instance();
expect(wrapper.bindAnimationEvent()).toBe(undefined);

View File

@ -1,5 +1,6 @@
import { tuple } from './type';
// eslint-disable-next-line import/prefer-default-export
export const PresetColorTypes = tuple(
'pink',
'red',

View File

@ -28,7 +28,7 @@ export default function wrapperRaf(callback: () => void, delayFrames: number = 1
return myId;
}
wrapperRaf.cancel = function(pid?: number) {
wrapperRaf.cancel = function cancel(pid?: number) {
if (pid === undefined) return;
raf.cancel(ids[pid]);

View File

@ -1,5 +1,6 @@
import * as React from 'react';
// eslint-disable-next-line import/prefer-default-export
export function cloneElement(element: React.ReactNode, ...restArgs: any[]) {
if (!React.isValidElement(element)) return element;

View File

@ -12,6 +12,7 @@ if (typeof window !== 'undefined') {
};
};
window.matchMedia = window.matchMedia || matchMediaPolyfill;
// eslint-disable-next-line global-require
enquire = require('enquire.js');
}
@ -57,8 +58,8 @@ const responsiveObserve = {
}
const token = (++subUid).toString();
subscribers.push({
token: token,
func: func,
token,
func,
});
func(screens);
return token;

View File

@ -20,6 +20,7 @@ export default function throttleByAnimationFrame(fn: (...args: any[]) => void) {
}
export function throttleByAnimationFrameDecorator() {
// eslint-disable-next-line func-names
return function(target: any, key: string, descriptor: any) {
const fn = descriptor.value;
let definingProperty = false;

View File

@ -1,5 +1,5 @@
import addEventListener from 'rc-util/lib/Dom/addEventListener';
import Affix from './';
import Affix from '.';
export type BindElement = HTMLElement | Window | null | undefined;
export type Rect = ClientRect | DOMRect;

View File

@ -1,31 +1,11 @@
import * as React from 'react';
import * as ReactDOM from 'react-dom';
export interface InputElementProps {
children: React.ReactElement<any>;
}
export default class InputElement extends React.Component<InputElementProps, any> {
private ele: HTMLInputElement;
focus = () => {
if (this.ele.focus) {
this.ele.focus();
} else {
(ReactDOM.findDOMNode(this.ele) as HTMLInputElement).focus();
}
};
blur = () => {
if (this.ele.blur) {
this.ele.blur();
} else {
(ReactDOM.findDOMNode(this.ele) as HTMLInputElement).blur();
}
};
saveRef = (ele: HTMLInputElement) => {
this.ele = ele;
const { ref: childRef } = this.props.children as any;
if (typeof childRef === 'function') {
childRef(ele);

View File

@ -52,4 +52,25 @@ describe('AutoComplete children could be focus', () => {
jest.runAllTimers();
expect(handleBlur).toHaveBeenCalled();
});
it('child.ref should work', () => {
const mockRef = jest.fn();
mount(
<AutoComplete dataSource={[]}>
<input ref={mockRef} />
</AutoComplete>,
);
expect(mockRef).toHaveBeenCalled();
});
it('child.ref instance should support be focused and blured', () => {
let inputRef;
mount(
<AutoComplete dataSource={[]}>
<input ref={node => { inputRef = node; }} />
</AutoComplete>,
);
expect(typeof inputRef.focus).toBe('function');
expect(typeof inputRef.blur).toBe('function');
});
});

View File

@ -23,13 +23,35 @@ describe('AutoComplete with Custom Input Element Render', () => {
expect(dropdownWrapper.find('MenuItem').length).toBe(3);
});
it('child.ref should work', () => {
const mockRef = jest.fn();
mount(
<AutoComplete dataSource={[]}>
<input ref={mockRef} />
it('AutoComplete should work when dataSource is object array', () => {
const wrapper = mount(
<AutoComplete dataSource={[{ text: 'text', value: 'value' }, { text: 'abc', value: 'xxx' }]}>
<input />
</AutoComplete>,
);
expect(mockRef).toHaveBeenCalled();
expect(wrapper.find('input').length).toBe(1);
wrapper.find('input').simulate('change', { target: { value: 'a' } });
const dropdownWrapper = mount(
wrapper
.find('Trigger')
.instance()
.getComponent(),
);
// should not filter data source defaultly
expect(dropdownWrapper.find('MenuItem').length).toBe(2);
});
it('AutoComplete throws error when contains invalid dataSource', () => {
jest.spyOn(console, 'error').mockImplementation(() => undefined);
expect(() => {
mount(
<AutoComplete dataSource={[() => {}]}>
<textarea />
</AutoComplete>,
);
}).toThrow();
// eslint-disable-next-line no-console
console.error.mockRestore();
});
});

View File

@ -23,8 +23,8 @@ const dataSource = ['12345', '23456', '34567'];
| allowClear | Show clear button, effective in multiple mode only. | boolean | false | |
| autoFocus | get focus when component mounted | boolean | false | |
| backfill | backfill selected item the input when using keyboard | boolean | false | |
| children (for customize input element) | customize input element | HTMLInputElement / HTMLTextAreaElement / React.ReactElement<InputProps> | `<Input />` | |
| children (for dataSource) | Data source for autocomplete | React.ReactElement<OptionProps> / Array&lt;React.ReactElement<OptionProps>> | - | |
| children (for customize input element) | customize input element | HTMLInputElement <br /><br /> HTMLTextAreaElement <br /><br /> `React.ReactElement<InputProps>` | `<Input />` | |
| children (for dataSource) | Data source to auto complete | `React.ReactElement<OptionProps>` <br /><br /> `Array<React.ReactElement<OptionProps>>` | - | |
| dataSource | Data source for autocomplete | [DataSourceItemType](https://git.io/vMMKF)\[] | - | |
| defaultActiveFirstOption | Whether active first option by default | boolean | true | |
| defaultValue | Initial selected option. | string\|string\[] | - | |

View File

@ -24,8 +24,8 @@ const dataSource = ['12345', '23456', '34567'];
| allowClear | 支持清除, 单选模式有效 | boolean | false | |
| autoFocus | 自动获取焦点 | boolean | false | |
| backfill | 使用键盘选择选项的时候把选中项回填到输入框中 | boolean | false | |
| children (自动完成的数据源) | 自动完成的数据源 | React.ReactElement<OptionProps> / Array&lt;React.ReactElement<OptionProps>> | - | | |
| children (自定义输入框) | 自定义输入框 | HTMLInputElement / HTMLTextAreaElement / React.ReactElement<InputProps> | `<Input />` | @todo.muyu |
| children (自定义输入框) | 自定义输入框 | HTMLInputElement <br /><br /> HTMLTextAreaElement <br /><br /> `React.ReactElement<InputProps>` | `<Input />` | |
| children (自动完成的数据源) | 自动完成的数据源 | `React.ReactElement<OptionProps>` <br /><br /> `Array<React.ReactElement<OptionProps>>` | - | |
| dataSource | 自动完成的数据源 | [DataSourceItemType](https://git.io/vMMKF)\[] | | |
| defaultActiveFirstOption | 是否默认高亮第一个选项。 | boolean | true | |
| defaultValue | 指定默认选中的条目 | string\|string\[]\| 无 | |

View File

@ -2907,7 +2907,9 @@ exports[`Badge should support offset when count is a ReactNode 1`] = `
<a
class="head-example"
href="#"
/>
>
head
</a>
<span
class="ant-scroll-number-custom-component custom"
style="right:-10px;margin-top:20px;color:#f5222d"

View File

@ -84,7 +84,7 @@ describe('Badge', () => {
it('should support offset when count is a ReactNode', () => {
const wrapper = render(
<Badge count={<span className="custom" style={{ color: '#f5222d' }} />} offset={[10, 20]}>
<a href="#" className="head-example" />
<a href="#" className="head-example">head</a>
</Badge>,
);
expect(wrapper).toMatchSnapshot();

View File

@ -271,7 +271,7 @@ class Button extends React.Component<ButtonProps, ButtonState> {
? spaceChildren(children, this.isNeedInserted() && autoInsertSpace)
: null;
const linkButtonRestProps = omit(rest as AnchorButtonProps, ['htmlType']);
const linkButtonRestProps = omit(rest as AnchorButtonProps, ['htmlType', 'loading']);
if (linkButtonRestProps.href !== undefined) {
return (
<a
@ -291,7 +291,7 @@ class Button extends React.Component<ButtonProps, ButtonState> {
const buttonNode = (
<button
{...omit(otherProps, ['loading']) as NativeButtonProps}
{...(omit(otherProps, ['loading']) as NativeButtonProps)}
type={htmlType}
className={classes}
onClick={this.handleClick}

View File

@ -13,7 +13,7 @@ title:
## en-US
`Button` components can contain an `Icon`. This is done by setting the `icon` property or placing an `Icon` component within the `Button`
`Button` components can contain an `Icon`. This is done by setting the `icon` property or placing an `Icon` component within the `Button`.
If you want specific control over the positioning and placement of the `Icon`, then that should be done by placing the `Icon` component within the `Button` rather than using the `icon` property.

View File

@ -193,11 +193,11 @@
}
a.@{btn-prefix-cls} {
line-height: @btn-height-base - 2px;
// Fixing https://github.com/ant-design/ant-design/issues/12978
// It is a render problem of chrome, which is only happened in the codesandbox demo
// 0.1px for padding-top solution works and I don't why
padding-top: 0.1px;
line-height: @btn-height-base - 2px;
&-lg {
line-height: @btn-height-lg - 2px;

View File

@ -1,2 +1,3 @@
import ar_EG from '../../date-picker/locale/ar_EG';
export default ar_EG;

View File

@ -1,2 +1,3 @@
import bg_BG from '../../date-picker/locale/bg_BG';
export default bg_BG;

View File

@ -1,2 +1,3 @@
import ca_ES from '../../date-picker/locale/ca_ES';
export default ca_ES;

View File

@ -1,2 +1,3 @@
import cs_CZ from '../../date-picker/locale/cs_CZ';
export default cs_CZ;

View File

@ -1,2 +1,3 @@
import da_DK from '../../date-picker/locale/da_DK';
export default da_DK;

View File

@ -1,2 +1,3 @@
import de_DE from '../../date-picker/locale/de_DE';
export default de_DE;

View File

@ -1,2 +1,3 @@
import el_GR from '../../date-picker/locale/el_GR';
export default el_GR;

View File

@ -1,2 +1,3 @@
import en_GB from '../../date-picker/locale/en_GB';
export default en_GB;

View File

@ -1,2 +1,3 @@
import en_US from '../../date-picker/locale/en_US';
export default en_US;

View File

@ -1,2 +1,3 @@
import es_ES from '../../date-picker/locale/es_ES';
export default es_ES;

View File

@ -1,2 +1,3 @@
import et_EE from '../../date-picker/locale/et_EE';
export default et_EE;

View File

@ -1,2 +1,3 @@
import fa_IR from '../../date-picker/locale/fa_IR';
export default fa_IR;

View File

@ -1,2 +1,3 @@
import fi_FI from '../../date-picker/locale/fi_FI';
export default fi_FI;

View File

@ -1,2 +1,3 @@
import fr_BE from '../../date-picker/locale/fr_BE';
export default fr_BE;

View File

@ -1,2 +1,3 @@
import fr_FR from '../../date-picker/locale/fr_FR';
export default fr_FR;

View File

@ -1,2 +1,3 @@
import he_IL from '../../date-picker/locale/he_IL';
export default he_IL;

View File

@ -1,2 +1,3 @@
import hi_IN from '../../date-picker/locale/hi_IN';
export default hi_IN;

View File

@ -1,2 +1,3 @@
import hr_HR from '../../date-picker/locale/hr_HR';
export default hr_HR;

View File

@ -1,2 +1,3 @@
import hu_HU from '../../date-picker/locale/hu_HU';
export default hu_HU;

View File

@ -1,2 +1,3 @@
import id_ID from '../../date-picker/locale/id_ID';
export default id_ID;

View File

@ -1,2 +1,3 @@
import is_IS from '../../date-picker/locale/is_IS';
export default is_IS;

View File

@ -1,2 +1,3 @@
import it_IT from '../../date-picker/locale/it_IT';
export default it_IT;

View File

@ -1,2 +1,3 @@
import ja_JP from '../../date-picker/locale/ja_JP';
export default ja_JP;

View File

@ -1,2 +1,3 @@
import kn_IN from '../../date-picker/locale/kn_IN';
export default kn_IN;

View File

@ -1,2 +1,3 @@
import ko_KR from '../../date-picker/locale/ko_KR';
export default ko_KR;

View File

@ -1,2 +1,3 @@
import ku_IQ from '../../date-picker/locale/ku_IQ';
export default ku_IQ;

View File

@ -1,2 +1,3 @@
import lv_LV from '../../date-picker/locale/lv_LV';
export default lv_LV;

View File

@ -1,2 +1,3 @@
import mn_MN from '../../date-picker/locale/mn_MN';
export default mn_MN;

View File

@ -1,2 +1,3 @@
import ms_MY from '../../date-picker/locale/ms_MY';
export default ms_MY;

View File

@ -1,2 +1,3 @@
import nb_NO from '../../date-picker/locale/nb_NO';
export default nb_NO;

View File

@ -1,2 +1,3 @@
import nl_BE from '../../date-picker/locale/nl_BE';
export default nl_BE;

View File

@ -1,2 +1,3 @@
import nl_NL from '../../date-picker/locale/nl_NL';
export default nl_NL;

View File

@ -1,2 +1,3 @@
import pl_PL from '../../date-picker/locale/pl_PL';
export default pl_PL;

View File

@ -1,2 +1,3 @@
import pt_BR from '../../date-picker/locale/pt_BR';
export default pt_BR;

View File

@ -1,2 +1,3 @@
import pt_PT from '../../date-picker/locale/pt_PT';
export default pt_PT;

View File

@ -1,2 +1,3 @@
import ru_RU from '../../date-picker/locale/ru_RU';
export default ru_RU;

View File

@ -1,2 +1,3 @@
import sk_SK from '../../date-picker/locale/sk_SK';
export default sk_SK;

View File

@ -1,2 +1,3 @@
import sl_SI from '../../date-picker/locale/sl_SI';
export default sl_SI;

View File

@ -1,2 +1,3 @@
import sr_RS from '../../date-picker/locale/sr_RS';
export default sr_RS;

View File

@ -1,2 +1,3 @@
import sv_SE from '../../date-picker/locale/sv_SE';
export default sv_SE;

View File

@ -1,2 +1,3 @@
import ta_IN from '../../date-picker/locale/ta_IN';
export default ta_IN;

View File

@ -1,2 +1,3 @@
import th_TH from '../../date-picker/locale/th_TH';
export default th_TH;

View File

@ -1,2 +1,3 @@
import tr_TR from '../../date-picker/locale/tr_TR';
export default tr_TR;

View File

@ -1,2 +1,3 @@
import uk_UA from '../../date-picker/locale/uk_UA';
export default uk_UA;

View File

@ -1,2 +1,3 @@
import vi_VN from '../../date-picker/locale/vi_VN';
export default vi_VN;

View File

@ -1,2 +1,3 @@
import zh_CN from '../../date-picker/locale/zh_CN';
export default zh_CN;

View File

@ -1,2 +1,3 @@
import zh_TW from '../../date-picker/locale/zh_TW';
export default zh_TW;

View File

@ -87,7 +87,6 @@ describe('Carousel', () => {
<div />
</Carousel>,
);
jest.runAllTimers();
expect(wrapper.render()).toMatchSnapshot();
});
});
@ -117,6 +116,11 @@ describe('Carousel', () => {
});
it('should keep initialSlide', () => {
// react unsafe lifecycle don't works in React 15
// https://github.com/akiran/react-slick/commit/97988e897750e1d8f7b10a86b655f50d75d38298
if (process.env.REACT === '15') {
return;
}
const wrapper = mount(<Carousel initialSlide={1} />);
wrapper.setProps({
children: [<div key="1" />, <div key="2" />, <div key="3" />],

View File

@ -496,7 +496,7 @@ class Cascader extends React.Component<CascaderProps, CascaderState> {
]);
let { options } = props;
if (options.length > 0) {
if (options && options.length > 0) {
if (state.inputValue) {
options = this.generateFilteredOptions(prefixCls, renderEmpty);
}

View File

@ -137,6 +137,12 @@
color: @disabled-color;
cursor: not-allowed;
}
// Not show highlight border of checkbox when disabled
&:hover::after,
.@{checkbox-prefix-cls}-wrapper:hover &::after {
visibility: hidden;
}
}
.@{checkbox-prefix-cls}-wrapper {

View File

@ -28,6 +28,7 @@ import {
Transfer,
Radio,
} from 'antd';
import enUS from 'antd/es/locale/en_US';
import zhCN from 'antd/es/locale/zh_CN';
import moment from 'moment';
import 'moment/locale/zh-cn';
@ -125,7 +126,7 @@ class App extends React.Component {
constructor() {
super();
this.state = {
locale: null,
locale: enUS,
};
}
@ -145,8 +146,8 @@ class App extends React.Component {
<div>
<div className="change-locale">
<span style={{ marginRight: 16 }}>Change locale of components: </span>
<Radio.Group defaultValue={undefined} onChange={this.changeLocale}>
<Radio.Button key="en" value={undefined}>
<Radio.Group value={locale} onChange={this.changeLocale}>
<Radio.Button key="en" value={enUS}>
English
</Radio.Button>
<Radio.Button key="cn" value={zhCN}>

View File

@ -132,7 +132,9 @@ interface ConstructorProps {
}
export function withConfigConsumer<ExportProps extends BasicExportProps>(config: ConsumerConfig) {
return function<ComponentDef>(Component: IReactComponent): React.SFC<ExportProps> & ComponentDef {
return function withConfigConsumerFunc<ComponentDef>(
Component: IReactComponent,
): React.SFC<ExportProps> & ComponentDef {
// Wrap with ConfigConsumer. Since we need compatible with react 15, be care when using ref methods
const SFC = ((props: ExportProps) => (
<ConfigConsumer>

View File

@ -56,7 +56,7 @@ export interface DatePickerProps extends PickerProps, SinglePickerProps {
}
export interface MonthPickerProps extends PickerProps, SinglePickerProps {
// - currently no own props -
monthCellContentRender?: (date: moment.Moment, locale: any) => React.ReactNode
}
export type RangePickerValue =

View File

@ -1,5 +1,6 @@
import * as moment from 'moment';
// eslint-disable-next-line import/prefer-default-export
export function formatDate(
value: moment.Moment | undefined | null,
format: string | string[],

View File

@ -156,6 +156,69 @@ exports[`renders ./components/drawer/demo/placement.md correctly 1`] = `
</div>
`;
exports[`renders ./components/drawer/demo/render-in-current.md correctly 1`] = `
<div
style="height:200px;overflow:hidden;position:relative;border:1px solid #ebedf0;border-radius:2px;padding:48px;text-align:center;background:#fafafa"
>
Render in this
<div
style="margin-top:16px"
>
<button
class="ant-btn ant-btn-primary"
type="button"
>
<span>
Open
</span>
</button>
</div>
<div
class=""
>
<div
class="ant-drawer ant-drawer-right"
style="position:absolute"
tabindex="-1"
>
<div
class="ant-drawer-mask"
/>
<div
class="ant-drawer-content-wrapper"
style="transform:translateX(100%);-ms-transform:translateX(100%);width:256px"
>
<div
class="ant-drawer-content"
>
<div
class="ant-drawer-wrapper-body"
style="overflow:auto;height:100%"
>
<div
class="ant-drawer-header"
>
<div
class="ant-drawer-title"
>
Basic Drawer
</div>
</div>
<div
class="ant-drawer-body"
>
<p>
Some contents...
</p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
`;
exports[`renders ./components/drawer/demo/user-profile.md correctly 1`] = `
<div>
<div

View File

@ -0,0 +1,71 @@
---
order: 2
title:
zh-CN: 渲染在当前 DOM
en-US: Render in current dom
---
## zh-CN
渲染在当前 dom 里。自定义容器,查看 getContainer。
## en-US
Render in current dom. custom container, check getContainer.
```jsx
import { Drawer, Button } from 'antd';
class App extends React.Component {
state = { visible: false };
showDrawer = () => {
this.setState({
visible: true,
});
};
onClose = () => {
this.setState({
visible: false,
});
};
render() {
return (
<div
style={{
height: 200,
overflow: 'hidden',
position: 'relative',
border: '1px solid #ebedf0',
borderRadius: 2,
padding: 48,
textAlign: 'center',
background: '#fafafa',
}}
>
Render in this
<div style={{ marginTop: 16 }}>
<Button type="primary" onClick={this.showDrawer}>
Open
</Button>
</div>
<Drawer
title="Basic Drawer"
placement="right"
closable={false}
onClose={this.onClose}
visible={this.state.visible}
getContainer={false}
style={{ position: 'absolute' }}
>
<p>Some contents...</p>
</Drawer>
</div>
);
}
}
ReactDOM.render(<App />, mountNode);
```

View File

@ -11,14 +11,14 @@
z-index: @zindex-modal;
width: 0%;
height: 100%;
transition: transform @animation-duration-slow @ease-base-out;
transition: transform @animation-duration-slow @ease-base-out, height 0s ease @animation-duration-slow, width 0s ease @animation-duration-slow;
> * {
transition: transform @animation-duration-slow @ease-base-out,
box-shadow @animation-duration-slow @ease-base-out;
}
&-content-wrapper {
position: fixed;
position: absolute;
}
.@{drawer-prefix-cls}-content {
width: 100%;
@ -35,6 +35,7 @@
}
&.@{drawer-prefix-cls}-open {
width: 100%;
transition: transform @animation-duration-slow @ease-base-out;
}
&.@{drawer-prefix-cls}-open.no-mask {
width: 0%;
@ -75,6 +76,7 @@
}
&.@{drawer-prefix-cls}-open {
height: 100%;
transition: transform @animation-duration-slow @ease-base-out;
}
&.@{drawer-prefix-cls}-open.no-mask {
height: 0%;
@ -186,7 +188,7 @@
}
&-mask {
position: fixed;
position: absolute;
top: 0;
left: 0;
width: 100%;

View File

@ -22,7 +22,7 @@ export interface DropdownButtonProps extends ButtonGroupProps, DropDownProps {
icon?: React.ReactNode;
href?: string;
children?: React.ReactNode;
title: string;
title?: string;
}
export default class DropdownButton extends React.Component<DropdownButtonProps, any> {

View File

@ -10,7 +10,7 @@ import { tuple } from '../_util/type';
import warning from '../_util/warning';
import FormItem, { FormLabelAlign } from './FormItem';
import { FIELD_META_PROP, FIELD_DATA_PROP } from './constants';
import { FormContext } from './context';
import FormContext from './context';
import { FormWrappedProps } from './interface';
type FormCreateOptionMessagesCallback = (...args: any[]) => string;
@ -221,7 +221,7 @@ export default class Form extends React.Component<FormProps, any> {
static createFormField = createFormField;
static create = function<TOwnProps extends FormComponentProps>(
static create = function create<TOwnProps extends FormComponentProps>(
options: FormCreateOption<TOwnProps> = {},
): FormWrappedProps<TOwnProps> {
return createDOMForm({

View File

@ -10,7 +10,7 @@ import { ConfigConsumer, ConfigConsumerProps } from '../config-provider';
import warning from '../_util/warning';
import { tuple } from '../_util/type';
import { FIELD_META_PROP, FIELD_DATA_PROP } from './constants';
import { FormContext, FormContextProps } from './context';
import FormContext, { FormContextProps } from './context';
const ValidateStatuses = tuple('success', 'warning', 'error', 'validating', '');

View File

@ -10,7 +10,9 @@ export interface FormContextProps {
wrapperCol?: ColProps;
}
export const FormContext = createReactContext<FormContextProps>({
const FormContext = createReactContext<FormContextProps>({
labelAlign: 'right',
vertical: false,
});
export default FormContext;

View File

@ -73,24 +73,27 @@ class PriceInput extends React.Component {
// Should provide an event to pass value to Form.
const { onChange } = this.props;
if (onChange) {
onChange(Object.assign({}, this.state, changedValue));
onChange({
...this.state,
...changedValue,
});
}
};
render() {
const { size } = this.props;
const { state } = this;
const { currency, number } = this.state;
return (
<span>
<Input
type="text"
size={size}
value={state.number}
value={number}
onChange={this.handleNumberChange}
style={{ width: '65%', marginRight: '3%' }}
/>
<Select
value={state.currency}
value={currency}
size={size}
style={{ width: '32%' }}
onChange={this.handleCurrencyChange}

View File

@ -11,7 +11,7 @@ title:
## en-US
Use tag `<Icon />` to create an icon and set its type in the `type` prop. Specific the `spin` property to show spinning animation and the `theme` property to switch different themes.
Use tag `<Icon />` to create an icon and set its type in the `type` prop. Specify the `spin` property to show spinning animation and the `theme` property to switch between different themes.
```jsx
import { Icon } from 'antd';

View File

@ -11,7 +11,7 @@ title:
## en-US
Specific them property `theme` to `twoTone` to render two-tone icons. You can also set the primary color.
Specify the property `theme` to `twoTone` to render two-tone icons. You can also set the primary color.
```jsx
import { Icon } from 'antd';

View File

@ -24,13 +24,13 @@ ReactDOM.render(<IconDisplay />, mountNode);
| spin | Rotate icon with animation | boolean | false | |
| rotate | Rotate degrees (added in 3.13.0, not working in IE9) | number | - | 3.13.0 |
| component | The component used for the root node. This will override the **`type`** property. | ComponentType<CustomIconComponentProps\> | - | 3.9.0 |
| twoToneColor | Only support the two-tone icon. Specific the primary color. | string (hex color) | - | 3.9.0 |
| twoToneColor | Only supports the two-tone icon. Specify the primary color. | string (hex color) | - | 3.9.0 |
### SVG icons
We introduced SVG icons in `3.9.0` version replacing font icons which brings benefits below:
- Complete offline usage of icon, no dependency of CDN font icon file and no more empty square during downloading than no need to deploy icon font files locally either.
- Complete offline usage of icon, no dependency of CDN font icon file. No more empty square during downloading and no need to deploy icon font files locally either.
- Much more display accuracy in lower-level screens.
- Support multiple colors for icon.
- No need to change built-in icons with overriding styles by providing more props in component.
@ -64,7 +64,7 @@ Icon.getTwoToneColor(); // #eb2f96
### Custom Font Icon
We added a `createFromIconfontCN` function to help developer using their own icons deployed at [iconfont.cn](http://iconfont.cn/) in a convenient way.
We added a `createFromIconfontCN` function to help developer use their own icons deployed at [iconfont.cn](http://iconfont.cn/) in a convenient way.
> This method is specified for [iconfont.cn](http://iconfont.cn/).
@ -76,7 +76,7 @@ const MyIcon = Icon.createFromIconfontCN({
ReactDOM.render(<MyIcon type="icon-example" />, mountedNode);
```
It create a component that uses SVG sprites in essence.
It creates a component that uses SVG sprites in essence.
The following options are available:
@ -91,7 +91,7 @@ See [iconfont.cn documents](http://iconfont.cn/help/detail?spm=a313x.7781069.199
### Custom SVG Icon
You can import SVG icon as an react component by using `webpack` and [`@svgr/webpack`](https://www.npmjs.com/package/@svgr/webpack). `@svgr/webpack`'s `options` [reference](https://github.com/smooth-code/svgr#options).
You can import SVG icon as a react component by using `webpack` and [`@svgr/webpack`](https://www.npmjs.com/package/@svgr/webpack). `@svgr/webpack`'s `options` [reference](https://github.com/smooth-code/svgr#options).
```js
// webpack.config.js

View File

@ -7,7 +7,7 @@ export const svgBaseProps = {
width: '1em',
height: '1em',
fill: 'currentColor',
['aria-hidden']: true,
'aria-hidden': true,
focusable: 'false',
};

View File

@ -5,9 +5,10 @@ if (
ENV !== 'production' &&
ENV !== 'test' &&
typeof console !== 'undefined' &&
console.warn &&
console.warn && // eslint-disable-line no-console
typeof window !== 'undefined'
) {
// eslint-disable-next-line no-console
console.warn(
'You are using a whole package of antd, ' +
'please use https://www.npmjs.com/package/babel-plugin-import to reduce app bundle size.',

View File

@ -58,6 +58,7 @@ export default class ActionButton extends React.Component<ActionButtonProps, Act
},
(e: Error) => {
// Emit error when catch promise reject
// eslint-disable-next-line no-console
console.error(e);
// See: https://github.com/ant-design/ant-design/issues/6183
this.setState({ loading: false });

View File

@ -146,7 +146,7 @@ export default function confirm(config: ModalFuncProps) {
}
function render(props: any) {
ReactDOM.render(<ConfirmDialog {...props} getContainer={false} />, div);
ReactDOM.render(<ConfirmDialog getContainer={false} {...props} />, div);
}
function close(...args: any[]) {

View File

@ -16,7 +16,7 @@ function modalWarn(props: ModalFuncProps) {
return confirm(config);
}
Modal.info = function(props: ModalFuncProps) {
Modal.info = function infoFn(props: ModalFuncProps) {
const config = {
type: 'info',
icon: <Icon type="info-circle" />,
@ -26,7 +26,7 @@ Modal.info = function(props: ModalFuncProps) {
return confirm(config);
};
Modal.success = function(props: ModalFuncProps) {
Modal.success = function successFn(props: ModalFuncProps) {
const config = {
type: 'success',
icon: <Icon type="check-circle" />,
@ -36,7 +36,7 @@ Modal.success = function(props: ModalFuncProps) {
return confirm(config);
};
Modal.error = function(props: ModalFuncProps) {
Modal.error = function errorFn(props: ModalFuncProps) {
const config = {
type: 'error',
icon: <Icon type="close-circle" />,
@ -50,7 +50,7 @@ Modal.warning = modalWarn;
Modal.warn = modalWarn;
Modal.confirm = function(props: ModalFuncProps) {
Modal.confirm = function confirmFn(props: ModalFuncProps) {
const config = {
type: 'confirm',
okCancel: true,
@ -59,7 +59,7 @@ Modal.confirm = function(props: ModalFuncProps) {
return confirm(config);
};
Modal.destroyAll = function() {
Modal.destroyAll = function destroyAllFn() {
while (destroyFns.length) {
const close = destroyFns.pop();
if (close) {

View File

@ -713,7 +713,7 @@ exports[`renders ./components/progress/demo/gradient-line.md correctly 1`] = `
>
<defs>
<linearGradient
id="gradient"
id="ant-progress-gradient-10"
x1="100%"
x2="0%"
y1="0%"
@ -746,7 +746,7 @@ exports[`renders ./components/progress/demo/gradient-line.md correctly 1`] = `
a 47,47 0 1 1 0,94
a 47,47 0 1 1 0,-94"
fill-opacity="0"
stroke="url(#gradient)"
stroke="url(#ant-progress-gradient-10)"
stroke-linecap="round"
stroke-width="6"
style="stroke:[object Object];stroke-dasharray:265.77873849369655px 295.3097094374406px;stroke-dashoffset:-0px;transition:stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s"
@ -773,7 +773,7 @@ exports[`renders ./components/progress/demo/gradient-line.md correctly 1`] = `
>
<defs>
<linearGradient
id="gradient"
id="ant-progress-gradient-11"
x1="100%"
x2="0%"
y1="0%"
@ -806,7 +806,7 @@ exports[`renders ./components/progress/demo/gradient-line.md correctly 1`] = `
a 47,47 0 1 1 0,94
a 47,47 0 1 1 0,-94"
fill-opacity="0"
stroke="url(#gradient)"
stroke="url(#ant-progress-gradient-11)"
stroke-linecap="round"
stroke-width="6"
style="stroke:[object Object];stroke-dasharray:295.3097094374406px 295.3097094374406px;stroke-dashoffset:-0px;transition:stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s"

View File

@ -1,7 +1,9 @@
// eslint-disable-next-line import/prefer-default-export
export function validProgress(progress: number | undefined) {
if (!progress || progress < 0) {
return 0;
} else if (progress > 100) {
}
if (progress > 100) {
return 100;
}
return progress;

View File

@ -62,7 +62,11 @@ class SearchInput extends React.Component {
};
handleSearch = value => {
fetch(value, data => this.setState({ data }));
if (value) {
fetch(value, data => this.setState({ data }));
} else {
this.setState({ data: [] });
}
};
handleChange = value => {

View File

@ -1,22 +1,121 @@
import * as React from 'react';
import classNames from 'classnames';
import { polyfill } from 'react-lifecycles-compat';
import Checkbox, { CheckboxChangeEvent } from '../checkbox';
import Dropdown from '../dropdown';
import Menu from '../menu';
import Icon from '../icon';
import { SelectionCheckboxAllProps, SelectionCheckboxAllState, SelectionItem } from './interface';
export default class SelectionCheckboxAll<T> extends React.Component<
function checkSelection<T>({
store,
getCheckboxPropsByItem,
getRecordKey,
data,
type,
byDefaultChecked,
}: {
store: SelectionCheckboxAllProps<T>['store'];
getCheckboxPropsByItem: SelectionCheckboxAllProps<T>['getCheckboxPropsByItem'];
getRecordKey: SelectionCheckboxAllProps<T>['getRecordKey'];
data: T[];
type: string;
byDefaultChecked: boolean;
}) {
// type should be 'every' | 'some'
if (type === 'every' || type === 'some') {
return byDefaultChecked
? data[type]((item, i) => getCheckboxPropsByItem(item, i).defaultChecked)
: data[type](
(item, i) => store.getState().selectedRowKeys.indexOf(getRecordKey(item, i)) >= 0,
);
}
return false;
}
function getIndeterminateState<T>(props: SelectionCheckboxAllProps<T>) {
const { store, data } = props;
if (!data.length) {
return false;
}
const someCheckedNotByDefaultChecked =
checkSelection<T>({
...props,
data,
type: 'some',
byDefaultChecked: false,
}) &&
!checkSelection<T>({
...props,
data,
type: 'every',
byDefaultChecked: false,
});
const someCheckedByDefaultChecked =
checkSelection<T>({
...props,
data,
type: 'some',
byDefaultChecked: true,
}) &&
!checkSelection<T>({
...props,
data,
type: 'every',
byDefaultChecked: true,
});
if (store.getState().selectionDirty) {
return someCheckedNotByDefaultChecked;
}
return someCheckedNotByDefaultChecked || someCheckedByDefaultChecked;
}
function getCheckState<T>(props: SelectionCheckboxAllProps<T>) {
const { store, data } = props;
if (!data.length) {
return false;
}
if (store.getState().selectionDirty) {
return checkSelection({
...props,
data,
type: 'every',
byDefaultChecked: false,
});
}
return (
checkSelection({
...props,
data,
type: 'every',
byDefaultChecked: false,
}) ||
checkSelection({
...props,
data,
type: 'every',
byDefaultChecked: true,
})
);
}
class SelectionCheckboxAll<T> extends React.Component<
SelectionCheckboxAllProps<T>,
SelectionCheckboxAllState
> {
state = {
checked: false,
indeterminate: false,
};
unsubscribe: () => void;
defaultSelections: SelectionItem[];
constructor(props: SelectionCheckboxAllProps<T>) {
super(props);
this.defaultSelections = props.hideDefaultSelections
? []
: [
@ -31,21 +130,28 @@ export default class SelectionCheckboxAll<T> extends React.Component<
onSelect: () => {},
},
];
}
this.state = {
checked: this.getCheckState(props),
indeterminate: this.getIndeterminateState(props),
};
static getDerivedStateFromProps<T>(
props: SelectionCheckboxAllProps<T>,
state: SelectionCheckboxAllState,
) {
const checked = getCheckState(props);
const indeterminate = getIndeterminateState(props);
const newState: SelectionCheckboxAllState = {};
if (indeterminate !== state.indeterminate) {
newState.indeterminate = indeterminate;
}
if (checked !== state.checked) {
newState.checked = checked;
}
return newState;
}
componentDidMount() {
this.subscribe();
}
componentWillReceiveProps(nextProps: SelectionCheckboxAllProps<T>) {
this.setCheckState(nextProps);
}
componentWillUnmount() {
if (this.unsubscribe) {
this.unsubscribe();
@ -53,8 +159,8 @@ export default class SelectionCheckboxAll<T> extends React.Component<
}
setCheckState(props: SelectionCheckboxAllProps<T>) {
const checked = this.getCheckState(props);
const indeterminate = this.getIndeterminateState(props);
const checked = getCheckState(props);
const indeterminate = getIndeterminateState(props);
this.setState(prevState => {
const newState: SelectionCheckboxAllState = {};
if (indeterminate !== prevState.indeterminate) {
@ -67,60 +173,11 @@ export default class SelectionCheckboxAll<T> extends React.Component<
});
}
getIndeterminateState(props: SelectionCheckboxAllProps<T>) {
const { store, data } = props;
let indeterminate;
if (!data.length) {
indeterminate = false;
} else {
indeterminate = store.getState().selectionDirty
? this.checkSelection(props, data, 'some', false) &&
!this.checkSelection(props, data, 'every', false)
: (this.checkSelection(props, data, 'some', false) &&
!this.checkSelection(props, data, 'every', false)) ||
(this.checkSelection(props, data, 'some', true) &&
!this.checkSelection(props, data, 'every', true));
}
return indeterminate;
}
getCheckState(props: SelectionCheckboxAllProps<T>) {
const { store, data } = props;
let checked;
if (!data.length) {
checked = false;
} else {
checked = store.getState().selectionDirty
? this.checkSelection(props, data, 'every', false)
: this.checkSelection(props, data, 'every', false) ||
this.checkSelection(props, data, 'every', true);
}
return checked;
}
handleSelectAllChange = (e: CheckboxChangeEvent) => {
const { checked } = e.target;
this.props.onSelect(checked ? 'all' : 'removeAll', 0, null);
};
checkSelection(
props: SelectionCheckboxAllProps<T>,
data: T[],
type: string,
byDefaultChecked: boolean,
) {
const { store, getCheckboxPropsByItem, getRecordKey } = props || this.props;
// type should be 'every' | 'some'
if (type === 'every' || type === 'some') {
return byDefaultChecked
? data[type]((item, i) => getCheckboxPropsByItem(item, i).defaultChecked)
: data[type](
(item, i) => store.getState().selectedRowKeys.indexOf(getRecordKey(item, i)) >= 0,
);
}
return false;
}
subscribe() {
const { store } = this.props;
this.unsubscribe = store.subscribe(() => {
@ -187,3 +244,7 @@ export default class SelectionCheckboxAll<T> extends React.Component<
);
}
}
polyfill(SelectionCheckboxAll);
export default SelectionCheckboxAll;

View File

@ -354,9 +354,7 @@ exports[`renders ./components/table/demo/basic.md correctly 1`] = `
<td
class=""
>
<a
href="javascript:;"
>
<a>
John Brown
</a>
</td>
@ -390,18 +388,14 @@ exports[`renders ./components/table/demo/basic.md correctly 1`] = `
class=""
>
<span>
<a
href="javascript:;"
>
<a>
Invite John Brown
</a>
<div
class="ant-divider ant-divider-vertical"
role="separator"
/>
<a
href="javascript:;"
>
<a>
Delete
</a>
</span>
@ -414,9 +408,7 @@ exports[`renders ./components/table/demo/basic.md correctly 1`] = `
<td
class=""
>
<a
href="javascript:;"
>
<a>
Jim Green
</a>
</td>
@ -445,18 +437,14 @@ exports[`renders ./components/table/demo/basic.md correctly 1`] = `
class=""
>
<span>
<a
href="javascript:;"
>
<a>
Invite Jim Green
</a>
<div
class="ant-divider ant-divider-vertical"
role="separator"
/>
<a
href="javascript:;"
>
<a>
Delete
</a>
</span>
@ -469,9 +457,7 @@ exports[`renders ./components/table/demo/basic.md correctly 1`] = `
<td
class=""
>
<a
href="javascript:;"
>
<a>
Joe Black
</a>
</td>
@ -505,18 +491,14 @@ exports[`renders ./components/table/demo/basic.md correctly 1`] = `
class=""
>
<span>
<a
href="javascript:;"
>
<a>
Invite Joe Black
</a>
<div
class="ant-divider ant-divider-vertical"
role="separator"
/>
<a
href="javascript:;"
>
<a>
Delete
</a>
</span>
@ -706,9 +688,7 @@ exports[`renders ./components/table/demo/bordered.md correctly 1`] = `
<td
class=""
>
<a
href="javascript:;"
>
<a>
John Brown
</a>
</td>
@ -730,9 +710,7 @@ exports[`renders ./components/table/demo/bordered.md correctly 1`] = `
<td
class=""
>
<a
href="javascript:;"
>
<a>
Jim Green
</a>
</td>
@ -754,9 +732,7 @@ exports[`renders ./components/table/demo/bordered.md correctly 1`] = `
<td
class=""
>
<a
href="javascript:;"
>
<a>
Joe Black
</a>
</td>
@ -976,9 +952,7 @@ exports[`renders ./components/table/demo/colspan-rowspan.md correctly 1`] = `
<td
class=""
>
<a
href="javascript:;"
>
<a>
John Brown
</a>
</td>
@ -1010,9 +984,7 @@ exports[`renders ./components/table/demo/colspan-rowspan.md correctly 1`] = `
<td
class=""
>
<a
href="javascript:;"
>
<a>
Jim Green
</a>
</td>
@ -1044,9 +1016,7 @@ exports[`renders ./components/table/demo/colspan-rowspan.md correctly 1`] = `
<td
class=""
>
<a
href="javascript:;"
>
<a>
Joe Black
</a>
</td>
@ -1079,9 +1049,7 @@ exports[`renders ./components/table/demo/colspan-rowspan.md correctly 1`] = `
<td
class=""
>
<a
href="javascript:;"
>
<a>
Jim Red
</a>
</td>
@ -1109,9 +1077,7 @@ exports[`renders ./components/table/demo/colspan-rowspan.md correctly 1`] = `
class=""
colspan="5"
>
<a
href="javascript:;"
>
<a>
Jake White
</a>
</td>
@ -2560,9 +2526,7 @@ exports[`renders ./components/table/demo/dynamic-settings.md correctly 1`] = `
<td
class=""
>
<a
href="javascript:;"
>
<a>
John Brown
</a>
</td>
@ -2580,18 +2544,14 @@ exports[`renders ./components/table/demo/dynamic-settings.md correctly 1`] = `
class=""
>
<span>
<a
href="javascript:;"
>
<a>
Action 一 John Brown
</a>
<div
class="ant-divider ant-divider-vertical"
role="separator"
/>
<a
href="javascript:;"
>
<a>
Delete
</a>
<div
@ -2600,7 +2560,6 @@ exports[`renders ./components/table/demo/dynamic-settings.md correctly 1`] = `
/>
<a
class="ant-dropdown-link"
href="javascript:;"
>
More actions
<i
@ -2664,9 +2623,7 @@ exports[`renders ./components/table/demo/dynamic-settings.md correctly 1`] = `
<td
class=""
>
<a
href="javascript:;"
>
<a>
John Brown
</a>
</td>
@ -2684,18 +2641,14 @@ exports[`renders ./components/table/demo/dynamic-settings.md correctly 1`] = `
class=""
>
<span>
<a
href="javascript:;"
>
<a>
Action 一 John Brown
</a>
<div
class="ant-divider ant-divider-vertical"
role="separator"
/>
<a
href="javascript:;"
>
<a>
Delete
</a>
<div
@ -2704,7 +2657,6 @@ exports[`renders ./components/table/demo/dynamic-settings.md correctly 1`] = `
/>
<a
class="ant-dropdown-link"
href="javascript:;"
>
More actions
<i
@ -2768,9 +2720,7 @@ exports[`renders ./components/table/demo/dynamic-settings.md correctly 1`] = `
<td
class=""
>
<a
href="javascript:;"
>
<a>
John Brown
</a>
</td>
@ -2788,18 +2738,14 @@ exports[`renders ./components/table/demo/dynamic-settings.md correctly 1`] = `
class=""
>
<span>
<a
href="javascript:;"
>
<a>
Action 一 John Brown
</a>
<div
class="ant-divider ant-divider-vertical"
role="separator"
/>
<a
href="javascript:;"
>
<a>
Delete
</a>
<div
@ -2808,7 +2754,6 @@ exports[`renders ./components/table/demo/dynamic-settings.md correctly 1`] = `
/>
<a
class="ant-dropdown-link"
href="javascript:;"
>
More actions
<i
@ -2872,9 +2817,7 @@ exports[`renders ./components/table/demo/dynamic-settings.md correctly 1`] = `
<td
class=""
>
<a
href="javascript:;"
>
<a>
John Brown
</a>
</td>
@ -2892,18 +2835,14 @@ exports[`renders ./components/table/demo/dynamic-settings.md correctly 1`] = `
class=""
>
<span>
<a
href="javascript:;"
>
<a>
Action 一 John Brown
</a>
<div
class="ant-divider ant-divider-vertical"
role="separator"
/>
<a
href="javascript:;"
>
<a>
Delete
</a>
<div
@ -2912,7 +2851,6 @@ exports[`renders ./components/table/demo/dynamic-settings.md correctly 1`] = `
/>
<a
class="ant-dropdown-link"
href="javascript:;"
>
More actions
<i
@ -2976,9 +2914,7 @@ exports[`renders ./components/table/demo/dynamic-settings.md correctly 1`] = `
<td
class=""
>
<a
href="javascript:;"
>
<a>
John Brown
</a>
</td>
@ -2996,18 +2932,14 @@ exports[`renders ./components/table/demo/dynamic-settings.md correctly 1`] = `
class=""
>
<span>
<a
href="javascript:;"
>
<a>
Action 一 John Brown
</a>
<div
class="ant-divider ant-divider-vertical"
role="separator"
/>
<a
href="javascript:;"
>
<a>
Delete
</a>
<div
@ -3016,7 +2948,6 @@ exports[`renders ./components/table/demo/dynamic-settings.md correctly 1`] = `
/>
<a
class="ant-dropdown-link"
href="javascript:;"
>
More actions
<i
@ -3080,9 +3011,7 @@ exports[`renders ./components/table/demo/dynamic-settings.md correctly 1`] = `
<td
class=""
>
<a
href="javascript:;"
>
<a>
John Brown
</a>
</td>
@ -3100,18 +3029,14 @@ exports[`renders ./components/table/demo/dynamic-settings.md correctly 1`] = `
class=""
>
<span>
<a
href="javascript:;"
>
<a>
Action 一 John Brown
</a>
<div
class="ant-divider ant-divider-vertical"
role="separator"
/>
<a
href="javascript:;"
>
<a>
Delete
</a>
<div
@ -3120,7 +3045,6 @@ exports[`renders ./components/table/demo/dynamic-settings.md correctly 1`] = `
/>
<a
class="ant-dropdown-link"
href="javascript:;"
>
More actions
<i
@ -3184,9 +3108,7 @@ exports[`renders ./components/table/demo/dynamic-settings.md correctly 1`] = `
<td
class=""
>
<a
href="javascript:;"
>
<a>
John Brown
</a>
</td>
@ -3204,18 +3126,14 @@ exports[`renders ./components/table/demo/dynamic-settings.md correctly 1`] = `
class=""
>
<span>
<a
href="javascript:;"
>
<a>
Action 一 John Brown
</a>
<div
class="ant-divider ant-divider-vertical"
role="separator"
/>
<a
href="javascript:;"
>
<a>
Delete
</a>
<div
@ -3224,7 +3142,6 @@ exports[`renders ./components/table/demo/dynamic-settings.md correctly 1`] = `
/>
<a
class="ant-dropdown-link"
href="javascript:;"
>
More actions
<i
@ -3288,9 +3205,7 @@ exports[`renders ./components/table/demo/dynamic-settings.md correctly 1`] = `
<td
class=""
>
<a
href="javascript:;"
>
<a>
John Brown
</a>
</td>
@ -3308,18 +3223,14 @@ exports[`renders ./components/table/demo/dynamic-settings.md correctly 1`] = `
class=""
>
<span>
<a
href="javascript:;"
>
<a>
Action 一 John Brown
</a>
<div
class="ant-divider ant-divider-vertical"
role="separator"
/>
<a
href="javascript:;"
>
<a>
Delete
</a>
<div
@ -3328,7 +3239,6 @@ exports[`renders ./components/table/demo/dynamic-settings.md correctly 1`] = `
/>
<a
class="ant-dropdown-link"
href="javascript:;"
>
More actions
<i
@ -3392,9 +3302,7 @@ exports[`renders ./components/table/demo/dynamic-settings.md correctly 1`] = `
<td
class=""
>
<a
href="javascript:;"
>
<a>
John Brown
</a>
</td>
@ -3412,18 +3320,14 @@ exports[`renders ./components/table/demo/dynamic-settings.md correctly 1`] = `
class=""
>
<span>
<a
href="javascript:;"
>
<a>
Action 一 John Brown
</a>
<div
class="ant-divider ant-divider-vertical"
role="separator"
/>
<a
href="javascript:;"
>
<a>
Delete
</a>
<div
@ -3432,7 +3336,6 @@ exports[`renders ./components/table/demo/dynamic-settings.md correctly 1`] = `
/>
<a
class="ant-dropdown-link"
href="javascript:;"
>
More actions
<i
@ -3496,9 +3399,7 @@ exports[`renders ./components/table/demo/dynamic-settings.md correctly 1`] = `
<td
class=""
>
<a
href="javascript:;"
>
<a>
John Brown
</a>
</td>
@ -3516,18 +3417,14 @@ exports[`renders ./components/table/demo/dynamic-settings.md correctly 1`] = `
class=""
>
<span>
<a
href="javascript:;"
>
<a>
Action 一 John Brown
</a>
<div
class="ant-divider ant-divider-vertical"
role="separator"
/>
<a
href="javascript:;"
>
<a>
Delete
</a>
<div
@ -3536,7 +3433,6 @@ exports[`renders ./components/table/demo/dynamic-settings.md correctly 1`] = `
/>
<a
class="ant-dropdown-link"
href="javascript:;"
>
More actions
<i
@ -3798,9 +3694,7 @@ exports[`renders ./components/table/demo/edit-cell.md correctly 1`] = `
<td
class=""
>
<a
href="javascript:;"
>
<a>
Delete
</a>
</td>
@ -3832,9 +3726,7 @@ exports[`renders ./components/table/demo/edit-cell.md correctly 1`] = `
<td
class=""
>
<a
href="javascript:;"
>
<a>
Delete
</a>
</td>
@ -4622,9 +4514,7 @@ exports[`renders ./components/table/demo/expand.md correctly 1`] = `
<td
class=""
>
<a
href="javascript:;"
>
<a>
Delete
</a>
</td>
@ -4661,9 +4551,7 @@ exports[`renders ./components/table/demo/expand.md correctly 1`] = `
<td
class=""
>
<a
href="javascript:;"
>
<a>
Delete
</a>
</td>
@ -4700,9 +4588,7 @@ exports[`renders ./components/table/demo/expand.md correctly 1`] = `
<td
class=""
>
<a
href="javascript:;"
>
<a>
Delete
</a>
</td>
@ -5414,9 +5300,7 @@ exports[`renders ./components/table/demo/fixed-columns.md correctly 1`] = `
<td
class="ant-table-fixed-columns-in-body"
>
<a
href="javascript:;"
>
<a>
action
</a>
</td>
@ -5478,9 +5362,7 @@ exports[`renders ./components/table/demo/fixed-columns.md correctly 1`] = `
<td
class="ant-table-fixed-columns-in-body"
>
<a
href="javascript:;"
>
<a>
action
</a>
</td>
@ -5642,9 +5524,7 @@ exports[`renders ./components/table/demo/fixed-columns.md correctly 1`] = `
<td
class=""
>
<a
href="javascript:;"
>
<a>
action
</a>
</td>
@ -5656,9 +5536,7 @@ exports[`renders ./components/table/demo/fixed-columns.md correctly 1`] = `
<td
class=""
>
<a
href="javascript:;"
>
<a>
action
</a>
</td>
@ -6114,9 +5992,7 @@ exports[`renders ./components/table/demo/fixed-columns-header.md correctly 1`] =
<td
class="ant-table-fixed-columns-in-body"
>
<a
href="javascript:;"
>
<a>
action
</a>
</td>
@ -6178,9 +6054,7 @@ exports[`renders ./components/table/demo/fixed-columns-header.md correctly 1`] =
<td
class="ant-table-fixed-columns-in-body"
>
<a
href="javascript:;"
>
<a>
action
</a>
</td>
@ -6242,9 +6116,7 @@ exports[`renders ./components/table/demo/fixed-columns-header.md correctly 1`] =
<td
class="ant-table-fixed-columns-in-body"
>
<a
href="javascript:;"
>
<a>
action
</a>
</td>
@ -6306,9 +6178,7 @@ exports[`renders ./components/table/demo/fixed-columns-header.md correctly 1`] =
<td
class="ant-table-fixed-columns-in-body"
>
<a
href="javascript:;"
>
<a>
action
</a>
</td>
@ -6370,9 +6240,7 @@ exports[`renders ./components/table/demo/fixed-columns-header.md correctly 1`] =
<td
class="ant-table-fixed-columns-in-body"
>
<a
href="javascript:;"
>
<a>
action
</a>
</td>
@ -6434,9 +6302,7 @@ exports[`renders ./components/table/demo/fixed-columns-header.md correctly 1`] =
<td
class="ant-table-fixed-columns-in-body"
>
<a
href="javascript:;"
>
<a>
action
</a>
</td>
@ -6498,9 +6364,7 @@ exports[`renders ./components/table/demo/fixed-columns-header.md correctly 1`] =
<td
class="ant-table-fixed-columns-in-body"
>
<a
href="javascript:;"
>
<a>
action
</a>
</td>
@ -6562,9 +6426,7 @@ exports[`renders ./components/table/demo/fixed-columns-header.md correctly 1`] =
<td
class="ant-table-fixed-columns-in-body"
>
<a
href="javascript:;"
>
<a>
action
</a>
</td>
@ -6626,9 +6488,7 @@ exports[`renders ./components/table/demo/fixed-columns-header.md correctly 1`] =
<td
class="ant-table-fixed-columns-in-body"
>
<a
href="javascript:;"
>
<a>
action
</a>
</td>
@ -6690,9 +6550,7 @@ exports[`renders ./components/table/demo/fixed-columns-header.md correctly 1`] =
<td
class="ant-table-fixed-columns-in-body"
>
<a
href="javascript:;"
>
<a>
action
</a>
</td>
@ -7005,9 +6863,7 @@ exports[`renders ./components/table/demo/fixed-columns-header.md correctly 1`] =
<td
class=""
>
<a
href="javascript:;"
>
<a>
action
</a>
</td>
@ -7019,9 +6875,7 @@ exports[`renders ./components/table/demo/fixed-columns-header.md correctly 1`] =
<td
class=""
>
<a
href="javascript:;"
>
<a>
action
</a>
</td>
@ -7033,9 +6887,7 @@ exports[`renders ./components/table/demo/fixed-columns-header.md correctly 1`] =
<td
class=""
>
<a
href="javascript:;"
>
<a>
action
</a>
</td>
@ -7047,9 +6899,7 @@ exports[`renders ./components/table/demo/fixed-columns-header.md correctly 1`] =
<td
class=""
>
<a
href="javascript:;"
>
<a>
action
</a>
</td>
@ -7061,9 +6911,7 @@ exports[`renders ./components/table/demo/fixed-columns-header.md correctly 1`] =
<td
class=""
>
<a
href="javascript:;"
>
<a>
action
</a>
</td>
@ -7075,9 +6923,7 @@ exports[`renders ./components/table/demo/fixed-columns-header.md correctly 1`] =
<td
class=""
>
<a
href="javascript:;"
>
<a>
action
</a>
</td>
@ -7089,9 +6935,7 @@ exports[`renders ./components/table/demo/fixed-columns-header.md correctly 1`] =
<td
class=""
>
<a
href="javascript:;"
>
<a>
action
</a>
</td>
@ -7103,9 +6947,7 @@ exports[`renders ./components/table/demo/fixed-columns-header.md correctly 1`] =
<td
class=""
>
<a
href="javascript:;"
>
<a>
action
</a>
</td>
@ -7117,9 +6959,7 @@ exports[`renders ./components/table/demo/fixed-columns-header.md correctly 1`] =
<td
class=""
>
<a
href="javascript:;"
>
<a>
action
</a>
</td>
@ -7131,9 +6971,7 @@ exports[`renders ./components/table/demo/fixed-columns-header.md correctly 1`] =
<td
class=""
>
<a
href="javascript:;"
>
<a>
action
</a>
</td>
@ -10505,18 +10343,14 @@ exports[`renders ./components/table/demo/jsx.md correctly 1`] = `
class=""
>
<span>
<a
href="javascript:;"
>
<a>
Invite Brown
</a>
<div
class="ant-divider ant-divider-vertical"
role="separator"
/>
<a
href="javascript:;"
>
<a>
Delete
</a>
</span>
@ -10561,18 +10395,14 @@ exports[`renders ./components/table/demo/jsx.md correctly 1`] = `
class=""
>
<span>
<a
href="javascript:;"
>
<a>
Invite Green
</a>
<div
class="ant-divider ant-divider-vertical"
role="separator"
/>
<a
href="javascript:;"
>
<a>
Delete
</a>
</span>
@ -10622,18 +10452,14 @@ exports[`renders ./components/table/demo/jsx.md correctly 1`] = `
class=""
>
<span>
<a
href="javascript:;"
>
<a>
Invite Black
</a>
<div
class="ant-divider ant-divider-vertical"
role="separator"
/>
<a
href="javascript:;"
>
<a>
Delete
</a>
</span>
@ -10942,9 +10768,7 @@ exports[`renders ./components/table/demo/nested-table.md correctly 1`] = `
<td
class=""
>
<a
href="javascript:;"
>
<a>
Publish
</a>
</td>
@ -10996,9 +10820,7 @@ exports[`renders ./components/table/demo/nested-table.md correctly 1`] = `
<td
class=""
>
<a
href="javascript:;"
>
<a>
Publish
</a>
</td>
@ -11050,9 +10872,7 @@ exports[`renders ./components/table/demo/nested-table.md correctly 1`] = `
<td
class=""
>
<a
href="javascript:;"
>
<a>
Publish
</a>
</td>
@ -11780,9 +11600,7 @@ exports[`renders ./components/table/demo/resizable-column.md correctly 1`] = `
<td
class=""
>
<a
href="javascript:;"
>
<a>
Delete
</a>
</td>
@ -11814,9 +11632,7 @@ exports[`renders ./components/table/demo/resizable-column.md correctly 1`] = `
<td
class=""
>
<a
href="javascript:;"
>
<a>
Delete
</a>
</td>
@ -11848,9 +11664,7 @@ exports[`renders ./components/table/demo/resizable-column.md correctly 1`] = `
<td
class=""
>
<a
href="javascript:;"
>
<a>
Delete
</a>
</td>
@ -12095,9 +11909,7 @@ exports[`renders ./components/table/demo/row-selection.md correctly 1`] = `
<td
class=""
>
<a
href="javascript:;"
>
<a>
John Brown
</a>
</td>
@ -12141,9 +11953,7 @@ exports[`renders ./components/table/demo/row-selection.md correctly 1`] = `
<td
class=""
>
<a
href="javascript:;"
>
<a>
Jim Green
</a>
</td>
@ -12187,9 +11997,7 @@ exports[`renders ./components/table/demo/row-selection.md correctly 1`] = `
<td
class=""
>
<a
href="javascript:;"
>
<a>
Joe Black
</a>
</td>
@ -12234,9 +12042,7 @@ exports[`renders ./components/table/demo/row-selection.md correctly 1`] = `
<td
class=""
>
<a
href="javascript:;"
>
<a>
Disabled User
</a>
</td>

View File

@ -21,7 +21,7 @@ const columns = [
title: 'Name',
dataIndex: 'name',
key: 'name',
render: text => <a href="javascript:;">{text}</a>,
render: text => <a>{text}</a>,
},
{
title: 'Age',
@ -58,9 +58,9 @@ const columns = [
key: 'action',
render: (text, record) => (
<span>
<a href="javascript:;">Invite {record.name}</a>
<a>Invite {record.name}</a>
<Divider type="vertical" />
<a href="javascript:;">Delete</a>
<a>Delete</a>
</span>
),
},

View File

@ -20,7 +20,7 @@ const columns = [
{
title: 'Name',
dataIndex: 'name',
render: text => <a href="javascript:;">{text}</a>,
render: text => <a>{text}</a>,
},
{
title: 'Cash Assets',

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