Merge branch 'master' into feature-2.11

This commit is contained in:
Benjy Cui 2017-06-06 17:26:06 +08:00
commit 2e313ef8f0
61 changed files with 1052 additions and 140 deletions

View File

@ -17,6 +17,13 @@ If you want to read change logs before `2.0.0`, please visit [GitHub](https://gi
---
## 2.10.4
`2017-06-01`
- Fix `rc-util` dependency. [#6310](https://github.com/ant-design/ant-design/pull/6311) [@bkniffler](https://github.com/bkniffler)
- Fix syntax error in es build. [#6310](https://github.com/ant-design/ant-design/issues/6310#issuecomment-305176273)
## 2.10.3
`2017-05-31`
@ -30,7 +37,7 @@ If you want to read change logs before `2.0.0`, please visit [GitHub](https://gi
- **Table** Fix table filter menu overflow issue. [#6245](https://github.com/ant-design/ant-design/issues/6245)
- **InputNumber** Fix hasFeedback misplaced validated icon. [#6289](https://github.com/ant-design/ant-design/issues/6289)
- **Typescript**
- Upgrade TypeScript to 2.3.x. [#6263](https://github.com/ant-design/ant-design/issues/6263)
- Upgrade TypeScript to 2.3.x. [#6263](https://github.com/ant-design/ant-design/issues/6263)
- Add missing props in Table. [commit/acdc56](https://github.com/ant-design/ant-design/commit/acdc563a547c49960521b2b48cd5c707ac1e4cf2) [pull/6291](https://github.com/ant-design/ant-design/pull/6291) [@jch254](https://github.com/jch254)
- Fix wrong type in Mention and Form. [pull/6268](https://github.com/ant-design/ant-design/pull/6268) [@jch254](https://github.com/jch254)
- Fix wrong type in Badge. [pull/6291](https://github.com/ant-design/ant-design/pull/6291) [@jch254](https://github.com/jch254)

View File

@ -17,11 +17,18 @@ timeline: true
---
## 2.10.4
`2017-06-01`
- 修正 `rc-util` 依赖。[#6310](https://github.com/ant-design/ant-design/pull/6311) [@bkniffler](https://github.com/bkniffler)
- 修正 `es` 版本的语法错误。[#6310](https://github.com/ant-design/ant-design/issues/6310#issuecomment-305176273)
## 2.10.3
`2017-05-31`
- **Calendar**
- **Calendar**
- 修复了样式问题以支持 disabledDate补充了 Type 定义及文档。[#6074](https://github.com/ant-design/ant-design/issues/6074)
- rc-calendar 依赖升级至 8.4.0,支持保加利亚语,支持首先选择结束日期。[commit/a4a6db](https://github.com/ant-design/ant-design/commit/a4a6db76de57ac2559a2be80208121ab5e168fbf)
- **Alert** 去掉了默认的下边距。[commit/5ef482](https://github.com/ant-design/ant-design/commit/5ef48289747409b6d962f75627ddb11e2765f965)
@ -30,7 +37,7 @@ timeline: true
- **Table** 修复了 filter 被 Table 截断的问题。[#6245](https://github.com/ant-design/ant-design/issues/6245)
- **InputNumber** 修复了配置 hasFeedback 时校验结果图标位置有误的问题。[#6289](https://github.com/ant-design/ant-design/issues/6289)
- **Typescript**
- typescript 升级至 2.3.x。[#6263](https://github.com/ant-design/ant-design/issues/6263)
- typescript 升级至 2.3.x。[#6263](https://github.com/ant-design/ant-design/issues/6263)
- 补充了 Table 的 type 定义. [commit/acdc56](https://github.com/ant-design/ant-design/commit/acdc563a547c49960521b2b48cd5c707ac1e4cf2) [pull/6291](https://github.com/ant-design/ant-design/pull/6291) [@jch254](https://github.com/jch254)
- 修复了 Mention、Form 组件中错误的 type 定义. [pull/6268](https://github.com/ant-design/ant-design/pull/6268) [@jch254](https://github.com/jch254)
- 修复了 Badge 组件中错误的 type 定义. [pull/6291](https://github.com/ant-design/ant-design/pull/6291) [@jch254](https://github.com/jch254)

View File

@ -112,7 +112,7 @@ $ npm start
在任何形式的参与前,请先阅读 [贡献者文档](https://github.com/ant-design/ant-design/blob/master/.github/CONTRIBUTING.md)。如果你希望参与贡献,欢迎 [Pull Request](https://github.com/ant-design/ant-design/pulls),或给我们 [报告 Bug](http://new-issue.ant.design/)。
> 强烈推荐阅读 [《提问的智慧》](https://github.com/ryanhanwu/How-To-Ask-Questions-The-Smart-Way)、[《如何向开源社区提问题》](https://github.com/seajs/seajs/issues/545) 和 [《如何有效地报告 Bug》](http://www.chiark.greenend.org.uk/%7Esgtatham/bugs-cn.html),更好的问题更容易获得帮助。
> 强烈推荐阅读 [《提问的智慧》](https://github.com/ryanhanwu/How-To-Ask-Questions-The-Smart-Way)、[《如何向开源社区提问题》](https://github.com/seajs/seajs/issues/545) 和 [《如何有效地报告 Bug》](http://www.chiark.greenend.org.uk/%7Esgtatham/bugs-cn.html)、[《如何向开源项目提交无法解答的问题》](https://zhuanlan.zhihu.com/p/25795393),更好的问题更容易获得帮助。
## 社区互助

View File

@ -1,8 +1,15 @@
import assign from 'object-assign';
export function getComponentLocale(props, context, componentName, getDefaultLocale) {
const locale = context && context.antLocale && context.antLocale[componentName] ?
context.antLocale[componentName] : getDefaultLocale();
let locale: any = {};
if (context && context.antLocale && context.antLocale[componentName]) {
locale = context.antLocale[componentName];
} else {
const defaultLocale = getDefaultLocale();
// TODO: make default lang of antd be English
// https://github.com/ant-design/ant-design/issues/6334
locale = defaultLocale.default || defaultLocale;
}
const result = assign({}, locale, props.locale);
result.lang = assign({}, locale.lang, props.locale.lang);

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -96,6 +96,8 @@
}
.@{checkbox-prefix-cls}-disabled {
cursor: not-allowed;
&.@{checkbox-prefix-cls}-checked {
.@{checkbox-inner-prefix-cls}:after {
animation-name: none;

View File

@ -5,7 +5,7 @@ exports[`renders ./components/date-picker/demo/basic.md correctly 1`] = `
<span
class="ant-calendar-picker"
>
<span>
<div>
<input
class="ant-calendar-picker-input ant-input"
placeholder="请选择日期"
@ -15,13 +15,13 @@ exports[`renders ./components/date-picker/demo/basic.md correctly 1`] = `
<span
class="ant-calendar-picker-icon"
/>
</span>
</div>
</span>
<br />
<span
class="ant-calendar-picker"
>
<span>
<div>
<input
class="ant-calendar-picker-input ant-input"
placeholder="Select month"
@ -31,7 +31,7 @@ exports[`renders ./components/date-picker/demo/basic.md correctly 1`] = `
<span
class="ant-calendar-picker-icon"
/>
</span>
</div>
</span>
<br />
<span
@ -70,7 +70,7 @@ exports[`renders ./components/date-picker/demo/disabled.md correctly 1`] = `
<span
class="ant-calendar-picker"
>
<span>
<div>
<input
class="ant-calendar-picker-input ant-input"
disabled=""
@ -81,13 +81,13 @@ exports[`renders ./components/date-picker/demo/disabled.md correctly 1`] = `
<span
class="ant-calendar-picker-icon"
/>
</span>
</div>
</span>
<br />
<span
class="ant-calendar-picker"
>
<span>
<div>
<input
class="ant-calendar-picker-input ant-input"
disabled=""
@ -98,7 +98,7 @@ exports[`renders ./components/date-picker/demo/disabled.md correctly 1`] = `
<span
class="ant-calendar-picker-icon"
/>
</span>
</div>
</span>
<br />
<span
@ -141,7 +141,7 @@ exports[`renders ./components/date-picker/demo/disabled-date.md correctly 1`] =
class="ant-calendar-picker"
style="width:154px;"
>
<span>
<div>
<input
class="ant-calendar-picker-input ant-input"
placeholder="请选择日期"
@ -151,13 +151,13 @@ exports[`renders ./components/date-picker/demo/disabled-date.md correctly 1`] =
<span
class="ant-calendar-picker-icon"
/>
</span>
</div>
</span>
<br />
<span
class="ant-calendar-picker"
>
<span>
<div>
<input
class="ant-calendar-picker-input ant-input"
placeholder="Select month"
@ -167,7 +167,7 @@ exports[`renders ./components/date-picker/demo/disabled-date.md correctly 1`] =
<span
class="ant-calendar-picker-icon"
/>
</span>
</div>
</span>
<br />
<span
@ -300,7 +300,7 @@ exports[`renders ./components/date-picker/demo/format.md correctly 1`] = `
<span
class="ant-calendar-picker"
>
<span>
<div>
<input
class="ant-calendar-picker-input ant-input"
placeholder="请选择日期"
@ -313,13 +313,13 @@ exports[`renders ./components/date-picker/demo/format.md correctly 1`] = `
<span
class="ant-calendar-picker-icon"
/>
</span>
</div>
</span>
<br />
<span
class="ant-calendar-picker"
>
<span>
<div>
<input
class="ant-calendar-picker-input ant-input"
placeholder="请选择日期"
@ -332,7 +332,7 @@ exports[`renders ./components/date-picker/demo/format.md correctly 1`] = `
<span
class="ant-calendar-picker-icon"
/>
</span>
</div>
</span>
<br />
<span
@ -498,7 +498,7 @@ exports[`renders ./components/date-picker/demo/size.md correctly 1`] = `
<span
class="ant-calendar-picker"
>
<span>
<div>
<input
class="ant-calendar-picker-input ant-input"
placeholder="请选择日期"
@ -508,13 +508,13 @@ exports[`renders ./components/date-picker/demo/size.md correctly 1`] = `
<span
class="ant-calendar-picker-icon"
/>
</span>
</div>
</span>
<br />
<span
class="ant-calendar-picker"
>
<span>
<div>
<input
class="ant-calendar-picker-input ant-input"
placeholder="请选择日期"
@ -524,7 +524,7 @@ exports[`renders ./components/date-picker/demo/size.md correctly 1`] = `
<span
class="ant-calendar-picker-icon"
/>
</span>
</div>
</span>
<br />
<span
@ -564,7 +564,7 @@ exports[`renders ./components/date-picker/demo/start-end.md correctly 1`] = `
class="ant-calendar-picker"
style="width:154px;"
>
<span>
<div>
<input
class="ant-calendar-picker-input ant-input"
placeholder="Start"
@ -574,13 +574,13 @@ exports[`renders ./components/date-picker/demo/start-end.md correctly 1`] = `
<span
class="ant-calendar-picker-icon"
/>
</span>
</div>
</span>
<span
class="ant-calendar-picker"
style="width:154px;"
>
<span>
<div>
<input
class="ant-calendar-picker-input ant-input"
placeholder="End"
@ -590,7 +590,7 @@ exports[`renders ./components/date-picker/demo/start-end.md correctly 1`] = `
<span
class="ant-calendar-picker-icon"
/>
</span>
</div>
</span>
</div>
`;
@ -601,7 +601,7 @@ exports[`renders ./components/date-picker/demo/time.md correctly 1`] = `
class="ant-calendar-picker"
style="width:154px;"
>
<span>
<div>
<input
class="ant-calendar-picker-input ant-input"
placeholder="Select Time"
@ -611,7 +611,7 @@ exports[`renders ./components/date-picker/demo/time.md correctly 1`] = `
<span
class="ant-calendar-picker-icon"
/>
</span>
</div>
</span>
<br />
<span

View File

@ -135,7 +135,7 @@ export default function createPicker(TheCalendar): any {
) : null;
const input = ({ value: inputValue }) => (
<span>
<div>
<input
disabled={props.disabled}
readOnly
@ -145,7 +145,7 @@ export default function createPicker(TheCalendar): any {
/>
{clearIcon}
<span className={`${prefixCls}-picker-icon`} />
</span>
</div>
);
const pickerValue = value;

View File

@ -0,0 +1,17 @@
import CalendarLocale from 'rc-calendar/lib/locale/bg_BG';
import TimePickerLocale from '../../time-picker/locale/bg_BG';
import assign from 'object-assign';
// Merge into a locale object
const locale = {
lang: assign({
placeholder: 'Избор на дата',
rangePlaceholder: ['Начална', 'Крайна'],
}, CalendarLocale),
timePickerLocale: assign({}, TimePickerLocale),
};
// All settings at:
// https://github.com/ant-design/ant-design/blob/master/components/date-picker/locale/example.json
export default locale;

View File

@ -0,0 +1,17 @@
import CalendarLocale from 'rc-calendar/lib/locale/en_GB';
import TimePickerLocale from '../../time-picker/locale/en_GB';
import assign from 'object-assign';
// Merge into a locale object
const locale = {
lang: assign({
placeholder: 'Select date',
rangePlaceholder: ['Start date', 'End date'],
}, CalendarLocale),
timePickerLocale: assign({}, TimePickerLocale),
};
// All settings at:
// https://github.com/ant-design/ant-design/blob/master/components/date-picker/locale/example.json
export default locale;

View File

@ -0,0 +1,17 @@
import CalendarLocale from 'rc-calendar/lib/locale/fr_FR';
import TimePickerLocale from '../../time-picker/locale/fr_FR';
import assign from 'object-assign';
// Merge into a locale object
const locale = {
lang: assign({
placeholder: 'Sélectionner une date',
rangePlaceholder: ['Date de début', 'Date de fin'],
}, CalendarLocale),
timePickerLocale: assign({}, TimePickerLocale),
};
// All settings at:
// https://github.com/ant-design/ant-design/issues/424
export default locale;

View File

@ -0,0 +1,17 @@
import CalendarLocale from 'rc-calendar/lib/locale/it_IT';
import TimePickerLocale from '../../time-picker/locale/it_IT';
import assign from 'object-assign';
// Merge into a locale object
const locale = {
lang: assign({
placeholder: 'Selezionare la data',
rangePlaceholder: ['Data d\'inizio', 'Data di fine'],
}, CalendarLocale),
timePickerLocale: assign({}, TimePickerLocale),
};
// All settings at:
// https://github.com/ant-design/ant-design/issues/424
export default locale;

View File

@ -0,0 +1,17 @@
import CalendarLocale from 'rc-calendar/lib/locale/nl_BE';
import TimePickerLocale from '../../time-picker/locale/nl_BE';
import assign from 'object-assign';
// Merge into a locale object
const locale = {
lang: assign({
placeholder: 'Selecteer datum',
rangePlaceholder: ['Begin datum', 'Eind datum'],
}, CalendarLocale),
timePickerLocale: assign({}, TimePickerLocale),
};
// All settings at:
// https://github.com/ant-design/ant-design/issues/424
export default locale;

View File

@ -111,7 +111,7 @@ export interface FormComponentProps {
// https://github.com/DefinitelyTyped/DefinitelyTyped/issues/9951
export interface ComponentDecorator<TOwnProps> {
(component: React.ComponentClass<FormComponentProps & TOwnProps>): any;
(component: React.ComponentClass<FormComponentProps & TOwnProps>): React.ComponentClass<TOwnProps>;
}
export default class Form extends React.Component<FormProps, any> {

View File

@ -11,7 +11,7 @@ exports[`renders ./components/form/demo/advanced-search.md correctly 1`] = `
>
<div
class="ant-col-8"
style="padding-left:20px;padding-right:20px;"
style="padding-left:20px;padding-right:20px;display:block;"
>
<div
class="ant-row ant-form-item"
@ -47,7 +47,7 @@ exports[`renders ./components/form/demo/advanced-search.md correctly 1`] = `
</div>
<div
class="ant-col-8"
style="padding-left:20px;padding-right:20px;"
style="padding-left:20px;padding-right:20px;display:block;"
>
<div
class="ant-row ant-form-item"
@ -83,7 +83,7 @@ exports[`renders ./components/form/demo/advanced-search.md correctly 1`] = `
</div>
<div
class="ant-col-8"
style="padding-left:20px;padding-right:20px;"
style="padding-left:20px;padding-right:20px;display:block;"
>
<div
class="ant-row ant-form-item"
@ -119,7 +119,7 @@ exports[`renders ./components/form/demo/advanced-search.md correctly 1`] = `
</div>
<div
class="ant-col-8"
style="padding-left:20px;padding-right:20px;"
style="padding-left:20px;padding-right:20px;display:block;"
>
<div
class="ant-row ant-form-item"
@ -155,7 +155,7 @@ exports[`renders ./components/form/demo/advanced-search.md correctly 1`] = `
</div>
<div
class="ant-col-8"
style="padding-left:20px;padding-right:20px;"
style="padding-left:20px;padding-right:20px;display:block;"
>
<div
class="ant-row ant-form-item"
@ -191,7 +191,7 @@ exports[`renders ./components/form/demo/advanced-search.md correctly 1`] = `
</div>
<div
class="ant-col-8"
style="padding-left:20px;padding-right:20px;"
style="padding-left:20px;padding-right:20px;display:block;"
>
<div
class="ant-row ant-form-item"
@ -225,6 +225,150 @@ exports[`renders ./components/form/demo/advanced-search.md correctly 1`] = `
</div>
</div>
</div>
<div
class="ant-col-8"
style="padding-left:20px;padding-right:20px;display:none;"
>
<div
class="ant-row ant-form-item"
>
<div
class="ant-col-5 ant-form-item-label"
>
<label
class=""
for="field-6"
title="Field 6"
>
Field 6
</label>
</div>
<div
class="ant-col-19 ant-form-item-control-wrapper"
>
<div
class="ant-form-item-control "
>
<input
class="ant-input ant-input-lg"
data-__meta="[object Object]"
id="field-6"
placeholder="placeholder"
type="text"
value=""
/>
</div>
</div>
</div>
</div>
<div
class="ant-col-8"
style="padding-left:20px;padding-right:20px;display:none;"
>
<div
class="ant-row ant-form-item"
>
<div
class="ant-col-5 ant-form-item-label"
>
<label
class=""
for="field-7"
title="Field 7"
>
Field 7
</label>
</div>
<div
class="ant-col-19 ant-form-item-control-wrapper"
>
<div
class="ant-form-item-control "
>
<input
class="ant-input ant-input-lg"
data-__meta="[object Object]"
id="field-7"
placeholder="placeholder"
type="text"
value=""
/>
</div>
</div>
</div>
</div>
<div
class="ant-col-8"
style="padding-left:20px;padding-right:20px;display:none;"
>
<div
class="ant-row ant-form-item"
>
<div
class="ant-col-5 ant-form-item-label"
>
<label
class=""
for="field-8"
title="Field 8"
>
Field 8
</label>
</div>
<div
class="ant-col-19 ant-form-item-control-wrapper"
>
<div
class="ant-form-item-control "
>
<input
class="ant-input ant-input-lg"
data-__meta="[object Object]"
id="field-8"
placeholder="placeholder"
type="text"
value=""
/>
</div>
</div>
</div>
</div>
<div
class="ant-col-8"
style="padding-left:20px;padding-right:20px;display:none;"
>
<div
class="ant-row ant-form-item"
>
<div
class="ant-col-5 ant-form-item-label"
>
<label
class=""
for="field-9"
title="Field 9"
>
Field 9
</label>
</div>
<div
class="ant-col-19 ant-form-item-control-wrapper"
>
<div
class="ant-form-item-control "
>
<input
class="ant-input ant-input-lg"
data-__meta="[object Object]"
id="field-9"
placeholder="placeholder"
type="text"
value=""
/>
</div>
</div>
</div>
</div>
</div>
<div
class="ant-row"
@ -1549,7 +1693,7 @@ exports[`renders ./components/form/demo/time-related-controls.md correctly 1`] =
<span
class="ant-calendar-picker"
>
<span>
<div>
<input
class="ant-calendar-picker-input ant-input ant-input-lg"
placeholder="请选择日期"
@ -1559,7 +1703,7 @@ exports[`renders ./components/form/demo/time-related-controls.md correctly 1`] =
<span
class="ant-calendar-picker-icon"
/>
</span>
</div>
</span>
</div>
</div>
@ -1588,7 +1732,7 @@ exports[`renders ./components/form/demo/time-related-controls.md correctly 1`] =
class="ant-calendar-picker"
style="width:154px;"
>
<span>
<div>
<input
class="ant-calendar-picker-input ant-input ant-input-lg"
placeholder="请选择日期"
@ -1598,7 +1742,7 @@ exports[`renders ./components/form/demo/time-related-controls.md correctly 1`] =
<span
class="ant-calendar-picker-icon"
/>
</span>
</div>
</span>
</div>
</div>
@ -1626,7 +1770,7 @@ exports[`renders ./components/form/demo/time-related-controls.md correctly 1`] =
<span
class="ant-calendar-picker"
>
<span>
<div>
<input
class="ant-calendar-picker-input ant-input ant-input-lg"
placeholder="请选择日期"
@ -1636,7 +1780,7 @@ exports[`renders ./components/form/demo/time-related-controls.md correctly 1`] =
<span
class="ant-calendar-picker-icon"
/>
</span>
</div>
</span>
</div>
</div>
@ -2123,7 +2267,12 @@ exports[`renders ./components/form/demo/validate-other.md correctly 1`] = `
/>
</div>
<div
aria-disabled="false"
aria-valuemax="100"
aria-valuemin="0"
aria-valuenow="0"
class="ant-slider-handle"
role="slider"
style="left:0%;"
/>
<div
@ -2652,7 +2801,7 @@ exports[`renders ./components/form/demo/validate-static.md correctly 1`] = `
<span
class="ant-calendar-picker"
>
<span>
<div>
<input
class="ant-calendar-picker-input ant-input ant-input-lg"
placeholder="请选择日期"
@ -2662,7 +2811,7 @@ exports[`renders ./components/form/demo/validate-static.md correctly 1`] = `
<span
class="ant-calendar-picker-icon"
/>
</span>
</div>
</span>
<div
class="ant-form-explain"
@ -2697,7 +2846,7 @@ exports[`renders ./components/form/demo/validate-static.md correctly 1`] = `
<span
class="ant-calendar-picker"
>
<span>
<div>
<input
class="ant-calendar-picker-input ant-input ant-input-lg"
placeholder="请选择日期"
@ -2707,7 +2856,7 @@ exports[`renders ./components/form/demo/validate-static.md correctly 1`] = `
<span
class="ant-calendar-picker-icon"
/>
</span>
</div>
</span>
</div>
</div>

View File

@ -43,18 +43,18 @@ class AdvancedSearchForm extends React.Component {
this.setState({ expand: !expand });
}
render() {
// To generate mock Form.Item
getFields() {
const count = this.state.expand ? 10 : 6;
const { getFieldDecorator } = this.props.form;
const formItemLayout = {
labelCol: { span: 5 },
wrapperCol: { span: 19 },
};
// To generate mock Form.Item
const children = [];
for (let i = 0; i < 10; i++) {
children.push(
<Col span={8} key={i}>
<Col span={8} key={i} style={{ display: i < count ? 'block' : 'none' }}>
<FormItem {...formItemLayout} label={`Field ${i}`}>
{getFieldDecorator(`field-${i}`)(
<Input placeholder="placeholder" />
@ -63,17 +63,16 @@ class AdvancedSearchForm extends React.Component {
</Col>
);
}
return children;
}
const expand = this.state.expand;
const shownCount = expand ? children.length : 6;
render() {
return (
<Form
className="ant-advanced-search-form"
onSubmit={this.handleSearch}
>
<Row gutter={40}>
{children.slice(0, shownCount)}
</Row>
<Row gutter={40}>{this.getFields()}</Row>
<Row>
<Col span={24} style={{ textAlign: 'right' }}>
<Button type="primary" htmlType="submit">Search</Button>
@ -81,7 +80,7 @@ class AdvancedSearchForm extends React.Component {
Clear
</Button>
<a style={{ marginLeft: 8, fontSize: 12 }} onClick={this.toggle}>
Collapse <Icon type={expand ? 'up' : 'down'} />
Collapse <Icon type={this.state.expand ? 'up' : 'down'} />
</a>
</Col>
</Row>

View File

@ -511,7 +511,12 @@ exports[`renders ./components/grid/demo/playground.md correctly 1`] = `
/>
</div>
<div
aria-disabled="false"
aria-valuemax="5"
aria-valuemin="0"
aria-valuenow="1"
class="ant-slider-handle"
role="slider"
style="left:20%;"
/>
<div
@ -603,7 +608,12 @@ exports[`renders ./components/grid/demo/playground.md correctly 1`] = `
/>
</div>
<div
aria-disabled="false"
aria-valuemax="5"
aria-valuemin="0"
aria-valuenow="2"
class="ant-slider-handle"
role="slider"
style="left:40%;"
/>
<div

View File

@ -180,19 +180,29 @@ export default class Input extends Component<InputProps, any> {
[wrapperClassName]: (addonBefore || addonAfter),
});
const node = (
// Need another wrapper for changing display:table to display:inline-block
// and put style prop in wrapper
if (addonBefore || addonAfter) {
return (
<span
className={`${props.prefixCls}-group-wrapper`}
style={props.style}
>
<span className={className}>
{addonBefore}
{cloneElement(children, { style: null })}
{addonAfter}
</span>
</span>
);
}
return (
<span className={className}>
{addonBefore}
{children}
{addonAfter}
</span>
);
// Need another wrapper for changing display:table to display:inline-block
if (addonBefore || addonAfter) {
return <span className={`${props.prefixCls}-group-wrapper`}>{node}</span>;
}
return node;
}
renderLabeledIcon(children) {

View File

@ -359,7 +359,7 @@ exports[`renders ./components/input/demo/group.md correctly 1`] = `
<span
class="ant-calendar-picker"
>
<span>
<div>
<input
class="ant-calendar-picker-input ant-input"
placeholder="请选择日期"
@ -369,7 +369,7 @@ exports[`renders ./components/input/demo/group.md correctly 1`] = `
<span
class="ant-calendar-picker-icon"
/>
</span>
</div>
</span>
</span>
<br />

View File

@ -65,12 +65,14 @@ exports[`renders ./components/locale-provider/demo/all.md correctly 1`] = `
<li
aria-disabled="true"
class="ant-pagination-disabled ant-pagination-prev"
tabindex="0"
title="Previous Page"
>
<a />
</li>
<li
class="ant-pagination-item ant-pagination-item-1 ant-pagination-item-active"
tabindex="0"
title="1"
>
<a>
@ -79,6 +81,7 @@ exports[`renders ./components/locale-provider/demo/all.md correctly 1`] = `
</li>
<li
class="ant-pagination-item ant-pagination-item-2"
tabindex="0"
title="2"
>
<a>
@ -87,6 +90,7 @@ exports[`renders ./components/locale-provider/demo/all.md correctly 1`] = `
</li>
<li
class="ant-pagination-item ant-pagination-item-3"
tabindex="0"
title="3"
>
<a>
@ -95,6 +99,7 @@ exports[`renders ./components/locale-provider/demo/all.md correctly 1`] = `
</li>
<li
class="ant-pagination-item ant-pagination-item-4"
tabindex="0"
title="4"
>
<a>
@ -103,6 +108,7 @@ exports[`renders ./components/locale-provider/demo/all.md correctly 1`] = `
</li>
<li
class="ant-pagination-item ant-pagination-item-5"
tabindex="0"
title="5"
>
<a>
@ -112,6 +118,7 @@ exports[`renders ./components/locale-provider/demo/all.md correctly 1`] = `
<li
aria-disabled="false"
class=" ant-pagination-next"
tabindex="0"
title="Next Page"
>
<a />
@ -204,7 +211,7 @@ exports[`renders ./components/locale-provider/demo/all.md correctly 1`] = `
<span
class="ant-calendar-picker"
>
<span>
<div>
<input
class="ant-calendar-picker-input ant-input"
placeholder="Select date"
@ -214,7 +221,7 @@ exports[`renders ./components/locale-provider/demo/all.md correctly 1`] = `
<span
class="ant-calendar-picker-icon"
/>
</span>
</div>
</span>
<span
class="ant-time-picker "
@ -1541,12 +1548,14 @@ exports[`renders ./components/locale-provider/demo/basic.md correctly 1`] = `
<li
aria-disabled="true"
class="ant-pagination-disabled ant-pagination-prev"
tabindex="0"
title="Previous Page"
>
<a />
</li>
<li
class="ant-pagination-item ant-pagination-item-1 ant-pagination-item-active"
tabindex="0"
title="1"
>
<a>
@ -1555,6 +1564,7 @@ exports[`renders ./components/locale-provider/demo/basic.md correctly 1`] = `
</li>
<li
class="ant-pagination-item ant-pagination-item-2"
tabindex="0"
title="2"
>
<a>
@ -1563,6 +1573,7 @@ exports[`renders ./components/locale-provider/demo/basic.md correctly 1`] = `
</li>
<li
class="ant-pagination-item ant-pagination-item-3"
tabindex="0"
title="3"
>
<a>
@ -1571,6 +1582,7 @@ exports[`renders ./components/locale-provider/demo/basic.md correctly 1`] = `
</li>
<li
class="ant-pagination-item ant-pagination-item-4"
tabindex="0"
title="4"
>
<a>
@ -1579,6 +1591,7 @@ exports[`renders ./components/locale-provider/demo/basic.md correctly 1`] = `
</li>
<li
class="ant-pagination-item ant-pagination-item-5"
tabindex="0"
title="5"
>
<a>
@ -1588,6 +1601,7 @@ exports[`renders ./components/locale-provider/demo/basic.md correctly 1`] = `
<li
aria-disabled="false"
class=" ant-pagination-next"
tabindex="0"
title="Next Page"
>
<a />

View File

@ -3,6 +3,10 @@ import { mount } from 'enzyme';
import moment from 'moment';
import { LocaleProvider, Pagination, DatePicker, TimePicker, Calendar,
Popconfirm, Table, Modal, Select, Transfer } from '../../';
import enGB from '../en_GB';
import frFR from '../fr_FR';
import nlBE from '../nl_BE';
import itIT from '../it_IT';
import enUS from '../en_US';
import ptBR from '../pt_BR';
import ruRU from '../ru_RU';
@ -21,8 +25,9 @@ import trTR from '../tr_TR';
import zhTW from '../zh_TW';
import fiFI from '../fi_FI';
import plPL from '../pl_PL';
import bgBG from '../bg_BG';
const locales = [enUS, ptBR, ruRU, esES, svSE, frBE, deDE, nlNL, caES, csCZ, koKR, etEE, skSK, jaJP, trTR, zhTW, fiFI, plPL];
const locales = [enUS, ptBR, ruRU, esES, svSE, frBE, deDE, nlNL, caES, csCZ, koKR, etEE, skSK, jaJP, trTR, zhTW, fiFI, plPL, bgBG, enGB, frFR, nlBE, itIT];
const Option = Select.Option;
const RangePicker = DatePicker.RangePicker;

View File

@ -0,0 +1,47 @@
import moment from 'moment';
moment.locale('bg');
import Pagination from 'rc-pagination/lib/locale/bg_BG';
import DatePicker from '../date-picker/locale/bg_BG';
import TimePicker from '../time-picker/locale/bg_BG';
import Calendar from '../calendar/locale/bg_BG';
export default {
locale: 'bg',
Pagination,
DatePicker,
TimePicker,
Calendar,
Table: {
filterTitle: 'Филтриране',
filterConfirm: 'Добре',
filterReset: 'Нулриане',
emptyText: 'Няма данни',
selectAll: 'Избор на текуща страница',
selectInvert: 'Обръщане',
},
Modal: {
okText: 'Дибре',
cancelText: 'Отказ',
justOkText: 'Дибре',
},
Popconfirm: {
okText: 'Дибре',
cancelText: 'Отказ',
},
Transfer: {
notFoundContent: 'Няма намерени',
searchPlaceholder: 'Търсене',
itemUnit: 'избор',
itemsUnit: 'избори',
},
Select: {
notFoundContent: 'Няма намерени',
},
Upload: {
uploading: 'Качване...',
removeFile: 'Премахване',
uploadError: 'Грешка при качването',
previewFile: 'Преглед',
},
};

View File

@ -0,0 +1,47 @@
import moment from 'moment';
moment.locale('en-gb');
import Pagination from 'rc-pagination/lib/locale/en_GB';
import DatePicker from '../date-picker/locale/en_GB';
import TimePicker from '../time-picker/locale/en_GB';
import Calendar from '../calendar/locale/en_GB';
export default {
locale: 'en-gb',
Pagination,
DatePicker,
TimePicker,
Calendar,
Table: {
filterTitle: 'Filter Menu',
filterConfirm: 'OK',
filterReset: 'Reset',
emptyText: 'No Data',
selectAll: 'Select Current Page',
selectInvert: 'Select Invert',
},
Modal: {
okText: 'OK',
cancelText: 'Cancel',
justOkText: 'OK',
},
Popconfirm: {
okText: 'OK',
cancelText: 'Cancel',
},
Transfer: {
notFoundContent: 'Not Found',
searchPlaceholder: 'Search here',
itemUnit: 'item',
itemsUnit: 'items',
},
Select: {
notFoundContent: 'Not Found',
},
Upload: {
uploading: 'Uploading...',
removeFile: 'Remove file',
uploadError: 'Upload error',
previewFile: 'Preview file',
},
};

View File

@ -0,0 +1,39 @@
import moment from 'moment';
moment.locale('fr');
import Pagination from 'rc-pagination/lib/locale/fr_FR';
import DatePicker from '../date-picker/locale/fr_FR';
import TimePicker from '../time-picker/locale/fr_FR';
import Calendar from '../calendar/locale/fr_FR';
export default {
locale: 'fr',
Pagination,
DatePicker,
TimePicker,
Calendar,
Table: {
filterTitle: 'Filtrer',
filterConfirm: 'OK',
filterReset: 'Réinitialiser',
emptyText: 'Aucune donnée',
},
Modal: {
okText: 'OK',
cancelText: 'Annuler',
justOkText: 'OK',
},
Popconfirm: {
okText: 'OK',
cancelText: 'Annuler',
},
Transfer: {
notFoundContent: 'Pas de résultat',
searchPlaceholder: 'Recherche',
itemUnit: 'élément',
itemsUnit: 'éléments',
},
Select: {
notFoundContent: 'Pas de résultat',
},
};

View File

@ -0,0 +1,47 @@
import moment from 'moment';
moment.locale('it');
import Pagination from 'rc-pagination/lib/locale/it_IT';
import DatePicker from '../date-picker/locale/it_IT';
import TimePicker from '../time-picker/locale/it_IT';
import Calendar from '../calendar/locale/it_IT';
export default {
locale: 'it',
Pagination,
DatePicker,
TimePicker,
Calendar,
Table: {
filterTitle: 'Menu Filtro',
filterConfirm: 'OK',
filterReset: 'Reset',
emptyText: 'Nessun dato',
selectAll: 'Seleziona pagina corrente',
selectInvert: 'Selezionare Inverti',
},
Modal: {
okText: 'OK',
cancelText: 'Annulla',
justOkText: 'OK',
},
Popconfirm: {
okText: 'OK',
cancelText: 'Annulla',
},
Transfer: {
notFoundContent: 'Non trovato',
searchPlaceholder: 'Cerca qui',
itemUnit: 'articolo',
itemsUnit: 'elementi',
},
Select: {
notFoundContent: 'Non trovato',
},
Upload: {
uploading: 'Caricamento...',
removeFile: 'Rimuovi il file',
uploadError: 'Errore di caricamento',
previewFile: 'Anteprima file',
},
};

View File

@ -0,0 +1,47 @@
import moment from 'moment';
moment.locale('nl-be');
import Pagination from 'rc-pagination/lib/locale/nl_BE';
import DatePicker from '../date-picker/locale/nl_BE';
import TimePicker from '../time-picker/locale/nl_BE';
import Calendar from '../calendar/locale/nl_BE';
export default {
locale: 'nl-be',
Pagination,
DatePicker,
TimePicker,
Calendar,
Table: {
filterTitle: 'FilterMenu',
filterConfirm: 'OK',
filterReset: 'Reset',
emptyText: 'Geen gegevens',
selectAll: 'Selecteer huidige pagina',
selectInvert: 'Selecteer huidige pagina',
},
Modal: {
okText: 'OK',
cancelText: 'Annuleer',
justOkText: 'OK',
},
Popconfirm: {
okText: 'OK',
cancelText: 'Annuleer',
},
Transfer: {
notFoundContent: 'Niet gevonden',
searchPlaceholder: 'Zoek hier',
itemUnit: 'item',
itemsUnit: 'items',
},
Select: {
notFoundContent: 'Niet gevonden',
},
Upload: {
uploading: 'Uploaden...',
removeFile: 'Bestand verwijderen',
uploadError: 'Upload fout',
previewFile: 'Preview bestand',
},
};

View File

@ -43,6 +43,9 @@ export default class ActionButton extends React.Component<ActionButtonProps, any
// It's unnecessary to set loading=false, for the Modal will be unmounted after close.
// this.setState({ loading: false });
closeModal(...args);
}, () => {
// See: https://github.com/ant-design/ant-design/issues/6183
this.setState({ loading: false });
});
}
} else {

View File

@ -8,12 +8,14 @@ exports[`renders ./components/pagination/demo/basic.md correctly 1`] = `
<li
aria-disabled="true"
class="ant-pagination-disabled ant-pagination-prev"
tabindex="0"
title="上一页"
>
<a />
</li>
<li
class="ant-pagination-item ant-pagination-item-1 ant-pagination-item-active"
tabindex="0"
title="1"
>
<a>
@ -22,6 +24,7 @@ exports[`renders ./components/pagination/demo/basic.md correctly 1`] = `
</li>
<li
class="ant-pagination-item ant-pagination-item-2"
tabindex="0"
title="2"
>
<a>
@ -30,6 +33,7 @@ exports[`renders ./components/pagination/demo/basic.md correctly 1`] = `
</li>
<li
class="ant-pagination-item ant-pagination-item-3"
tabindex="0"
title="3"
>
<a>
@ -38,6 +42,7 @@ exports[`renders ./components/pagination/demo/basic.md correctly 1`] = `
</li>
<li
class="ant-pagination-item ant-pagination-item-4"
tabindex="0"
title="4"
>
<a>
@ -46,6 +51,7 @@ exports[`renders ./components/pagination/demo/basic.md correctly 1`] = `
</li>
<li
class="ant-pagination-item ant-pagination-item-5"
tabindex="0"
title="5"
>
<a>
@ -55,6 +61,7 @@ exports[`renders ./components/pagination/demo/basic.md correctly 1`] = `
<li
aria-disabled="false"
class=" ant-pagination-next"
tabindex="0"
title="下一页"
>
<a />
@ -70,12 +77,14 @@ exports[`renders ./components/pagination/demo/changer.md correctly 1`] = `
<li
aria-disabled="false"
class=" ant-pagination-prev"
tabindex="0"
title="上一页"
>
<a />
</li>
<li
class="ant-pagination-item ant-pagination-item-1"
tabindex="0"
title="1"
>
<a>
@ -84,6 +93,7 @@ exports[`renders ./components/pagination/demo/changer.md correctly 1`] = `
</li>
<li
class="ant-pagination-item ant-pagination-item-2"
tabindex="0"
title="2"
>
<a>
@ -92,6 +102,7 @@ exports[`renders ./components/pagination/demo/changer.md correctly 1`] = `
</li>
<li
class="ant-pagination-item ant-pagination-item-3 ant-pagination-item-active"
tabindex="0"
title="3"
>
<a>
@ -100,6 +111,7 @@ exports[`renders ./components/pagination/demo/changer.md correctly 1`] = `
</li>
<li
class="ant-pagination-item ant-pagination-item-4"
tabindex="0"
title="4"
>
<a>
@ -108,6 +120,7 @@ exports[`renders ./components/pagination/demo/changer.md correctly 1`] = `
</li>
<li
class="ant-pagination-item ant-pagination-item-5 ant-pagination-item-before-jump-next"
tabindex="0"
title="5"
>
<a>
@ -116,12 +129,14 @@ exports[`renders ./components/pagination/demo/changer.md correctly 1`] = `
</li>
<li
class="ant-pagination-jump-next"
tabindex="0"
title="向后 5 页"
>
<a />
</li>
<li
class="ant-pagination-item ant-pagination-item-50"
tabindex="0"
title="50"
>
<a>
@ -131,6 +146,7 @@ exports[`renders ./components/pagination/demo/changer.md correctly 1`] = `
<li
aria-disabled="false"
class=" ant-pagination-next"
tabindex="0"
title="下一页"
>
<a />
@ -182,12 +198,14 @@ exports[`renders ./components/pagination/demo/controlled.md correctly 1`] = `
<li
aria-disabled="false"
class=" ant-pagination-prev"
tabindex="0"
title="上一页"
>
<a />
</li>
<li
class="ant-pagination-item ant-pagination-item-1"
tabindex="0"
title="1"
>
<a>
@ -196,6 +214,7 @@ exports[`renders ./components/pagination/demo/controlled.md correctly 1`] = `
</li>
<li
class="ant-pagination-item ant-pagination-item-2"
tabindex="0"
title="2"
>
<a>
@ -204,6 +223,7 @@ exports[`renders ./components/pagination/demo/controlled.md correctly 1`] = `
</li>
<li
class="ant-pagination-item ant-pagination-item-3 ant-pagination-item-active"
tabindex="0"
title="3"
>
<a>
@ -212,6 +232,7 @@ exports[`renders ./components/pagination/demo/controlled.md correctly 1`] = `
</li>
<li
class="ant-pagination-item ant-pagination-item-4"
tabindex="0"
title="4"
>
<a>
@ -220,6 +241,7 @@ exports[`renders ./components/pagination/demo/controlled.md correctly 1`] = `
</li>
<li
class="ant-pagination-item ant-pagination-item-5"
tabindex="0"
title="5"
>
<a>
@ -229,6 +251,7 @@ exports[`renders ./components/pagination/demo/controlled.md correctly 1`] = `
<li
aria-disabled="false"
class=" ant-pagination-next"
tabindex="0"
title="下一页"
>
<a />
@ -244,12 +267,14 @@ exports[`renders ./components/pagination/demo/jump.md correctly 1`] = `
<li
aria-disabled="false"
class=" ant-pagination-prev"
tabindex="0"
title="上一页"
>
<a />
</li>
<li
class="ant-pagination-item ant-pagination-item-1"
tabindex="0"
title="1"
>
<a>
@ -258,6 +283,7 @@ exports[`renders ./components/pagination/demo/jump.md correctly 1`] = `
</li>
<li
class="ant-pagination-item ant-pagination-item-2 ant-pagination-item-active"
tabindex="0"
title="2"
>
<a>
@ -266,6 +292,7 @@ exports[`renders ./components/pagination/demo/jump.md correctly 1`] = `
</li>
<li
class="ant-pagination-item ant-pagination-item-3"
tabindex="0"
title="3"
>
<a>
@ -274,6 +301,7 @@ exports[`renders ./components/pagination/demo/jump.md correctly 1`] = `
</li>
<li
class="ant-pagination-item ant-pagination-item-4"
tabindex="0"
title="4"
>
<a>
@ -282,6 +310,7 @@ exports[`renders ./components/pagination/demo/jump.md correctly 1`] = `
</li>
<li
class="ant-pagination-item ant-pagination-item-5 ant-pagination-item-before-jump-next"
tabindex="0"
title="5"
>
<a>
@ -290,12 +319,14 @@ exports[`renders ./components/pagination/demo/jump.md correctly 1`] = `
</li>
<li
class="ant-pagination-jump-next"
tabindex="0"
title="向后 5 页"
>
<a />
</li>
<li
class="ant-pagination-item ant-pagination-item-50"
tabindex="0"
title="50"
>
<a>
@ -305,6 +336,7 @@ exports[`renders ./components/pagination/demo/jump.md correctly 1`] = `
<li
aria-disabled="false"
class=" ant-pagination-next"
tabindex="0"
title="下一页"
>
<a />
@ -335,12 +367,14 @@ exports[`renders ./components/pagination/demo/mini.md correctly 1`] = `
<li
aria-disabled="true"
class="ant-pagination-disabled ant-pagination-prev"
tabindex="0"
title="上一页"
>
<a />
</li>
<li
class="ant-pagination-item ant-pagination-item-1 ant-pagination-item-active"
tabindex="0"
title="1"
>
<a>
@ -349,6 +383,7 @@ exports[`renders ./components/pagination/demo/mini.md correctly 1`] = `
</li>
<li
class="ant-pagination-item ant-pagination-item-2"
tabindex="0"
title="2"
>
<a>
@ -357,6 +392,7 @@ exports[`renders ./components/pagination/demo/mini.md correctly 1`] = `
</li>
<li
class="ant-pagination-item ant-pagination-item-3"
tabindex="0"
title="3"
>
<a>
@ -365,6 +401,7 @@ exports[`renders ./components/pagination/demo/mini.md correctly 1`] = `
</li>
<li
class="ant-pagination-item ant-pagination-item-4"
tabindex="0"
title="4"
>
<a>
@ -373,6 +410,7 @@ exports[`renders ./components/pagination/demo/mini.md correctly 1`] = `
</li>
<li
class="ant-pagination-item ant-pagination-item-5"
tabindex="0"
title="5"
>
<a>
@ -382,6 +420,7 @@ exports[`renders ./components/pagination/demo/mini.md correctly 1`] = `
<li
aria-disabled="false"
class=" ant-pagination-next"
tabindex="0"
title="下一页"
>
<a />
@ -394,12 +433,14 @@ exports[`renders ./components/pagination/demo/mini.md correctly 1`] = `
<li
aria-disabled="true"
class="ant-pagination-disabled ant-pagination-prev"
tabindex="0"
title="上一页"
>
<a />
</li>
<li
class="ant-pagination-item ant-pagination-item-1 ant-pagination-item-active"
tabindex="0"
title="1"
>
<a>
@ -408,6 +449,7 @@ exports[`renders ./components/pagination/demo/mini.md correctly 1`] = `
</li>
<li
class="ant-pagination-item ant-pagination-item-2"
tabindex="0"
title="2"
>
<a>
@ -416,6 +458,7 @@ exports[`renders ./components/pagination/demo/mini.md correctly 1`] = `
</li>
<li
class="ant-pagination-item ant-pagination-item-3"
tabindex="0"
title="3"
>
<a>
@ -424,6 +467,7 @@ exports[`renders ./components/pagination/demo/mini.md correctly 1`] = `
</li>
<li
class="ant-pagination-item ant-pagination-item-4"
tabindex="0"
title="4"
>
<a>
@ -432,6 +476,7 @@ exports[`renders ./components/pagination/demo/mini.md correctly 1`] = `
</li>
<li
class="ant-pagination-item ant-pagination-item-5"
tabindex="0"
title="5"
>
<a>
@ -441,6 +486,7 @@ exports[`renders ./components/pagination/demo/mini.md correctly 1`] = `
<li
aria-disabled="false"
class=" ant-pagination-next"
tabindex="0"
title="下一页"
>
<a />
@ -504,12 +550,14 @@ exports[`renders ./components/pagination/demo/mini.md correctly 1`] = `
<li
aria-disabled="true"
class="ant-pagination-disabled ant-pagination-prev"
tabindex="0"
title="上一页"
>
<a />
</li>
<li
class="ant-pagination-item ant-pagination-item-1 ant-pagination-item-active"
tabindex="0"
title="1"
>
<a>
@ -518,6 +566,7 @@ exports[`renders ./components/pagination/demo/mini.md correctly 1`] = `
</li>
<li
class="ant-pagination-item ant-pagination-item-2"
tabindex="0"
title="2"
>
<a>
@ -526,6 +575,7 @@ exports[`renders ./components/pagination/demo/mini.md correctly 1`] = `
</li>
<li
class="ant-pagination-item ant-pagination-item-3"
tabindex="0"
title="3"
>
<a>
@ -534,6 +584,7 @@ exports[`renders ./components/pagination/demo/mini.md correctly 1`] = `
</li>
<li
class="ant-pagination-item ant-pagination-item-4"
tabindex="0"
title="4"
>
<a>
@ -542,6 +593,7 @@ exports[`renders ./components/pagination/demo/mini.md correctly 1`] = `
</li>
<li
class="ant-pagination-item ant-pagination-item-5"
tabindex="0"
title="5"
>
<a>
@ -551,6 +603,7 @@ exports[`renders ./components/pagination/demo/mini.md correctly 1`] = `
<li
aria-disabled="false"
class=" ant-pagination-next"
tabindex="0"
title="下一页"
>
<a />
@ -567,12 +620,14 @@ exports[`renders ./components/pagination/demo/more.md correctly 1`] = `
<li
aria-disabled="false"
class=" ant-pagination-prev"
tabindex="0"
title="上一页"
>
<a />
</li>
<li
class="ant-pagination-item ant-pagination-item-1"
tabindex="0"
title="1"
>
<a>
@ -581,12 +636,14 @@ exports[`renders ./components/pagination/demo/more.md correctly 1`] = `
</li>
<li
class="ant-pagination-jump-prev"
tabindex="0"
title="向前 5 页"
>
<a />
</li>
<li
class="ant-pagination-item ant-pagination-item-4 ant-pagination-item-after-jump-prev"
tabindex="0"
title="4"
>
<a>
@ -595,6 +652,7 @@ exports[`renders ./components/pagination/demo/more.md correctly 1`] = `
</li>
<li
class="ant-pagination-item ant-pagination-item-5"
tabindex="0"
title="5"
>
<a>
@ -603,6 +661,7 @@ exports[`renders ./components/pagination/demo/more.md correctly 1`] = `
</li>
<li
class="ant-pagination-item ant-pagination-item-6 ant-pagination-item-active"
tabindex="0"
title="6"
>
<a>
@ -611,6 +670,7 @@ exports[`renders ./components/pagination/demo/more.md correctly 1`] = `
</li>
<li
class="ant-pagination-item ant-pagination-item-7"
tabindex="0"
title="7"
>
<a>
@ -619,6 +679,7 @@ exports[`renders ./components/pagination/demo/more.md correctly 1`] = `
</li>
<li
class="ant-pagination-item ant-pagination-item-8 ant-pagination-item-before-jump-next"
tabindex="0"
title="8"
>
<a>
@ -627,12 +688,14 @@ exports[`renders ./components/pagination/demo/more.md correctly 1`] = `
</li>
<li
class="ant-pagination-jump-next"
tabindex="0"
title="向后 5 页"
>
<a />
</li>
<li
class="ant-pagination-item ant-pagination-item-50"
tabindex="0"
title="50"
>
<a>
@ -642,6 +705,7 @@ exports[`renders ./components/pagination/demo/more.md correctly 1`] = `
<li
aria-disabled="false"
class=" ant-pagination-next"
tabindex="0"
title="下一页"
>
<a />
@ -656,6 +720,7 @@ exports[`renders ./components/pagination/demo/simple.md correctly 1`] = `
<li
aria-disabled="false"
class=" ant-pagination-prev"
tabindex="0"
title="上一页"
>
<a />
@ -665,6 +730,7 @@ exports[`renders ./components/pagination/demo/simple.md correctly 1`] = `
title="2/5"
>
<input
size="3"
type="text"
value="2"
/>
@ -678,6 +744,7 @@ exports[`renders ./components/pagination/demo/simple.md correctly 1`] = `
<li
aria-disabled="false"
class=" ant-pagination-next"
tabindex="0"
title="下一页"
>
<a />
@ -699,12 +766,14 @@ exports[`renders ./components/pagination/demo/total.md correctly 1`] = `
<li
aria-disabled="true"
class="ant-pagination-disabled ant-pagination-prev"
tabindex="0"
title="上一页"
>
<a />
</li>
<li
class="ant-pagination-item ant-pagination-item-1 ant-pagination-item-active"
tabindex="0"
title="1"
>
<a>
@ -713,6 +782,7 @@ exports[`renders ./components/pagination/demo/total.md correctly 1`] = `
</li>
<li
class="ant-pagination-item ant-pagination-item-2"
tabindex="0"
title="2"
>
<a>
@ -721,6 +791,7 @@ exports[`renders ./components/pagination/demo/total.md correctly 1`] = `
</li>
<li
class="ant-pagination-item ant-pagination-item-3"
tabindex="0"
title="3"
>
<a>
@ -729,6 +800,7 @@ exports[`renders ./components/pagination/demo/total.md correctly 1`] = `
</li>
<li
class="ant-pagination-item ant-pagination-item-4"
tabindex="0"
title="4"
>
<a>
@ -737,6 +809,7 @@ exports[`renders ./components/pagination/demo/total.md correctly 1`] = `
</li>
<li
class="ant-pagination-item ant-pagination-item-5"
tabindex="0"
title="5"
>
<a>
@ -746,6 +819,7 @@ exports[`renders ./components/pagination/demo/total.md correctly 1`] = `
<li
aria-disabled="false"
class=" ant-pagination-next"
tabindex="0"
title="下一页"
>
<a />
@ -764,12 +838,14 @@ exports[`renders ./components/pagination/demo/total.md correctly 1`] = `
<li
aria-disabled="true"
class="ant-pagination-disabled ant-pagination-prev"
tabindex="0"
title="上一页"
>
<a />
</li>
<li
class="ant-pagination-item ant-pagination-item-1 ant-pagination-item-active"
tabindex="0"
title="1"
>
<a>
@ -778,6 +854,7 @@ exports[`renders ./components/pagination/demo/total.md correctly 1`] = `
</li>
<li
class="ant-pagination-item ant-pagination-item-2"
tabindex="0"
title="2"
>
<a>
@ -786,6 +863,7 @@ exports[`renders ./components/pagination/demo/total.md correctly 1`] = `
</li>
<li
class="ant-pagination-item ant-pagination-item-3"
tabindex="0"
title="3"
>
<a>
@ -794,6 +872,7 @@ exports[`renders ./components/pagination/demo/total.md correctly 1`] = `
</li>
<li
class="ant-pagination-item ant-pagination-item-4"
tabindex="0"
title="4"
>
<a>
@ -802,6 +881,7 @@ exports[`renders ./components/pagination/demo/total.md correctly 1`] = `
</li>
<li
class="ant-pagination-item ant-pagination-item-5"
tabindex="0"
title="5"
>
<a>
@ -811,6 +891,7 @@ exports[`renders ./components/pagination/demo/total.md correctly 1`] = `
<li
aria-disabled="false"
class=" ant-pagination-next"
tabindex="0"
title="下一页"
>
<a />

View File

@ -18,9 +18,10 @@
&-total-text {
display: inline-block;
height: 30px;
line-height: 30px;
margin-right: 10px;
vertical-align: middle;
height: 28px;
line-height: 28px;
margin-right: 8px;
}
&-item {
@ -33,10 +34,12 @@
text-align: center;
list-style: none;
display: inline-block;
vertical-align: middle;
border: @border-width-base @border-style-base @border-color-base;
background-color: @component-background;
margin-right: 8px;
font-family: Arial;
outline: 0;
a {
text-decoration: none;
@ -45,8 +48,9 @@
margin: 0 6px;
}
&:focus,
&:hover {
transition: all 0.3s ease;
transition: all .3s;
border-color: @primary-color;
a {
color: @primary-color;
@ -57,7 +61,14 @@
background-color: @primary-color;
border-color: @primary-color;
&:focus,
&:hover {
background-color: @primary-5;
border-color: @primary-5;
}
a,
&:focus a,
&:hover a {
color: #fff;
}
@ -66,6 +77,8 @@
&-jump-prev,
&-jump-next {
outline: 0;
&:after {
content: "•••";
display: block;
@ -74,6 +87,7 @@
text-align: center;
}
&:focus,
&:hover {
&:after {
color: @primary-color;
@ -85,6 +99,7 @@
}
&-jump-prev {
&:focus,
&:hover {
&:after {
content: "\e620\e620";
@ -93,6 +108,7 @@
}
&-jump-next {
&:focus,
&:hover {
&:after {
content: "\e61f\e61f";
@ -118,31 +134,34 @@
height: 28px;
line-height: 28px;
text-align: center;
transition: all 0.3s ease;
transition: all .3s;
display: inline-block;
vertical-align: middle;
}
&-prev,
&-next {
border: @border-width-base @border-style-base @border-color-base;
background-color: @component-background;
outline: 0;
a {
color: @text-color;
outline: none;
&:after {
.iconfont-size-under-12px(8px);
display: block;
height: 26px;
line-height: 27px;
line-height: 26px;
font-family: "anticon";
text-align: center;
}
}
&:focus,
&:hover {
border-color: @primary-color;
a {
color: @primary-color;
}
@ -187,10 +206,12 @@
&-options {
display: inline-block;
margin-left: 15px;
vertical-align: middle;
margin-left: 16px;
&-size-changer {
display: inline-block;
margin-right: 10px;
margin-right: 8px;
}
&-quick-jumper {
@ -217,6 +238,7 @@
&-simple &-simple-pager {
display: inline-block;
vertical-align: middle;
margin-right: 8px;
input {
@ -227,10 +249,9 @@
border: @border-width-base @border-style-base @border-color-base;
outline: none;
padding: 5px 8px;
width: 30px;
height: 24px;
text-align: center;
transition: border-color 0.3s ease;
transition: border-color .3s;
&:hover {
border-color: @primary-color;

View File

@ -18,8 +18,8 @@
margin-right: 0;
padding-right: 0;
.@{progress-prefix-cls}-show-info & {
padding-right: 45px;
margin-right: -45px;
padding-right: 2.75em;
margin-right: -2.75em;
}
}
@ -47,14 +47,12 @@
}
&-text {
width: 35px;
width: 2em;
text-align: left;
font-size: 1em;
margin-left: 10px;
margin-left: 0.75em;
vertical-align: middle;
display: inline-block;
position: relative;
top: -1px;
.@{iconfont-css-prefix} {
font-size: @font-size-base;
}

View File

@ -16,7 +16,12 @@ exports[`renders ./components/slider/demo/basic.md correctly 1`] = `
class="ant-slider-step"
/>
<div
aria-disabled="false"
aria-valuemax="100"
aria-valuemin="0"
aria-valuenow="30"
class="ant-slider-handle"
role="slider"
style="left:30%;"
/>
<div
@ -37,11 +42,21 @@ exports[`renders ./components/slider/demo/basic.md correctly 1`] = `
class="ant-slider-step"
/>
<div
aria-disabled="false"
aria-valuemax="100"
aria-valuemin="0"
aria-valuenow="20"
class="ant-slider-handle ant-slider-handle-1"
role="slider"
style="left:20%;"
/>
<div
aria-disabled="false"
aria-valuemax="100"
aria-valuemin="0"
aria-valuenow="50"
class="ant-slider-handle ant-slider-handle-2"
role="slider"
style="left:50%;"
/>
<div
@ -76,7 +91,12 @@ exports[`renders ./components/slider/demo/event.md correctly 1`] = `
class="ant-slider-step"
/>
<div
aria-disabled="false"
aria-valuemax="100"
aria-valuemin="0"
aria-valuenow="30"
class="ant-slider-handle"
role="slider"
style="left:30%;"
/>
<div
@ -97,11 +117,21 @@ exports[`renders ./components/slider/demo/event.md correctly 1`] = `
class="ant-slider-step"
/>
<div
aria-disabled="false"
aria-valuemax="100"
aria-valuemin="0"
aria-valuenow="20"
class="ant-slider-handle ant-slider-handle-1"
role="slider"
style="left:20%;"
/>
<div
aria-disabled="false"
aria-valuemax="100"
aria-valuemin="0"
aria-valuenow="50"
class="ant-slider-handle ant-slider-handle-2"
role="slider"
style="left:50%;"
/>
<div
@ -132,7 +162,12 @@ exports[`renders ./components/slider/demo/icon-slider.md correctly 1`] = `
class="ant-slider-step"
/>
<div
aria-disabled="false"
aria-valuemax="20"
aria-valuemin="0"
aria-valuenow="0"
class="ant-slider-handle"
role="slider"
style="left:0%;"
/>
<div
@ -167,7 +202,12 @@ exports[`renders ./components/slider/demo/input-number.md correctly 1`] = `
class="ant-slider-step"
/>
<div
aria-disabled="false"
aria-valuemax="20"
aria-valuemin="1"
aria-valuenow="1"
class="ant-slider-handle"
role="slider"
style="left:0%;"
/>
<div
@ -248,7 +288,12 @@ exports[`renders ./components/slider/demo/input-number.md correctly 1`] = `
class="ant-slider-step"
/>
<div
aria-disabled="false"
aria-valuemax="1"
aria-valuemin="0"
aria-valuenow="0"
class="ant-slider-handle"
role="slider"
style="left:0%;"
/>
<div
@ -348,7 +393,12 @@ exports[`renders ./components/slider/demo/mark.md correctly 1`] = `
/>
</div>
<div
aria-disabled="false"
aria-valuemax="100"
aria-valuemin="0"
aria-valuenow="37"
class="ant-slider-handle"
role="slider"
style="left:37%;"
/>
<div
@ -413,11 +463,21 @@ exports[`renders ./components/slider/demo/mark.md correctly 1`] = `
/>
</div>
<div
aria-disabled="false"
aria-valuemax="100"
aria-valuemin="0"
aria-valuenow="26"
class="ant-slider-handle ant-slider-handle-1"
role="slider"
style="left:26%;"
/>
<div
aria-disabled="false"
aria-valuemax="100"
aria-valuemin="0"
aria-valuenow="37"
class="ant-slider-handle ant-slider-handle-2"
role="slider"
style="left:37%;"
/>
<div
@ -485,7 +545,12 @@ exports[`renders ./components/slider/demo/mark.md correctly 1`] = `
/>
</div>
<div
aria-disabled="false"
aria-valuemax="100"
aria-valuemin="0"
aria-valuenow="37"
class="ant-slider-handle"
role="slider"
style="left:37%;"
/>
<div
@ -553,7 +618,12 @@ exports[`renders ./components/slider/demo/mark.md correctly 1`] = `
/>
</div>
<div
aria-disabled="false"
aria-valuemax="100"
aria-valuemin="0"
aria-valuenow="37"
class="ant-slider-handle"
role="slider"
style="left:37%;"
/>
<div
@ -621,7 +691,12 @@ exports[`renders ./components/slider/demo/mark.md correctly 1`] = `
/>
</div>
<div
aria-disabled="false"
aria-valuemax="100"
aria-valuemin="0"
aria-valuenow="37"
class="ant-slider-handle"
role="slider"
style="left:37%;"
/>
<div
@ -674,7 +749,12 @@ exports[`renders ./components/slider/demo/tip-formatter.md correctly 1`] = `
class="ant-slider-step"
/>
<div
aria-disabled="false"
aria-valuemax="100"
aria-valuemin="0"
aria-valuenow="0"
class="ant-slider-handle"
role="slider"
style="left:0%;"
/>
<div
@ -695,7 +775,12 @@ exports[`renders ./components/slider/demo/tip-formatter.md correctly 1`] = `
class="ant-slider-step"
/>
<div
aria-disabled="false"
aria-valuemax="100"
aria-valuemin="0"
aria-valuenow="0"
class="ant-slider-handle"
role="slider"
style="left:0%;"
/>
<div
@ -726,7 +811,12 @@ exports[`renders ./components/slider/demo/vertical.md correctly 1`] = `
class="ant-slider-step"
/>
<div
aria-disabled="false"
aria-valuemax="100"
aria-valuemin="0"
aria-valuenow="30"
class="ant-slider-handle"
role="slider"
style="bottom:30%;"
/>
<div
@ -751,11 +841,21 @@ exports[`renders ./components/slider/demo/vertical.md correctly 1`] = `
class="ant-slider-step"
/>
<div
aria-disabled="false"
aria-valuemax="100"
aria-valuemin="0"
aria-valuenow="20"
class="ant-slider-handle ant-slider-handle-1"
role="slider"
style="bottom:20%;"
/>
<div
aria-disabled="false"
aria-valuemax="100"
aria-valuemin="0"
aria-valuenow="50"
class="ant-slider-handle ant-slider-handle-2"
role="slider"
style="bottom:50%;"
/>
<div
@ -797,11 +897,21 @@ exports[`renders ./components/slider/demo/vertical.md correctly 1`] = `
/>
</div>
<div
aria-disabled="false"
aria-valuemax="100"
aria-valuemin="0"
aria-valuenow="26"
class="ant-slider-handle ant-slider-handle-1"
role="slider"
style="bottom:26%;"
/>
<div
aria-disabled="false"
aria-valuemax="100"
aria-valuemin="0"
aria-valuenow="37"
class="ant-slider-handle ant-slider-handle-2"
role="slider"
style="bottom:37%;"
/>
<div

View File

@ -70,6 +70,7 @@ export default class Slider extends React.Component<SliderProps, any> {
>
<RcHandle
{...restProps}
value={value}
onMouseEnter={() => this.toggleTooltipVisible(index, true)}
onMouseLeave={() => this.toggleTooltipVisible(index, false)}
/>

View File

@ -24,9 +24,11 @@
.@{className}-appear.@{className}-appear-active {
animation-name: ~"@{keyframeName}In";
animation-play-state: running;
pointer-events: none;
}
.@{className}-leave.@{className}-leave-active {
animation-name: ~"@{keyframeName}Out";
animation-play-state: running;
pointer-events: none;
}
}

View File

@ -1,5 +1,4 @@
import React from 'react';
import RcTable from 'rc-table';
export interface ColumnProps<T> {
title?: React.ReactNode;
@ -24,4 +23,4 @@ export interface ColumnProps<T> {
onCellClick?: (record: T, event: any) => void;
}
export default class Column<T> extends (RcTable.Column as React.ComponentClass<ColumnProps<T>>) {}
export default class Column<T> extends React.Component<ColumnProps<T>, React.ComponentState> {}

View File

@ -1,8 +1,9 @@
import React from 'react';
import RcTable from 'rc-table';
export interface ColumnGroupProps {
title?: React.ReactNode;
}
export default class ColumnGroup extends (RcTable.ColumnGroup as React.ComponentClass<ColumnGroupProps>) {}
export default class ColumnGroup extends React.Component<ColumnGroupProps, React.ComponentState> {
static __ANT_TABLE_COLUMN_GROUP = true;
}

View File

@ -79,12 +79,14 @@ exports[`Table.pagination renders pagination correctly 1`] = `
<li
aria-disabled="true"
class="ant-pagination-disabled ant-pagination-prev"
tabindex="0"
title="上一页"
>
<a />
</li>
<li
class="ant-pagination-item ant-pagination-item-1 ant-pagination-item-active"
tabindex="0"
title="1"
>
<a>
@ -93,6 +95,7 @@ exports[`Table.pagination renders pagination correctly 1`] = `
</li>
<li
class="ant-pagination-item ant-pagination-item-2"
tabindex="0"
title="2"
>
<a>
@ -102,6 +105,7 @@ exports[`Table.pagination renders pagination correctly 1`] = `
<li
aria-disabled="false"
class=" ant-pagination-next"
tabindex="0"
title="下一页"
>
<a />

View File

@ -355,12 +355,14 @@ exports[`renders ./components/table/demo/basic.md correctly 1`] = `
<li
aria-disabled="true"
class="ant-pagination-disabled ant-pagination-prev"
tabindex="0"
title="上一页"
>
<a />
</li>
<li
class="ant-pagination-item ant-pagination-item-1 ant-pagination-item-active"
tabindex="0"
title="1"
>
<a>
@ -370,6 +372,7 @@ exports[`renders ./components/table/demo/basic.md correctly 1`] = `
<li
aria-disabled="true"
class="ant-pagination-disabled ant-pagination-next"
tabindex="0"
title="下一页"
>
<a />
@ -540,12 +543,14 @@ exports[`renders ./components/table/demo/bordered.md correctly 1`] = `
<li
aria-disabled="true"
class="ant-pagination-disabled ant-pagination-prev"
tabindex="0"
title="上一页"
>
<a />
</li>
<li
class="ant-pagination-item ant-pagination-item-1 ant-pagination-item-active"
tabindex="0"
title="1"
>
<a>
@ -555,6 +560,7 @@ exports[`renders ./components/table/demo/bordered.md correctly 1`] = `
<li
aria-disabled="true"
class="ant-pagination-disabled ant-pagination-next"
tabindex="0"
title="下一页"
>
<a />
@ -806,12 +812,14 @@ exports[`renders ./components/table/demo/colspan-rowspan.md correctly 1`] = `
<li
aria-disabled="true"
class="ant-pagination-disabled ant-pagination-prev"
tabindex="0"
title="上一页"
>
<a />
</li>
<li
class="ant-pagination-item ant-pagination-item-1 ant-pagination-item-active"
tabindex="0"
title="1"
>
<a>
@ -821,6 +829,7 @@ exports[`renders ./components/table/demo/colspan-rowspan.md correctly 1`] = `
<li
aria-disabled="true"
class="ant-pagination-disabled ant-pagination-next"
tabindex="0"
title="下一页"
>
<a />
@ -1001,12 +1010,14 @@ exports[`renders ./components/table/demo/custom-filter-panel.md correctly 1`] =
<li
aria-disabled="true"
class="ant-pagination-disabled ant-pagination-prev"
tabindex="0"
title="上一页"
>
<a />
</li>
<li
class="ant-pagination-item ant-pagination-item-1 ant-pagination-item-active"
tabindex="0"
title="1"
>
<a>
@ -1016,6 +1027,7 @@ exports[`renders ./components/table/demo/custom-filter-panel.md correctly 1`] =
<li
aria-disabled="true"
class="ant-pagination-disabled ant-pagination-next"
tabindex="0"
title="下一页"
>
<a />
@ -2339,12 +2351,14 @@ exports[`renders ./components/table/demo/dynamic-settings.md correctly 1`] = `
<li
aria-disabled="true"
class="ant-pagination-disabled ant-pagination-prev"
tabindex="0"
title="上一页"
>
<a />
</li>
<li
class="ant-pagination-item ant-pagination-item-1 ant-pagination-item-active"
tabindex="0"
title="1"
>
<a>
@ -2354,6 +2368,7 @@ exports[`renders ./components/table/demo/dynamic-settings.md correctly 1`] = `
<li
aria-disabled="true"
class="ant-pagination-disabled ant-pagination-next"
tabindex="0"
title="下一页"
>
<a />
@ -2539,12 +2554,14 @@ exports[`renders ./components/table/demo/edit-cell.md correctly 1`] = `
<li
aria-disabled="true"
class="ant-pagination-disabled ant-pagination-prev"
tabindex="0"
title="上一页"
>
<a />
</li>
<li
class="ant-pagination-item ant-pagination-item-1 ant-pagination-item-active"
tabindex="0"
title="1"
>
<a>
@ -2554,6 +2571,7 @@ exports[`renders ./components/table/demo/edit-cell.md correctly 1`] = `
<li
aria-disabled="true"
class="ant-pagination-disabled ant-pagination-next"
tabindex="0"
title="下一页"
>
<a />
@ -2696,12 +2714,14 @@ exports[`renders ./components/table/demo/edit-row.md correctly 1`] = `
<li
aria-disabled="true"
class="ant-pagination-disabled ant-pagination-prev"
tabindex="0"
title="上一页"
>
<a />
</li>
<li
class="ant-pagination-item ant-pagination-item-1 ant-pagination-item-active"
tabindex="0"
title="1"
>
<a>
@ -2711,6 +2731,7 @@ exports[`renders ./components/table/demo/edit-row.md correctly 1`] = `
<li
aria-disabled="true"
class="ant-pagination-disabled ant-pagination-next"
tabindex="0"
title="下一页"
>
<a />
@ -2911,12 +2932,14 @@ exports[`renders ./components/table/demo/expand.md correctly 1`] = `
<li
aria-disabled="true"
class="ant-pagination-disabled ant-pagination-prev"
tabindex="0"
title="上一页"
>
<a />
</li>
<li
class="ant-pagination-item ant-pagination-item-1 ant-pagination-item-active"
tabindex="0"
title="1"
>
<a>
@ -2926,6 +2949,7 @@ exports[`renders ./components/table/demo/expand.md correctly 1`] = `
<li
aria-disabled="true"
class="ant-pagination-disabled ant-pagination-next"
tabindex="0"
title="下一页"
>
<a />
@ -3465,12 +3489,14 @@ exports[`renders ./components/table/demo/expand-children.md correctly 1`] = `
<li
aria-disabled="true"
class="ant-pagination-disabled ant-pagination-prev"
tabindex="0"
title="上一页"
>
<a />
</li>
<li
class="ant-pagination-item ant-pagination-item-1 ant-pagination-item-active"
tabindex="0"
title="1"
>
<a>
@ -3480,6 +3506,7 @@ exports[`renders ./components/table/demo/expand-children.md correctly 1`] = `
<li
aria-disabled="true"
class="ant-pagination-disabled ant-pagination-next"
tabindex="0"
title="下一页"
>
<a />
@ -3917,12 +3944,14 @@ exports[`renders ./components/table/demo/fixed-columns.md correctly 1`] = `
<li
aria-disabled="true"
class="ant-pagination-disabled ant-pagination-prev"
tabindex="0"
title="上一页"
>
<a />
</li>
<li
class="ant-pagination-item ant-pagination-item-1 ant-pagination-item-active"
tabindex="0"
title="1"
>
<a>
@ -3932,6 +3961,7 @@ exports[`renders ./components/table/demo/fixed-columns.md correctly 1`] = `
<li
aria-disabled="true"
class="ant-pagination-disabled ant-pagination-next"
tabindex="0"
title="下一页"
>
<a />
@ -5240,12 +5270,14 @@ exports[`renders ./components/table/demo/fixed-columns-header.md correctly 1`] =
<li
aria-disabled="true"
class="ant-pagination-disabled ant-pagination-prev"
tabindex="0"
title="上一页"
>
<a />
</li>
<li
class="ant-pagination-item ant-pagination-item-1 ant-pagination-item-active"
tabindex="0"
title="1"
>
<a>
@ -5254,6 +5286,7 @@ exports[`renders ./components/table/demo/fixed-columns-header.md correctly 1`] =
</li>
<li
class="ant-pagination-item ant-pagination-item-2"
tabindex="0"
title="2"
>
<a>
@ -5262,6 +5295,7 @@ exports[`renders ./components/table/demo/fixed-columns-header.md correctly 1`] =
</li>
<li
class="ant-pagination-item ant-pagination-item-3"
tabindex="0"
title="3"
>
<a>
@ -5270,6 +5304,7 @@ exports[`renders ./components/table/demo/fixed-columns-header.md correctly 1`] =
</li>
<li
class="ant-pagination-item ant-pagination-item-4"
tabindex="0"
title="4"
>
<a>
@ -5278,6 +5313,7 @@ exports[`renders ./components/table/demo/fixed-columns-header.md correctly 1`] =
</li>
<li
class="ant-pagination-item ant-pagination-item-5 ant-pagination-item-before-jump-next"
tabindex="0"
title="5"
>
<a>
@ -5286,12 +5322,14 @@ exports[`renders ./components/table/demo/fixed-columns-header.md correctly 1`] =
</li>
<li
class="ant-pagination-jump-next"
tabindex="0"
title="向后 5 页"
>
<a />
</li>
<li
class="ant-pagination-item ant-pagination-item-10"
tabindex="0"
title="10"
>
<a>
@ -5301,6 +5339,7 @@ exports[`renders ./components/table/demo/fixed-columns-header.md correctly 1`] =
<li
aria-disabled="false"
class=" ant-pagination-next"
tabindex="0"
title="下一页"
>
<a />
@ -6556,12 +6595,14 @@ exports[`renders ./components/table/demo/fixed-header.md correctly 1`] = `
<li
aria-disabled="true"
class="ant-pagination-disabled ant-pagination-prev"
tabindex="0"
title="上一页"
>
<a />
</li>
<li
class="ant-pagination-item ant-pagination-item-1 ant-pagination-item-active"
tabindex="0"
title="1"
>
<a>
@ -6570,6 +6611,7 @@ exports[`renders ./components/table/demo/fixed-header.md correctly 1`] = `
</li>
<li
class="ant-pagination-item ant-pagination-item-2"
tabindex="0"
title="2"
>
<a>
@ -6579,6 +6621,7 @@ exports[`renders ./components/table/demo/fixed-header.md correctly 1`] = `
<li
aria-disabled="false"
class=" ant-pagination-next"
tabindex="0"
title="下一页"
>
<a />
@ -7625,12 +7668,14 @@ exports[`renders ./components/table/demo/grouping-columns.md correctly 1`] = `
<li
aria-disabled="true"
class="ant-pagination-disabled ant-pagination-prev"
tabindex="0"
title="上一页"
>
<a />
</li>
<li
class="ant-pagination-item ant-pagination-item-1 ant-pagination-item-active"
tabindex="0"
title="1"
>
<a>
@ -7639,6 +7684,7 @@ exports[`renders ./components/table/demo/grouping-columns.md correctly 1`] = `
</li>
<li
class="ant-pagination-item ant-pagination-item-2"
tabindex="0"
title="2"
>
<a>
@ -7647,6 +7693,7 @@ exports[`renders ./components/table/demo/grouping-columns.md correctly 1`] = `
</li>
<li
class="ant-pagination-item ant-pagination-item-3"
tabindex="0"
title="3"
>
<a>
@ -7655,6 +7702,7 @@ exports[`renders ./components/table/demo/grouping-columns.md correctly 1`] = `
</li>
<li
class="ant-pagination-item ant-pagination-item-4"
tabindex="0"
title="4"
>
<a>
@ -7663,6 +7711,7 @@ exports[`renders ./components/table/demo/grouping-columns.md correctly 1`] = `
</li>
<li
class="ant-pagination-item ant-pagination-item-5 ant-pagination-item-before-jump-next"
tabindex="0"
title="5"
>
<a>
@ -7671,12 +7720,14 @@ exports[`renders ./components/table/demo/grouping-columns.md correctly 1`] = `
</li>
<li
class="ant-pagination-jump-next"
tabindex="0"
title="向后 5 页"
>
<a />
</li>
<li
class="ant-pagination-item ant-pagination-item-10"
tabindex="0"
title="10"
>
<a>
@ -7686,6 +7737,7 @@ exports[`renders ./components/table/demo/grouping-columns.md correctly 1`] = `
<li
aria-disabled="false"
class=" ant-pagination-next"
tabindex="0"
title="下一页"
>
<a />
@ -7925,12 +7977,14 @@ exports[`renders ./components/table/demo/head.md correctly 1`] = `
<li
aria-disabled="true"
class="ant-pagination-disabled ant-pagination-prev"
tabindex="0"
title="上一页"
>
<a />
</li>
<li
class="ant-pagination-item ant-pagination-item-1 ant-pagination-item-active"
tabindex="0"
title="1"
>
<a>
@ -7940,6 +7994,7 @@ exports[`renders ./components/table/demo/head.md correctly 1`] = `
<li
aria-disabled="true"
class="ant-pagination-disabled ant-pagination-next"
tabindex="0"
title="下一页"
>
<a />
@ -8225,12 +8280,14 @@ exports[`renders ./components/table/demo/jsx.md correctly 1`] = `
<li
aria-disabled="true"
class="ant-pagination-disabled ant-pagination-prev"
tabindex="0"
title="上一页"
>
<a />
</li>
<li
class="ant-pagination-item ant-pagination-item-1 ant-pagination-item-active"
tabindex="0"
title="1"
>
<a>
@ -8240,6 +8297,7 @@ exports[`renders ./components/table/demo/jsx.md correctly 1`] = `
<li
aria-disabled="true"
class="ant-pagination-disabled ant-pagination-next"
tabindex="0"
title="下一页"
>
<a />
@ -8509,12 +8567,14 @@ exports[`renders ./components/table/demo/nested-table.md correctly 1`] = `
<li
aria-disabled="true"
class="ant-pagination-disabled ant-pagination-prev"
tabindex="0"
title="上一页"
>
<a />
</li>
<li
class="ant-pagination-item ant-pagination-item-1 ant-pagination-item-active"
tabindex="0"
title="1"
>
<a>
@ -8524,6 +8584,7 @@ exports[`renders ./components/table/demo/nested-table.md correctly 1`] = `
<li
aria-disabled="true"
class="ant-pagination-disabled ant-pagination-next"
tabindex="0"
title="下一页"
>
<a />
@ -8792,12 +8853,14 @@ exports[`renders ./components/table/demo/reset-filter.md correctly 1`] = `
<li
aria-disabled="true"
class="ant-pagination-disabled ant-pagination-prev"
tabindex="0"
title="上一页"
>
<a />
</li>
<li
class="ant-pagination-item ant-pagination-item-1 ant-pagination-item-active"
tabindex="0"
title="1"
>
<a>
@ -8807,6 +8870,7 @@ exports[`renders ./components/table/demo/reset-filter.md correctly 1`] = `
<li
aria-disabled="true"
class="ant-pagination-disabled ant-pagination-next"
tabindex="0"
title="下一页"
>
<a />
@ -9106,12 +9170,14 @@ exports[`renders ./components/table/demo/row-selection.md correctly 1`] = `
<li
aria-disabled="true"
class="ant-pagination-disabled ant-pagination-prev"
tabindex="0"
title="上一页"
>
<a />
</li>
<li
class="ant-pagination-item ant-pagination-item-1 ant-pagination-item-active"
tabindex="0"
title="1"
>
<a>
@ -9121,6 +9187,7 @@ exports[`renders ./components/table/demo/row-selection.md correctly 1`] = `
<li
aria-disabled="true"
class="ant-pagination-disabled ant-pagination-next"
tabindex="0"
title="下一页"
>
<a />
@ -9683,12 +9750,14 @@ exports[`renders ./components/table/demo/row-selection-and-operation.md correctl
<li
aria-disabled="true"
class="ant-pagination-disabled ant-pagination-prev"
tabindex="0"
title="上一页"
>
<a />
</li>
<li
class="ant-pagination-item ant-pagination-item-1 ant-pagination-item-active"
tabindex="0"
title="1"
>
<a>
@ -9697,6 +9766,7 @@ exports[`renders ./components/table/demo/row-selection-and-operation.md correctl
</li>
<li
class="ant-pagination-item ant-pagination-item-2"
tabindex="0"
title="2"
>
<a>
@ -9705,6 +9775,7 @@ exports[`renders ./components/table/demo/row-selection-and-operation.md correctl
</li>
<li
class="ant-pagination-item ant-pagination-item-3"
tabindex="0"
title="3"
>
<a>
@ -9713,6 +9784,7 @@ exports[`renders ./components/table/demo/row-selection-and-operation.md correctl
</li>
<li
class="ant-pagination-item ant-pagination-item-4"
tabindex="0"
title="4"
>
<a>
@ -9721,6 +9793,7 @@ exports[`renders ./components/table/demo/row-selection-and-operation.md correctl
</li>
<li
class="ant-pagination-item ant-pagination-item-5"
tabindex="0"
title="5"
>
<a>
@ -9730,6 +9803,7 @@ exports[`renders ./components/table/demo/row-selection-and-operation.md correctl
<li
aria-disabled="false"
class=" ant-pagination-next"
tabindex="0"
title="下一页"
>
<a />
@ -10283,12 +10357,14 @@ exports[`renders ./components/table/demo/row-selection-custom.md correctly 1`] =
<li
aria-disabled="true"
class="ant-pagination-disabled ant-pagination-prev"
tabindex="0"
title="上一页"
>
<a />
</li>
<li
class="ant-pagination-item ant-pagination-item-1 ant-pagination-item-active"
tabindex="0"
title="1"
>
<a>
@ -10297,6 +10373,7 @@ exports[`renders ./components/table/demo/row-selection-custom.md correctly 1`] =
</li>
<li
class="ant-pagination-item ant-pagination-item-2"
tabindex="0"
title="2"
>
<a>
@ -10305,6 +10382,7 @@ exports[`renders ./components/table/demo/row-selection-custom.md correctly 1`] =
</li>
<li
class="ant-pagination-item ant-pagination-item-3"
tabindex="0"
title="3"
>
<a>
@ -10313,6 +10391,7 @@ exports[`renders ./components/table/demo/row-selection-custom.md correctly 1`] =
</li>
<li
class="ant-pagination-item ant-pagination-item-4"
tabindex="0"
title="4"
>
<a>
@ -10321,6 +10400,7 @@ exports[`renders ./components/table/demo/row-selection-custom.md correctly 1`] =
</li>
<li
class="ant-pagination-item ant-pagination-item-5"
tabindex="0"
title="5"
>
<a>
@ -10330,6 +10410,7 @@ exports[`renders ./components/table/demo/row-selection-custom.md correctly 1`] =
<li
aria-disabled="false"
class=" ant-pagination-next"
tabindex="0"
title="下一页"
>
<a />
@ -10482,12 +10563,14 @@ exports[`renders ./components/table/demo/size.md correctly 1`] = `
<li
aria-disabled="true"
class="ant-pagination-disabled ant-pagination-prev"
tabindex="0"
title="上一页"
>
<a />
</li>
<li
class="ant-pagination-item ant-pagination-item-1 ant-pagination-item-active"
tabindex="0"
title="1"
>
<a>
@ -10497,6 +10580,7 @@ exports[`renders ./components/table/demo/size.md correctly 1`] = `
<li
aria-disabled="true"
class="ant-pagination-disabled ant-pagination-next"
tabindex="0"
title="下一页"
>
<a />
@ -10645,12 +10729,14 @@ exports[`renders ./components/table/demo/size.md correctly 1`] = `
<li
aria-disabled="true"
class="ant-pagination-disabled ant-pagination-prev"
tabindex="0"
title="上一页"
>
<a />
</li>
<li
class="ant-pagination-item ant-pagination-item-1 ant-pagination-item-active"
tabindex="0"
title="1"
>
<a>
@ -10660,6 +10746,7 @@ exports[`renders ./components/table/demo/size.md correctly 1`] = `
<li
aria-disabled="true"
class="ant-pagination-disabled ant-pagination-next"
tabindex="0"
title="下一页"
>
<a />

View File

@ -1,6 +1,5 @@
import React from 'react';
import assign from 'object-assign';
import ColumnGroup from './ColumnGroup';
export function flatArray(data: Object[] = [], childrenName = 'children') {
const result: Object[] = [];
@ -43,7 +42,7 @@ export function flatFilter(tree: any[], callback: Function) {
export function normalizeColumns(elements) {
const columns: any[] = [];
React.Children.forEach(elements, (element: React.ReactElement<any>) => {
React.Children.forEach(elements, (element) => {
if (!React.isValidElement(element)) {
return;
}
@ -51,7 +50,7 @@ export function normalizeColumns(elements) {
if (element.key) {
column.key = element.key;
}
if (element.type as any === ColumnGroup) {
if (element.type && (element.type as any).__ANT_TABLE_COLUMN_GROUP) {
column.children = normalizeColumns(column.children);
}
columns.push(column);

View File

@ -15,10 +15,14 @@ Click `TimePicker`, and then we could select or input a time in panel.
````jsx
import { TimePicker } from 'antd';
import moment from 'moment';
function onChange(time, timeString) {
console.log(time, timeString);
}
ReactDOM.render(<TimePicker onChange={onChange} />, mountNode);
ReactDOM.render(
<TimePicker onChange={onChange} defaultOpenValue={moment('00:00:00', 'HH:mm:ss')} />,
mountNode
);
````

View File

@ -23,6 +23,7 @@ import moment from 'moment';
|---------------------|-----|-----|-------|
| defaultValue | to set default time | [moment](http://momentjs.com/) | - |
| value | to set time | [moment](http://momentjs.com/) | - |
| defaultOpenValue | to highlight values in panel when there is no selected value | [moment](http://momentjs.com/) | moment() |
| open | whether to popup panel | boolean | false |
| onOpenChange | a callback function which will be called while panel opening/closing | (open: boolean): void | - |
| placeholder | display when there's no value | string | "Select a time" |

View File

@ -24,6 +24,7 @@ import moment from 'moment';
|---------------------|-----|-----|-------|
| defaultValue | 默认时间 | [moment](http://momentjs.com/) | 无 |
| value | 当前时间 | [moment](http://momentjs.com/) | 无 |
| defaultOpenValue | 无选中值时,面板打开时高亮的值 | [moment](http://momentjs.com/) | moment() |
| open | 面板是否打开 | boolean | false |
| onOpenChange | 面板打开/关闭时的回调 | (open: boolean): void | 无 |
| placeholder | 没有值的时候显示的内容 | string | "请选择时间" |

View File

@ -0,0 +1,5 @@
const locale = {
placeholder: 'Избор на час',
};
export default locale;

View File

@ -0,0 +1,5 @@
const locale = {
placeholder: 'Select time',
};
export default locale;

View File

@ -0,0 +1,5 @@
const locale = {
placeholder: 'Sélectionner l\'heure',
};
export default locale;

View File

@ -0,0 +1,5 @@
const locale = {
placeholder: 'Selezionare il tempo',
};
export default locale;

View File

@ -0,0 +1,5 @@
const locale = {
placeholder: 'Selecteer tijd',
};
export default locale;

View File

@ -1,6 +1,6 @@
import React from 'react';
import classNames from 'classnames';
import TimelineItem from './TimelineItem';
import TimelineItem, { TimeLineItemProps } from './TimelineItem';
export interface TimelineProps {
prefixCls?: string;
@ -11,7 +11,7 @@ export interface TimelineProps {
}
export default class Timeline extends React.Component<TimelineProps, any> {
static Item: React.ReactNode;
static Item = TimelineItem as React.ClassicComponentClass<TimeLineItemProps>;
static defaultProps = {
prefixCls: 'ant-timeline',
};

View File

@ -1,5 +1,3 @@
import Timeline from './Timeline';
import TimelineItem from './TimelineItem';
Timeline.Item = TimelineItem;
export default Timeline;

View File

@ -99,13 +99,17 @@
display: block;
}
}
&-treenode-disabled {
li&-treenode-disabled {
> span,
> a,
> a span {
> .@{select-tree-prefix-cls}-node-content-wrapper,
> .@{select-tree-prefix-cls}-node-content-wrapper span,
> span.@{select-tree-prefix-cls}-switcher {
color: @disabled-color;
cursor: not-allowed;
}
> .@{select-tree-prefix-cls}-node-content-wrapper:hover {
background: transparent;
}
}
&-icon__open {
margin-right: 2px;

View File

@ -4,6 +4,8 @@
@import "./mixin";
@tree-prefix-cls: ~"@{ant-prefix}-tree";
@tree-showline-icon-color: @text-color-secondary;
.antCheckboxFn(@checkbox-prefix-cls: ~"@{ant-prefix}-tree-checkbox");
.@{tree-prefix-cls} {
@ -141,13 +143,17 @@
display: block;
}
}
&-treenode-disabled {
li&-treenode-disabled {
> span,
> .@{tree-prefix-cls}-node-content-wrapper,
> .@{tree-prefix-cls}-node-content-wrapper span {
> .@{tree-prefix-cls}-node-content-wrapper span,
> span.@{tree-prefix-cls}-switcher {
color: @disabled-color;
cursor: not-allowed;
}
> .@{tree-prefix-cls}-node-content-wrapper:hover {
background: transparent;
}
}
&-icon__open {
margin-right: 2px;
@ -164,6 +170,7 @@
span {
&.@{tree-prefix-cls}-switcher {
background: @component-background;
color: @text-color;
&.@{tree-prefix-cls}-switcher-noop {
.antTreeShowLineIcon("tree-doc-icon");
}
@ -171,12 +178,14 @@
&.@{tree-prefix-cls}-center_open,
&.@{tree-prefix-cls}-bottom_open,
&.@{tree-prefix-cls}-noline_open {
color: @tree-showline-icon-color;
.antTreeShowLineIcon("tree-showline-open-icon");
}
&.@{tree-prefix-cls}-roots_close,
&.@{tree-prefix-cls}-center_close,
&.@{tree-prefix-cls}-bottom_close,
&.@{tree-prefix-cls}-noline_close {
color: @tree-showline-icon-color;
.antTreeShowLineIcon("tree-showline-close-icon");
}
}

View File

@ -4,7 +4,6 @@
@tree-showline-open-icon: "\e621";
@tree-showline-close-icon: "\e645";
@tree-doc-icon: "\e664";
@tree-showline-icon-color: @text-color-secondary;
.antTreeSwitcherIcon(@type: "tree-default-open-icon") {
&:after {
@ -12,8 +11,7 @@
display: inline-block;
.iconfont-font(@@type);
font-weight: bold;
color: @text-color;
transition: transform .3s ease;
transition: transform .3s;
}
}
@ -24,7 +22,6 @@
.iconfont-font(@@type);
vertical-align: baseline;
font-weight: normal;
color: @tree-showline-icon-color;
transition: transform .3s ease;
transition: transform .3s;
}
}

View File

@ -163,7 +163,7 @@ import 'antd/dist/antd.css'; // or 'antd/dist/antd.less'
在任何形式的参与前,请先阅读 [贡献者文档](https://github.com/ant-design/ant-design/blob/master/.github/CONTRIBUTING.md)。如果你希望参与贡献,欢迎 [Pull Request](https://github.com/ant-design/ant-design/pulls),或给我们 [报告 Bug](http://new-issue.ant.design/)。
> 强烈推荐阅读 [《提问的智慧》](https://github.com/ryanhanwu/How-To-Ask-Questions-The-Smart-Way)、[《如何向开源社区提问题》](https://github.com/seajs/seajs/issues/545) 和 [《如何有效地报告 Bug》](http://www.chiark.greenend.org.uk/%7Esgtatham/bugs-cn.html),更好的问题更容易获得帮助。
> 强烈推荐阅读 [《提问的智慧》](https://github.com/ryanhanwu/How-To-Ask-Questions-The-Smart-Way)、[《如何向开源社区提问题》](https://github.com/seajs/seajs/issues/545) 和 [《如何有效地报告 Bug》](http://www.chiark.greenend.org.uk/%7Esgtatham/bugs-cn.html)、[《如何向开源项目提交无法解答的问题》](https://zhuanlan.zhihu.com/p/25795393),更好的问题更容易获得帮助。
## 社区互助

View File

@ -63,7 +63,7 @@ Modify `src/App.js`, import Button component from `antd`.
```jsx
import React, { Component } from 'react';
import { Button } from 'antd';
import Button from 'antd/lib/button';
import './App.css';
class App extends Component {
@ -96,19 +96,16 @@ Ok, you now see a blue primary button displaying in page now, next you can choos
## Advanced Guides
We are successfully running antd components now; but in the real world, there are still lots of problems about antd-demo.
For instance, we actually import all components in the project which will cause a serious network perfermance issue.
We are successfully running antd components now. But in the real world, there are still lots of problems about antd-demo.
For instance, we actually import all styles of components in the project which maybe a network perfermance issue.
> You will see a warning in your browser console.
> ![](https://zos.alipayobjects.com/rmsportal/vgcHJRVZFmPjAawwVoXK.png)
So it is necessary to customize the default webpack config. We can achieve that by using `eject` script command.
Sometimes it could be necessary to customize the default webpack config. We can achieve that by using `eject` script command.
```bash
$ yarn run eject
```
### Import on demand
### Use babel-plugin-import
[babel-plugin-import](https://github.com/ant-design/babel-plugin-import) is a babel plugin for importing components on demand ([principle](/docs/react/getting-started#Import-on-Demand)). After eject all config files to antd-demo, we allowed to install it and modify `config/webpack.config.dev.js` now.
@ -136,9 +133,29 @@ $ yarn add babel-plugin-import --dev
> Note: because there is no `.babelrc` file after config eject, so we have to put the babel option into `webpack.config.js` or `babel` field of `package.json`.
Remove the `@import '~antd/dist/antd.css';` statement added before because `babel-plugin-import` will import styles.
Remove the `@import '~antd/dist/antd.css';` statement added before because `babel-plugin-import` will import styles and import components like below:
Then reboot `yarn start` and visit demo page, you should find that the above warning message would be gone which prove the `import on demand` config is effective now.
```diff
// scr/App.js
import React, { Component } from 'react';
- import Button from 'antd/lib/button';
+ import { Button } from 'antd';
import './App.css';
class App extends Component {
render() {
return (
<div className="App">
<Button type="primary">Button</Button>
</div>
);
}
}
export default App;
```
Then reboot `yarn start` and visit demo page, you should not find any [warning message](https://zos.alipayobjects.com/rmsportal/vgcHJRVZFmPjAawwVoXK.png) in console which prove the `import on demand` config is working now. You will find more info about it in [this guide](/docs/react/getting-started#Import-on-Demand).
### Customize Theme

View File

@ -62,7 +62,7 @@ $ yarn add antd
```jsx
import React, { Component } from 'react';
import { Button } from 'antd';
import Button from 'antd/lib/button';
import './App.css';
class App extends Component {
@ -94,18 +94,15 @@ export default App;
## 高级配置
我们现在已经把组件成功运行起来了,但是在实际开发过程中还有很多问题,例如上面的例子实际上加载了全部的 antd 组件的代码(对前端性能是个隐患)。
我们现在已经把组件成功运行起来了,但是在实际开发过程中还有很多问题,例如上面的例子实际上加载了全部的 antd 组件的样式(对前端性能是个隐患)。
> 你会在控制台看到如下警告。
> ![](https://zos.alipayobjects.com/rmsportal/vgcHJRVZFmPjAawwVoXK.png)
我们需要对 create-react-app 的默认配置进行自定义。可以使用 `eject` 命令将所有内建的配置暴露出来。
此时我们可能需要对 create-react-app 的默认配置进行自定义。可以使用 `eject` 命令将所有内建的配置暴露出来。
```bash
$ yarn run eject
```
### 按需加载
### 使用 babel-plugin-import
[babel-plugin-import](https://github.com/ant-design/babel-plugin-import) 是一个用于按需加载组件代码和样式的 babel 插件([原理](/docs/react/getting-started#按需加载)),现在我们尝试安装它并修改 `config/webpack.config.dev.js` 文件。
@ -133,9 +130,30 @@ $ yarn add babel-plugin-import --dev
> 注意,由于 create-react-app eject 之后的配置中没有 `.babelrc` 文件,所以需要把配置放到 `webpack.config.js``package.json``babel` 属性中。
然后移除前面在 `src/App.css` 里全量添加的 `@import '~antd/dist/antd.css';` 样式代码,现在 babel-plugin-import 会按需加载样式。
最后重启 `yarn start` 访问页面此时上面的警告信息应该没了antd 组件的 js 和 css 代码都会按需加载。
然后移除前面在 `src/App.css` 里全量添加的 `@import '~antd/dist/antd.css';` 样式代码,并且按下面的格式引入模块。
```diff
// scr/App.js
import React, { Component } from 'react';
- import Button from 'antd/lib/button';
+ import { Button } from 'antd';
import './App.css';
class App extends Component {
render() {
return (
<div className="App">
<Button type="primary">Button</Button>
</div>
);
}
}
export default App;
```
最后重启 `yarn start` 访问页面antd 组件的 js 和 css 代码都会按需加载,你在控制台也不会看到这样的[警告信息](https://zos.alipayobjects.com/rmsportal/vgcHJRVZFmPjAawwVoXK.png)。关于按需加载的原理和其他方式可以阅读[这里](/docs/react/getting-started#Import-on-Demand).
### 自定义主题

View File

@ -29,7 +29,7 @@ If the priority is given to 『readability』 and the 『editability』 of opera
Multi-Field Inline Edit
>NoteIn『Multi-Field Inline Edit』there are huge different between the content and required fieldSo it is more needed to use the [『Explain What Just Happened』](../spec/transition#解释刚刚发生了什么) in 『Use Transition』to eliminate this visual effects.
>NoteIn『Multi-Field Inline Edit』there are huge different between the content and required fieldSo it is more needed to use the [『Explain What Just Happened』](../docs/spec/transition#解释刚刚发生了什么) in 『Use Transition』to eliminate this visual effects.
<br>

View File

@ -28,7 +28,7 @@ title: 直截了当
多字段行内编辑
>注:在『多字段行内编辑』的情况下,显示的内容和编辑时所需的字段会存在比较大的差异,所以更需要『巧用过渡』原则中的[『解释刚刚发生了什么』](../spec/transition#解释刚刚发生了什么)来消除这种视觉影响。
>注:在『多字段行内编辑』的情况下,显示的内容和编辑时所需的字段会存在比较大的差异,所以更需要『巧用过渡』原则中的[『解释刚刚发生了什么』](../docs/spec/transition#解释刚刚发生了什么)来消除这种视觉影响。
<br>

View File

@ -1,6 +1,6 @@
{
"name": "antd",
"version": "2.10.3",
"version": "2.10.4",
"title": "Ant Design",
"description": "An enterprise-class UI design language and React-based implementation",
"homepage": "http://ant.design/",
@ -58,11 +58,11 @@
"rc-input-number": "~3.5.0",
"rc-menu": "~5.0.9",
"rc-notification": "~1.4.0",
"rc-pagination": "~1.8.7",
"rc-pagination": "~1.9.4",
"rc-progress": "~2.1.0",
"rc-rate": "~2.1.0",
"rc-select": "~6.8.0",
"rc-slider": "~7.0.0",
"rc-slider": "~8.0.0",
"rc-steps": "~2.5.0",
"rc-switch": "~1.5.1",
"rc-table": "~5.3.3",
@ -72,7 +72,7 @@
"rc-tree": "~1.5.0",
"rc-tree-select": "~1.10.2",
"rc-upload": "~2.3.0",
"rc-util": "^4.0.1",
"rc-util": "^4.0.4",
"react-lazy-load": "^3.0.10",
"react-slick": "~0.14.2",
"shallowequal": "^0.2.2",
@ -82,7 +82,7 @@
"@types/react": "^15.0.8",
"@types/react-dom": "~0.14.18",
"antd-demo-jest": "^1.0.5",
"antd-tools": "^1.4.2",
"antd-tools": "~1.5.0",
"babel-cli": "^6.18.0",
"babel-eslint": "^7.1.0",
"babel-jest": "^19.0.0",
@ -92,7 +92,7 @@
"babel-preset-react": "^6.16.0",
"babel-preset-stage-0": "^6.16.0",
"bezier-easing": "^2.0.3",
"bisheng": "^0.23.0",
"bisheng": "^0.24.0",
"bisheng-plugin-antd": "^0.13.2",
"bisheng-plugin-description": "^0.1.1",
"bisheng-plugin-react": "^0.5.0",