mirror of
https://github.com/ant-design/ant-design.git
synced 2025-01-18 22:36:31 +08:00
Merge branch 'master' into feature
This commit is contained in:
commit
d0799fb983
2
.jest.js
2
.jest.js
@ -2,7 +2,7 @@ const libDir = process.env.LIB_DIR;
|
||||
|
||||
const transformIgnorePatterns = [
|
||||
'/dist/',
|
||||
'node_modules/[^/]+?/(?!(es|node_modules)/)', // Ignore modules without es dir
|
||||
'node_modules/(?!(_react-dnd|react-dnd|_dnd-core|dnd-core))[^/]+?/(?!(es|node_modules)/)', // Ignore modules without es dir
|
||||
];
|
||||
|
||||
module.exports = {
|
||||
|
@ -1,3 +1,5 @@
|
||||
const { transformIgnorePatterns } = require('./.jest');
|
||||
|
||||
// jest config for server render environment
|
||||
module.exports = {
|
||||
setupFiles: ['./tests/setup.js'],
|
||||
@ -10,6 +12,7 @@ module.exports = {
|
||||
},
|
||||
testRegex: 'demo\\.test\\.js$',
|
||||
testEnvironment: 'node',
|
||||
transformIgnorePatterns,
|
||||
snapshotSerializers: ['enzyme-to-json/serializer'],
|
||||
globals: {
|
||||
'ts-jest': {
|
||||
|
@ -15,6 +15,43 @@ timeline: true
|
||||
|
||||
---
|
||||
|
||||
## 3.19.6
|
||||
|
||||
`2019-06-19`
|
||||
|
||||
- 🐞 Fix nest Card `extra` position not correct. [#17140](https://github.com/ant-design/ant-design/pull/17140)
|
||||
- 🐞 Fix Table crash while `filter` dynamic change. [#17141](https://github.com/ant-design/ant-design/pull/17141)
|
||||
- 🐞 Fix TextArea & DatePicker separator position too low and align issue. [#17165](https://github.com/ant-design/ant-design/pull/17165)
|
||||
|
||||
## 3.19.5
|
||||
|
||||
`2019-06-17`
|
||||
|
||||
- 🐞 Fix RangerPicker input style not align. [#17126](https://github.com/ant-design/ant-design/issues/17126)
|
||||
- 🐞 Fix `getPopupContainer` of ConfigProvider not works on Modal. [#17132](https://github.com/ant-design/ant-design/issues/17132)
|
||||
- TypeScript
|
||||
- 🐞 Fix Descriptions.Item definition. [#17049](https://github.com/ant-design/ant-design/pull/17049)
|
||||
|
||||
## 3.19.4
|
||||
|
||||
`2019-06-16`
|
||||
|
||||
- PageHeader
|
||||
- 🐞 Fix abnormal margin issue of PageHeader `extra`. [#17025](https://github.com/ant-design/ant-design/issues/17025)
|
||||
- 🐞 Fix the `onBack` button displays a pointer that is not always clickable. [#17114](https://github.com/ant-design/ant-design/pull/17114)
|
||||
- 🐞 Fix Table with sort not back to first page. [#16978](https://github.com/ant-design/ant-design/issues/16978)
|
||||
- 🐞 Fix Menu.SubMenu with selected item should have active style. [#17039](https://github.com/ant-design/ant-design/pull/17039)
|
||||
- 🐞 Fix Tree with showLine animation shake. [#17055](https://github.com/ant-design/ant-design/pull/17055)
|
||||
- 🐞 Fix Collapse's redundant scrollbar. [#17009](https://github.com/ant-design/ant-design/pull/17009) [#mtadams007](https://github.com/mtadams007)
|
||||
- 🐞 Fixing date formats for Arabic-Egypt locale. [#17092](https://github.com/ant-design/ant-design/pull/17092) [#3b3ziz](https://github.com/3b3ziz)
|
||||
- 🐞 Fix Input not align with other components in Chrome. [#17082](https://github.com/ant-design/ant-design/issues/17082)
|
||||
- 💄 Adjust bordered table header scrollbar style. [#17065](https://github.com/ant-design/ant-design/pull/17065)
|
||||
- 🌟 Make Divider style customization easier. [#17113](https://github.com/ant-design/ant-design/pull/17113)
|
||||
- 🇷🇺 Add missing Russian translations. [#17108](https://github.com/ant-design/ant-design/pull/17108) [#Enfield1](https://github.com/Enfield1)
|
||||
- 🌟 Add new less variables [#17041](https://github.com/ant-design/ant-design/pull/17041) [#SamKirkland](https://github.com/SamKirkland):
|
||||
- `@comment-font-size-base`
|
||||
- `@comment-font-size-sm`
|
||||
|
||||
## 3.19.3
|
||||
|
||||
`2019-06-06`
|
||||
@ -27,8 +64,7 @@ timeline: true
|
||||
- 🐞 **Fix Table header extra vertical scrollbar problem.** [#16950](https://github.com/ant-design/ant-design/pull/16950)
|
||||
- 🐞 Fix Table miss `border-radius` in Firefox. [#16957](https://github.com/ant-design/ant-design/pull/16957)
|
||||
- 🐞 Fix Table error when `rowSelection.getCheckboxProps()` has no return value. [#15224](https://github.com/ant-design/ant-design/pull/15224)
|
||||
- 🐞 Fix Table abnormal scrollbar in Chrome when using `title` and `rowSelection`.
|
||||
[#16934](https://github.com/ant-design/ant-design/pull/16934)
|
||||
- 🐞 Fix Table abnormal scrollbar in Chrome when using `title` and `rowSelection`. [#16934](https://github.com/ant-design/ant-design/pull/16934)
|
||||
- 🐞 Fix Divider `orientation="center"` style. [#16988](https://github.com/ant-design/ant-design/pull/16988)
|
||||
- 🐞 Fix Cascader error when type space. [#16918](https://github.com/ant-design/ant-design/pull/16918) [@Durisvk](https://github.com/Durisvk)
|
||||
- 🐞 Fix missing spanish translations. [#17002](https://github.com/ant-design/ant-design/pull/17002) [@morellan](https://github.com/morellan)
|
||||
|
@ -15,6 +15,43 @@ timeline: true
|
||||
|
||||
---
|
||||
|
||||
## 3.19.6
|
||||
|
||||
`2019-06-19`
|
||||
|
||||
- 🐞 修复嵌套 Card `extra` 位置不正确的问题。[#17140](https://github.com/ant-design/ant-design/pull/17140)
|
||||
- 🐞 修复 Table 动态改变 `filter` 时报错的问题。[#17141](https://github.com/ant-design/ant-design/pull/17141)
|
||||
- 🐞 修复 TextArea 和 RangePicker 分隔符位置偏下和对齐的问题。[#17165](https://github.com/ant-design/ant-design/pull/17165)
|
||||
|
||||
## 3.19.5
|
||||
|
||||
`2019-06-17`
|
||||
|
||||
- 🐞 修复 RangerPicker 输入框内容没有对齐的问题。[#17126](https://github.com/ant-design/ant-design/issues/17126)
|
||||
- 🐞 修复 ConfigProvider 的 `getPopupContainer` 对 Modal 无效的问题。[#17132](https://github.com/ant-design/ant-design/issues/17132)
|
||||
- TypeScript
|
||||
- 🐞 修复 Descriptions.Item 的类型定义。[#17049](https://github.com/ant-design/ant-design/pull/17049)
|
||||
|
||||
## 3.19.4
|
||||
|
||||
`2019-06-16`
|
||||
|
||||
- PageHeader
|
||||
- 🐞 修复 `extra` 的一个元素边距问题。[#17025](https://github.com/ant-design/ant-design/issues/17025)
|
||||
- 🐞 修复手型鼠标指针并不总是可点击的问题。[#17114](https://github.com/ant-design/ant-design/pull/17114)
|
||||
- 🐞 修复 Table 数据排序后不会回到第一页的问题。[#16978](https://github.com/ant-design/ant-design/issues/16978)
|
||||
- 🐞 修复 Menu 选项的子菜单选中并收起时没有高亮的问题。[#17039](https://github.com/ant-design/ant-design/pull/17039)
|
||||
- 🐞 修复 Tree 使用 `showLine` 时动画抖动的问题。[#17055](https://github.com/ant-design/ant-design/pull/17055)
|
||||
- 🐞 修复 Collapse 会出现多余滚动条的问题。[#17009](https://github.com/ant-design/ant-design/pull/17009) [#mtadams007](https://github.com/mtadams007)
|
||||
- 🐞 修复 DatePicker 阿拉伯语的时间格式。[#17092](https://github.com/ant-design/ant-design/pull/17092) [#3b3ziz](https://github.com/3b3ziz)
|
||||
- 🐞 修复 Input 与其他组件不对齐的问题。[#17082](https://github.com/ant-design/ant-design/issues/17082)
|
||||
- 💄 优化带边框 Table 的滚动条样式细节。[#17065](https://github.com/ant-design/ant-design/pull/17065)
|
||||
- 🌟 优化 Divider 实现方式以方便样式定制。[#17113](https://github.com/ant-design/ant-design/pull/17113)
|
||||
- 🇷🇺 新增部分俄语翻译。[#17108](https://github.com/ant-design/ant-design/pull/17108) [#Enfield1](https://github.com/Enfield1)
|
||||
- 🌟 新增 less 变量 [#17041](https://github.com/ant-design/ant-design/pull/17041) [#SamKirkland](https://github.com/SamKirkland):
|
||||
- `@comment-font-size-base`
|
||||
- `@comment-font-size-sm`
|
||||
|
||||
## 3.19.3
|
||||
|
||||
`2019-06-06`
|
||||
|
@ -274,7 +274,13 @@ class Affix extends React.Component<AffixProps, AffixState> {
|
||||
return (
|
||||
<div {...props} style={mergedPlaceholderStyle} ref={this.savePlaceholderNode}>
|
||||
<div className={className} ref={this.saveFixedNode} style={this.state.affixStyle}>
|
||||
<ResizeObserver onResize={this.updatePosition}>{children}</ResizeObserver>
|
||||
<ResizeObserver
|
||||
onResize={() => {
|
||||
this.updatePosition();
|
||||
}}
|
||||
>
|
||||
{children}
|
||||
</ResizeObserver>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
@ -89,22 +89,24 @@ class ScrollNumber extends Component<ScrollNumberProps, ScrollNumberState> {
|
||||
componentDidUpdate(_: any, prevState: ScrollNumberState) {
|
||||
this.lastCount = prevState.count;
|
||||
const { animateStarted } = this.state;
|
||||
const { onAnimated } = this.props;
|
||||
if (animateStarted) {
|
||||
this.setState(
|
||||
{
|
||||
(__, props) => ({
|
||||
animateStarted: false,
|
||||
count: this.props.count,
|
||||
},
|
||||
() => {
|
||||
if (onAnimated) {
|
||||
onAnimated();
|
||||
}
|
||||
},
|
||||
count: props.count,
|
||||
}),
|
||||
this.onAnimated,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
onAnimated = () => {
|
||||
const { onAnimated } = this.props;
|
||||
if (onAnimated) {
|
||||
onAnimated();
|
||||
}
|
||||
}
|
||||
|
||||
renderNumberList(position: number) {
|
||||
const childrenToReturn: React.ReactElement<any>[] = [];
|
||||
for (let i = 0; i < 30; i++) {
|
||||
|
@ -109,7 +109,7 @@
|
||||
padding-bottom: 0;
|
||||
}
|
||||
|
||||
&-contain-tabs &-extra {
|
||||
&-contain-tabs > &-head &-extra {
|
||||
padding-bottom: 0;
|
||||
}
|
||||
|
||||
|
@ -43,6 +43,10 @@
|
||||
|
||||
&-input {
|
||||
outline: none;
|
||||
|
||||
&.@{ant-prefix}-input {
|
||||
line-height: @line-height-base;
|
||||
}
|
||||
}
|
||||
|
||||
&-input.@{ant-prefix}-input-sm {
|
||||
|
@ -10,12 +10,13 @@ import { ConfigConsumer, ConfigConsumerProps } from '../config-provider';
|
||||
|
||||
export interface DescriptionsItemProps {
|
||||
prefixCls?: string;
|
||||
label: React.ReactNode;
|
||||
children: JSX.Element;
|
||||
label?: React.ReactNode;
|
||||
children: React.ReactNode;
|
||||
span?: number;
|
||||
}
|
||||
|
||||
const DescriptionsItem: React.SFC<DescriptionsItemProps> = ({ children }) => children;
|
||||
const DescriptionsItem: React.SFC<DescriptionsItemProps> = ({ children }) =>
|
||||
children as JSX.Element;
|
||||
|
||||
export interface DescriptionsProps {
|
||||
prefixCls?: string;
|
||||
@ -148,7 +149,7 @@ class Descriptions extends React.Component<
|
||||
size: 'default',
|
||||
column: defaultColumnMap,
|
||||
};
|
||||
static Item: typeof DescriptionsItem;
|
||||
static Item: typeof DescriptionsItem = DescriptionsItem;
|
||||
state: {
|
||||
screens: BreakpointMap;
|
||||
} = {
|
||||
@ -251,6 +252,4 @@ class Descriptions extends React.Component<
|
||||
}
|
||||
}
|
||||
|
||||
Descriptions.Item = DescriptionsItem;
|
||||
|
||||
export default Descriptions;
|
||||
|
@ -22,6 +22,7 @@
|
||||
border-radius: @border-radius-base;
|
||||
table {
|
||||
width: 100%;
|
||||
table-layout: fixed;
|
||||
}
|
||||
}
|
||||
|
||||
@ -90,6 +91,9 @@
|
||||
&.bordered {
|
||||
.@{descriptions-prefix-cls}-view {
|
||||
border: 1px solid @border-color-split;
|
||||
> table {
|
||||
table-layout: auto;
|
||||
}
|
||||
}
|
||||
.@{descriptions-prefix-cls}-item-label,
|
||||
.@{descriptions-prefix-cls}-item-content {
|
||||
|
@ -1,5 +1,26 @@
|
||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`renders ./components/divider/demo/customize-style.md correctly 1`] = `
|
||||
<div>
|
||||
<div
|
||||
class="ant-divider ant-divider-horizontal"
|
||||
style="height:2px;background-color:#7cb305"
|
||||
/>
|
||||
<div
|
||||
class="ant-divider ant-divider-horizontal ant-divider-dashed"
|
||||
style="border-color:#7cb305"
|
||||
/>
|
||||
<div
|
||||
class="ant-divider ant-divider-vertical"
|
||||
style="height:60px;background-color:#7cb305"
|
||||
/>
|
||||
<div
|
||||
class="ant-divider ant-divider-vertical ant-divider-dashed"
|
||||
style="height:60px;border-color:#7cb305"
|
||||
/>
|
||||
</div>
|
||||
`;
|
||||
|
||||
exports[`renders ./components/divider/demo/horizontal.md correctly 1`] = `
|
||||
<div>
|
||||
<p>
|
||||
@ -11,18 +32,6 @@ exports[`renders ./components/divider/demo/horizontal.md correctly 1`] = `
|
||||
<p>
|
||||
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed nonne merninisti licere mihi ista probare, quae sunt a te dicta? Refert tamen, quo modo.
|
||||
</p>
|
||||
<div
|
||||
class="ant-divider ant-divider-horizontal ant-divider-with-text-center"
|
||||
>
|
||||
<span
|
||||
class="ant-divider-inner-text"
|
||||
>
|
||||
With Text
|
||||
</span>
|
||||
</div>
|
||||
<p>
|
||||
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed nonne merninisti licere mihi ista probare, quae sunt a te dicta? Refert tamen, quo modo.
|
||||
</p>
|
||||
<div
|
||||
class="ant-divider ant-divider-horizontal ant-divider-dashed"
|
||||
/>
|
||||
@ -32,35 +41,6 @@ exports[`renders ./components/divider/demo/horizontal.md correctly 1`] = `
|
||||
</div>
|
||||
`;
|
||||
|
||||
exports[`renders ./components/divider/demo/orientation.md correctly 1`] = `
|
||||
<div>
|
||||
<div
|
||||
class="ant-divider ant-divider-horizontal ant-divider-with-text-left"
|
||||
>
|
||||
<span
|
||||
class="ant-divider-inner-text"
|
||||
>
|
||||
Left Text
|
||||
</span>
|
||||
</div>
|
||||
<p>
|
||||
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed nonne merninisti licere mihi ista probare, quae sunt a te dicta? Refert tamen, quo modo.
|
||||
</p>
|
||||
<div
|
||||
class="ant-divider ant-divider-horizontal ant-divider-with-text-right"
|
||||
>
|
||||
<span
|
||||
class="ant-divider-inner-text"
|
||||
>
|
||||
Right Text
|
||||
</span>
|
||||
</div>
|
||||
<p>
|
||||
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed nonne merninisti licere mihi ista probare, quae sunt a te dicta? Refert tamen, quo modo.
|
||||
</p>
|
||||
</div>
|
||||
`;
|
||||
|
||||
exports[`renders ./components/divider/demo/vertical.md correctly 1`] = `
|
||||
<div>
|
||||
Text
|
||||
@ -82,3 +62,47 @@ exports[`renders ./components/divider/demo/vertical.md correctly 1`] = `
|
||||
</a>
|
||||
</div>
|
||||
`;
|
||||
|
||||
exports[`renders ./components/divider/demo/with-text.md correctly 1`] = `
|
||||
<div>
|
||||
<p>
|
||||
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed nonne merninisti licere mihi ista probare, quae sunt a te dicta? Refert tamen, quo modo.
|
||||
</p>
|
||||
<div
|
||||
class="ant-divider ant-divider-horizontal ant-divider-with-text-center"
|
||||
>
|
||||
<span
|
||||
class="ant-divider-inner-text"
|
||||
>
|
||||
Text
|
||||
</span>
|
||||
</div>
|
||||
<p>
|
||||
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed nonne merninisti licere mihi ista probare, quae sunt a te dicta? Refert tamen, quo modo.
|
||||
</p>
|
||||
<div
|
||||
class="ant-divider ant-divider-horizontal ant-divider-with-text-left"
|
||||
>
|
||||
<span
|
||||
class="ant-divider-inner-text"
|
||||
>
|
||||
Left Text
|
||||
</span>
|
||||
</div>
|
||||
<p>
|
||||
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed nonne merninisti licere mihi ista probare, quae sunt a te dicta? Refert tamen, quo modo.
|
||||
</p>
|
||||
<div
|
||||
class="ant-divider ant-divider-horizontal ant-divider-with-text-right"
|
||||
>
|
||||
<span
|
||||
class="ant-divider-inner-text"
|
||||
>
|
||||
Right Text
|
||||
</span>
|
||||
</div>
|
||||
<p>
|
||||
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed nonne merninisti licere mihi ista probare, quae sunt a te dicta? Refert tamen, quo modo.
|
||||
</p>
|
||||
</div>
|
||||
`;
|
||||
|
29
components/divider/demo/customize-style.md
Normal file
29
components/divider/demo/customize-style.md
Normal file
@ -0,0 +1,29 @@
|
||||
---
|
||||
order: 9999
|
||||
title:
|
||||
zh-CN: 样式自定义
|
||||
en-US: Style Customization
|
||||
debug: true
|
||||
---
|
||||
|
||||
## zh-CN
|
||||
|
||||
测试一些 `style` 修改样式的行为。
|
||||
|
||||
## en-US
|
||||
|
||||
Use `style` to change default style.
|
||||
|
||||
```jsx
|
||||
import { Divider } from 'antd';
|
||||
|
||||
ReactDOM.render(
|
||||
<div>
|
||||
<Divider style={{ height: 2, backgroundColor: '#7cb305' }} />
|
||||
<Divider style={{ borderColor: '#7cb305' }} dashed />
|
||||
<Divider type="vertical" style={{ height: 60, backgroundColor: '#7cb305' }} />
|
||||
<Divider type="vertical" style={{ height: 60, borderColor: '#7cb305' }} dashed />
|
||||
</div>,
|
||||
mountNode,
|
||||
);
|
||||
```
|
@ -27,11 +27,6 @@ ReactDOM.render(
|
||||
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed nonne merninisti licere mihi ista
|
||||
probare, quae sunt a te dicta? Refert tamen, quo modo.
|
||||
</p>
|
||||
<Divider>With Text</Divider>
|
||||
<p>
|
||||
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed nonne merninisti licere mihi ista
|
||||
probare, quae sunt a te dicta? Refert tamen, quo modo.
|
||||
</p>
|
||||
<Divider dashed />
|
||||
<p>
|
||||
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed nonne merninisti licere mihi ista
|
||||
|
@ -1,5 +1,5 @@
|
||||
---
|
||||
order: 1
|
||||
order: 2
|
||||
title:
|
||||
zh-CN: 垂直分割线
|
||||
en-US: Vertical
|
||||
|
@ -1,23 +1,32 @@
|
||||
---
|
||||
order: 2
|
||||
order: 1
|
||||
title:
|
||||
zh-CN: 标题位置
|
||||
en-US: Orientation of title
|
||||
zh-CN: 带文字的分割线
|
||||
en-US: Divider with title
|
||||
---
|
||||
|
||||
## zh-CN
|
||||
|
||||
修改分割线标题的位置。
|
||||
分割线中带有文字,可以用 `orientation` 指定文字位置。
|
||||
|
||||
## en-US
|
||||
|
||||
Set `orientation="left/right"` to align the inner text.
|
||||
Divider with inner title, set `orientation="left/right"` to align it.
|
||||
|
||||
```jsx
|
||||
import { Divider } from 'antd';
|
||||
|
||||
ReactDOM.render(
|
||||
<div>
|
||||
<p>
|
||||
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed nonne merninisti licere mihi ista
|
||||
probare, quae sunt a te dicta? Refert tamen, quo modo.
|
||||
</p>
|
||||
<Divider>Text</Divider>
|
||||
<p>
|
||||
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed nonne merninisti licere mihi ista
|
||||
probare, quae sunt a te dicta? Refert tamen, quo modo.
|
||||
</p>
|
||||
<Divider orientation="left">Left Text</Divider>
|
||||
<p>
|
||||
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed nonne merninisti licere mihi ista
|
@ -88,8 +88,11 @@
|
||||
|
||||
&-dashed {
|
||||
background: none;
|
||||
border-top: 1px dashed @border-color-split;
|
||||
border-color: @border-color-split;
|
||||
border-style: dashed;
|
||||
border-width: 1px 0 0;
|
||||
}
|
||||
|
||||
&-horizontal&-with-text-center&-dashed,
|
||||
&-horizontal&-with-text-left&-dashed,
|
||||
&-horizontal&-with-text-right&-dashed {
|
||||
@ -99,4 +102,8 @@
|
||||
border-style: dashed none none;
|
||||
}
|
||||
}
|
||||
|
||||
&-vertical&-dashed {
|
||||
border-width: 0 0 0 1px;
|
||||
}
|
||||
}
|
||||
|
@ -11,7 +11,7 @@ title:
|
||||
|
||||
## en-US
|
||||
|
||||
Input type of password.
|
||||
Input box with the remove icon, click the icon to delete everything.
|
||||
|
||||
```jsx
|
||||
import { Input } from 'antd';
|
||||
|
@ -82,6 +82,7 @@
|
||||
min-height: @input-height-base;
|
||||
vertical-align: bottom;
|
||||
transition: all 0.3s, height 0s;
|
||||
line-height: @line-height-base;
|
||||
}
|
||||
|
||||
// Size
|
||||
|
@ -15,6 +15,7 @@ export default {
|
||||
filterReset: 'Сбросить',
|
||||
selectAll: 'Выбрать всё',
|
||||
selectInvert: 'Инвертировать выбор',
|
||||
sortTitle: 'Сортировка',
|
||||
},
|
||||
Modal: {
|
||||
okText: 'OK',
|
||||
@ -39,4 +40,13 @@ export default {
|
||||
Empty: {
|
||||
description: 'Нет данных',
|
||||
},
|
||||
Text: {
|
||||
edit: 'редактировать',
|
||||
copy: 'копировать',
|
||||
copied: 'скопировано',
|
||||
expand: 'раскрыть',
|
||||
},
|
||||
PageHeader: {
|
||||
back: 'назад',
|
||||
},
|
||||
};
|
||||
|
@ -11,9 +11,9 @@
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
height: auto;
|
||||
white-space: pre-wrap;
|
||||
padding: 0;
|
||||
overflow: hidden;
|
||||
white-space: pre-wrap;
|
||||
vertical-align: bottom;
|
||||
|
||||
// =================== Status ===================
|
||||
@ -107,6 +107,7 @@
|
||||
&-item {
|
||||
position: relative;
|
||||
display: block;
|
||||
min-width: 100px;
|
||||
padding: 5px @control-padding-horizontal;
|
||||
overflow: hidden;
|
||||
color: @text-color;
|
||||
@ -115,7 +116,6 @@
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
cursor: pointer;
|
||||
min-width: 100px;
|
||||
transition: background 0.3s ease;
|
||||
|
||||
&:hover {
|
||||
|
@ -190,13 +190,17 @@ export default class Modal extends React.Component<ModalProps, {}> {
|
||||
);
|
||||
};
|
||||
|
||||
renderModal = ({ getPrefixCls }: ConfigConsumerProps) => {
|
||||
renderModal = ({
|
||||
getPopupContainer: getContextPopupContainer,
|
||||
getPrefixCls,
|
||||
}: ConfigConsumerProps) => {
|
||||
const {
|
||||
prefixCls: customizePrefixCls,
|
||||
footer,
|
||||
visible,
|
||||
wrapClassName,
|
||||
centered,
|
||||
getContainer,
|
||||
...restProps
|
||||
} = this.props;
|
||||
|
||||
@ -216,6 +220,7 @@ export default class Modal extends React.Component<ModalProps, {}> {
|
||||
return (
|
||||
<Dialog
|
||||
{...restProps}
|
||||
getContainer={getContainer || getContextPopupContainer}
|
||||
prefixCls={prefixCls}
|
||||
wrapClassName={classNames({ [`${prefixCls}-centered`]: !!centered }, wrapClassName)}
|
||||
footer={footer === undefined ? defaultFooter : footer}
|
||||
|
@ -59,7 +59,7 @@ The items listed above are all functions, expecting a settings object as paramet
|
||||
| Property | Description | Type | Default |
|
||||
| --- | --- | --- | --- |
|
||||
| autoFocusButton | Specify which button to autofocus | null\|string: `ok` `cancel` | `ok` |
|
||||
| cancelText | Text of the Cancel button | string | `Cancel` |
|
||||
| cancelText | Text of the Cancel button with Modal.confirm | string | `Cancel` |
|
||||
| centered | Centered Modal | Boolean | `false` |
|
||||
| className | className of container | string | - |
|
||||
| content | Content | string\|ReactNode | - |
|
||||
|
@ -63,7 +63,7 @@ title: Modal
|
||||
| 参数 | 说明 | 类型 | 默认值 |
|
||||
| --- | --- | --- | --- |
|
||||
| autoFocusButton | 指定自动获得焦点的按钮 | null\|string: `ok` `cancel` | `ok` |
|
||||
| cancelText | 取消按钮文字 | string | 取消 |
|
||||
| cancelText | 设置 Modal.confirm 取消按钮文字 | string | 取消 |
|
||||
| centered | 垂直居中展示 Modal | Boolean | `false` |
|
||||
| className | 容器类名 | string | - |
|
||||
| content | 内容 | string\|ReactNode | 无 |
|
||||
|
@ -19,11 +19,10 @@
|
||||
padding: 4px 0;
|
||||
font-size: 16px;
|
||||
line-height: 100%;
|
||||
cursor: pointer;
|
||||
&-button {
|
||||
.operation-unit();
|
||||
|
||||
color: @text-color;
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -620,4 +620,70 @@ describe('Table.filter', () => {
|
||||
.simulate('click');
|
||||
expect(wrapper.find('.ant-input').instance().value).toBe('');
|
||||
});
|
||||
|
||||
// https://github.com/ant-design/ant-design/issues/17089
|
||||
it('not crash when dynamic change filter', () => {
|
||||
const onChange = jest.fn();
|
||||
|
||||
const Test = ({ filters }) => (
|
||||
<Table
|
||||
onChange={onChange}
|
||||
columns={[
|
||||
{
|
||||
title: 'Name',
|
||||
dataIndex: 'name',
|
||||
filters,
|
||||
onFilter: (value, record) => {
|
||||
return record.name.indexOf(value) === 0;
|
||||
},
|
||||
sorter: (a, b) => a.name.length - b.name.length,
|
||||
sortDirections: ['descend'],
|
||||
},
|
||||
]}
|
||||
dataSource={[
|
||||
{
|
||||
name: 'Jack',
|
||||
},
|
||||
]}
|
||||
/>
|
||||
);
|
||||
|
||||
const wrapper = mount(
|
||||
<Test
|
||||
filters={[
|
||||
{
|
||||
text: 'Bill',
|
||||
value: 'Bill',
|
||||
},
|
||||
]}
|
||||
/>,
|
||||
);
|
||||
|
||||
const dropdownWrapper = getDropdownWrapper(wrapper);
|
||||
dropdownWrapper
|
||||
.find('MenuItem')
|
||||
.first()
|
||||
.simulate('click');
|
||||
dropdownWrapper.find('.confirm').simulate('click');
|
||||
expect(onChange).toHaveBeenCalled();
|
||||
onChange.mockReset();
|
||||
expect(onChange).not.toHaveBeenCalled();
|
||||
|
||||
wrapper.setProps({
|
||||
filters: [
|
||||
{
|
||||
text: 'Jim',
|
||||
value: 'Jim',
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
const dropdownWrapper2 = getDropdownWrapper(wrapper);
|
||||
dropdownWrapper2
|
||||
.find('MenuItem')
|
||||
.first()
|
||||
.simulate('click');
|
||||
dropdownWrapper2.find('.confirm').simulate('click');
|
||||
expect(onChange).toHaveBeenCalled();
|
||||
});
|
||||
});
|
||||
|
@ -144,7 +144,9 @@ class FilterMenu<T> extends React.Component<FilterMenuProps<T>, FilterMenuState<
|
||||
if (!shallowequal(selectedKeys, this.props.selectedKeys)) {
|
||||
this.props.confirmFilter(
|
||||
this.props.column,
|
||||
filterDropdown ? selectedKeys : selectedKeys.map(key => valueKeys[key]),
|
||||
filterDropdown
|
||||
? selectedKeys
|
||||
: selectedKeys.map(key => valueKeys[key]).filter(key => key !== undefined),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -15,7 +15,7 @@ Use `react-dnd` to make tabs draggable.
|
||||
|
||||
```jsx
|
||||
import { Tabs } from 'antd';
|
||||
import { DragDropContextProvider, DragSource, DropTarget } from 'react-dnd';
|
||||
import { DndProvider, DragSource, DropTarget } from 'react-dnd';
|
||||
import HTML5Backend from 'react-dnd-html5-backend';
|
||||
|
||||
const { TabPane } = Tabs;
|
||||
@ -127,11 +127,11 @@ class DraggableTabs extends React.Component {
|
||||
});
|
||||
|
||||
return (
|
||||
<DragDropContextProvider backend={HTML5Backend}>
|
||||
<DndProvider backend={HTML5Backend}>
|
||||
<Tabs renderTabBar={this.renderTabBar} {...this.props}>
|
||||
{orderTabs}
|
||||
</Tabs>
|
||||
</DragDropContextProvider>
|
||||
</DndProvider>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "antd",
|
||||
"version": "3.19.3",
|
||||
"version": "3.19.6",
|
||||
"title": "Ant Design",
|
||||
"description": "An enterprise-class UI design language and React components implementation",
|
||||
"homepage": "http://ant.design/",
|
||||
@ -128,7 +128,7 @@
|
||||
"enzyme-to-json": "^3.3.5",
|
||||
"eslint": "^5.16.0",
|
||||
"eslint-config-airbnb": "^17.1.0",
|
||||
"eslint-config-prettier": "^4.3.0",
|
||||
"eslint-config-prettier": "^5.0.0",
|
||||
"eslint-plugin-babel": "^5.3.0",
|
||||
"eslint-plugin-import": "^2.17.3",
|
||||
"eslint-plugin-jest": "^22.6.4",
|
||||
@ -161,8 +161,8 @@
|
||||
"react": "^16.5.2",
|
||||
"react-color": "^2.17.3",
|
||||
"react-copy-to-clipboard": "^5.0.1",
|
||||
"react-dnd": "^7.4.5",
|
||||
"react-dnd-html5-backend": "^7.4.4",
|
||||
"react-dnd": "^8.0.0",
|
||||
"react-dnd-html5-backend": "^8.0.0",
|
||||
"react-document-title": "^2.0.3",
|
||||
"react-dom": "^16.5.2",
|
||||
"react-github-button": "^0.1.11",
|
||||
|
@ -43,7 +43,7 @@ async function checkCommit({ files }) {
|
||||
async function checkRemote() {
|
||||
const { remote } = await git.fetch('origin', 'master');
|
||||
if (remote.indexOf('ant-design/ant-design') === -1) {
|
||||
console.log(chalk.yellow('😓 Your remote origin is not ant-design. Do you fork it?'));
|
||||
console.log(chalk.yellow('😓 Your remote origin is not ant-design/ant-design, did you fork it?'));
|
||||
exitProcess();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user