Skip to content

Commit

Permalink
Merge branch 'master' into feature
Browse files Browse the repository at this point in the history
  • Loading branch information
chenshuai2144 committed Jun 19, 2019
2 parents 6a10951 + 5f816ba commit d0799fb
Show file tree
Hide file tree
Showing 29 changed files with 321 additions and 83 deletions.
2 changes: 1 addition & 1 deletion .jest.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
3 changes: 3 additions & 0 deletions .jest.node.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
const { transformIgnorePatterns } = require('./.jest');

// jest config for server render environment
module.exports = {
setupFiles: ['./tests/setup.js'],
Expand All @@ -10,6 +12,7 @@ module.exports = {
},
testRegex: 'demo\\.test\\.js$',
testEnvironment: 'node',
transformIgnorePatterns,
snapshotSerializers: ['enzyme-to-json/serializer'],
globals: {
'ts-jest': {
Expand Down
40 changes: 38 additions & 2 deletions CHANGELOG.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand All @@ -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)
Expand Down
37 changes: 37 additions & 0 deletions CHANGELOG.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down
8 changes: 7 additions & 1 deletion components/affix/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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>
);
Expand Down
20 changes: 11 additions & 9 deletions components/badge/ScrollNumber.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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++) {
Expand Down
2 changes: 1 addition & 1 deletion components/card/style/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@
padding-bottom: 0;
}

&-contain-tabs &-extra {
&-contain-tabs > &-head &-extra {
padding-bottom: 0;
}

Expand Down
4 changes: 4 additions & 0 deletions components/date-picker/style/Picker.less
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@

&-input {
outline: none;

&.@{ant-prefix}-input {
line-height: @line-height-base;
}
}

&-input.@{ant-prefix}-input-sm {
Expand Down
11 changes: 5 additions & 6 deletions components/descriptions/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
} = {
Expand Down Expand Up @@ -251,6 +252,4 @@ class Descriptions extends React.Component<
}
}

Descriptions.Item = DescriptionsItem;

export default Descriptions;
4 changes: 4 additions & 0 deletions components/descriptions/style/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
border-radius: @border-radius-base;
table {
width: 100%;
table-layout: fixed;
}
}

Expand Down Expand Up @@ -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 {
Expand Down
92 changes: 58 additions & 34 deletions components/divider/__tests__/__snapshots__/demo.test.js.snap
Original file line number Diff line number Diff line change
@@ -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>
Expand All @@ -8,6 +29,42 @@ exports[`renders ./components/divider/demo/horizontal.md correctly 1`] = `
<div
class="ant-divider ant-divider-horizontal"
/>
<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"
/>
<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
<div
class="ant-divider ant-divider-vertical"
/>
<a
href="#"
>
Link
</a>
<div
class="ant-divider ant-divider-vertical"
/>
<a
href="#"
>
Link
</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>
Expand All @@ -17,23 +74,12 @@ exports[`renders ./components/divider/demo/horizontal.md correctly 1`] = `
<span
class="ant-divider-inner-text"
>
With 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-dashed"
/>
<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/orientation.md correctly 1`] = `
<div>
<div
class="ant-divider ant-divider-horizontal ant-divider-with-text-left"
>
Expand All @@ -60,25 +106,3 @@ exports[`renders ./components/divider/demo/orientation.md correctly 1`] = `
</p>
</div>
`;

exports[`renders ./components/divider/demo/vertical.md correctly 1`] = `
<div>
Text
<div
class="ant-divider ant-divider-vertical"
/>
<a
href="#"
>
Link
</a>
<div
class="ant-divider ant-divider-vertical"
/>
<a
href="#"
>
Link
</a>
</div>
`;
29 changes: 29 additions & 0 deletions components/divider/demo/customize-style.md
Original file line number Diff line number Diff line change
@@ -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,
);
```

0 comments on commit d0799fb

Please sign in to comment.