Skip to content

Commit

Permalink
merge master
Browse files Browse the repository at this point in the history
  • Loading branch information
zombieJ committed Nov 4, 2019
2 parents 2144589 + 0189244 commit 5bf96bb
Show file tree
Hide file tree
Showing 25 changed files with 58 additions and 54 deletions.
6 changes: 0 additions & 6 deletions components/cascader/index.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,3 @@ interface Option {
| ------- | ------------ | ------- |
| blur() | remove focus | |
| focus() | get focus | |

<style>
.ant-cascader-picker {
width: 300px;
}
</style>
6 changes: 0 additions & 6 deletions components/cascader/index.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,4 @@ interface Option {
| blur() | 移除焦点 | |
| focus() | 获取焦点 | |

<style>
.ant-cascader-picker {
width: 300px;
}
</style>

> 注意,如果需要获得中国省市区数据,可以参考 [china-division](https://gist.github.com/afc163/7582f35654fd03d5be7009444345ea17)
2 changes: 2 additions & 0 deletions components/date-picker/WeekPicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ class WeekPicker extends React.Component<any, WeekPickerState> {
onBlur,
id,
suffixIcon,
defaultPickerValue,
} = this.props;

const prefixCls = getPrefixCls('calendar', customizePrefixCls);
Expand Down Expand Up @@ -170,6 +171,7 @@ class WeekPicker extends React.Component<any, WeekPickerState> {
showToday={false}
disabledDate={disabledDate}
renderFooter={this.renderFooter}
defaultValue={defaultPickerValue}
/>
);
const clearIcon =
Expand Down
1 change: 1 addition & 0 deletions components/date-picker/wrapPicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ export default function wrapPicker(Picker: React.ComponentClass<any>, pickerType
className={timePickerCls}
placeholder={locale.timePickerLocale.placeholder}
transitionName="slide-up"
onEsc={() => {}}
/>
) : null;

Expand Down
2 changes: 1 addition & 1 deletion components/input/__tests__/__snapshots__/demo.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -1980,7 +1980,7 @@ exports[`renders ./components/input/demo/textarea-resize.md correctly 1`] = `
class="ant-input"
rows="4"
>
autoSize 属性适用于 textarea 节点,并且只有高度会自动变化。另外 autoSize 可以设定为一个对象,指定最小行数和最大行数。autoSize 属性适用于 textarea 节点,并且只有高度会自动变化。另外 autoSize 可以设定为一个对象,指定最小行数和最大行数。autoSize 属性适用于 textarea 节点,并且只有高度会自动变化。另外 autoSize 可以设定为一个对象,指定最小行数和最大行数。autoSize 属性适用于 textarea 节点,并且只有高度会自动变化。另外 autoSize 可以设定为一个对象,指定最小行数和最大行数。autoSize 属性适用于 textarea 节点,并且只有高度会自动变化。另外 autoSize 可以设定为一个对象,指定最小行数和最大行数。autoSize 属性适用于 textarea 节点,并且只有高度会自动变化。另外 autoSize 可以设定为一个对象,指定最小行数和最大行数。autoSize 属性适用于 textarea 节点,并且只有高度会自动变化。另外 autoSize 可以设定为一个对象,指定最小行数和最大行数。ending
The autoSize property applies to textarea nodes, and only the height changes automatically. In addition, autoSize can be set to an object, specifying the minimum number of rows and the maximum number of rows. The autoSize property applies to textarea nodes, and only the height changes automatically. In addition, autoSize can be set to an object, specifying the minimum number of rows and the maximum number of rows.
</textarea>
</div>
`;
Expand Down
2 changes: 1 addition & 1 deletion components/input/demo/textarea-resize.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import { Input, Button } from 'antd';
const { TextArea } = Input;

const defaultValue =
'autoSize 属性适用于 textarea 节点,并且只有高度会自动变化。另外 autoSize 可以设定为一个对象,指定最小行数和最大行数。autoSize 属性适用于 textarea 节点,并且只有高度会自动变化。另外 autoSize 可以设定为一个对象,指定最小行数和最大行数。autoSize 属性适用于 textarea 节点,并且只有高度会自动变化。另外 autoSize 可以设定为一个对象,指定最小行数和最大行数。autoSize 属性适用于 textarea 节点,并且只有高度会自动变化。另外 autoSize 可以设定为一个对象,指定最小行数和最大行数。autoSize 属性适用于 textarea 节点,并且只有高度会自动变化。另外 autoSize 可以设定为一个对象,指定最小行数和最大行数。autoSize 属性适用于 textarea 节点,并且只有高度会自动变化。另外 autoSize 可以设定为一个对象,指定最小行数和最大行数。autoSize 属性适用于 textarea 节点,并且只有高度会自动变化。另外 autoSize 可以设定为一个对象,指定最小行数和最大行数。ending';
'The autoSize property applies to textarea nodes, and only the height changes automatically. In addition, autoSize can be set to an object, specifying the minimum number of rows and the maximum number of rows. The autoSize property applies to textarea nodes, and only the height changes automatically. In addition, autoSize can be set to an object, specifying the minimum number of rows and the maximum number of rows.';

class Demo extends React.Component {
state = {
Expand Down
4 changes: 2 additions & 2 deletions components/layout/index.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ The sidebar.

| Property | Description | Type | Default | Version |
| --- | --- | --- | --- | --- |
| breakpoint | [breakpoints](/components/grid#api) of the responsive layout | Enum { 'xs', 'sm', 'md', 'lg', 'xl', 'xxl' } | - | |
| breakpoint | [breakpoints](/components/grid#Col) of the responsive layout | Enum { 'xs', 'sm', 'md', 'lg', 'xl', 'xxl' } | - | |
| className | container className | string | - | |
| collapsed | to set the current status | boolean | - | |
| collapsedWidth | width of the collapsed sidebar, by setting to `0` a special trigger will appear | number | 80 | |
Expand All @@ -99,7 +99,7 @@ The sidebar.
| trigger | specify the customized trigger, set to null to hide the trigger | string\|ReactNode | - | |
| width | width of the sidebar | number\|string | 200 | |
| onCollapse | the callback function, executed by clicking the trigger or activating the responsive layout | (collapsed, type) => {} | - | |
| onBreakpoint | the callback function, executed when [breakpoints](/components/grid#api) changed | (broken) => {} | - | 3.7.0 |
| onBreakpoint | the callback function, executed when [breakpoints](/components/grid#API) changed | (broken) => {} | - | 3.7.0 |
| zeroWidthTriggerStyle | to customize the styles of the special trigger that appears when `collapsedWidth` is 0 | object | - | 3.24.0 |

#### breakpoint width
Expand Down
4 changes: 2 additions & 2 deletions components/layout/index.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ title: Layout

| 参数 | 说明 | 类型 | 默认值 | 版本 |
| --- | --- | --- | --- | --- |
| breakpoint | 触发响应式布局的[断点](/components/grid#api) | Enum { 'xs', 'sm', 'md', 'lg', 'xl', 'xxl' } | - | |
| breakpoint | 触发响应式布局的[断点](/components/grid-cn/#Col) | Enum { 'xs', 'sm', 'md', 'lg', 'xl', 'xxl' } | - | |
| className | 容器 className | string | - | |
| collapsed | 当前收起状态 | boolean | - | |
| collapsedWidth | 收缩宽度,设置为 0 会出现特殊 trigger | number | 80 | |
Expand All @@ -100,7 +100,7 @@ title: Layout
| trigger | 自定义 trigger,设置为 null 时隐藏 trigger | string\|ReactNode | - | |
| width | 宽度 | number\|string | 200 | |
| onCollapse | 展开-收起时的回调函数,有点击 trigger 以及响应式反馈两种方式可以触发 | (collapsed, type) => {} | - | |
| onBreakpoint | 触发响应式布局[断点](/components/grid#api)时的回调 | (broken) => {} | - | 3.7.0 |
| onBreakpoint | 触发响应式布局[断点](/components/grid#API)时的回调 | (broken) => {} | - | 3.7.0 |
| zeroWidthTriggerStyle | 指定当 `collapsedWidth` 为 0 时出现的特殊 trigger 的样式 | object | - | 3.24.0 |

#### breakpoint width
Expand Down
2 changes: 1 addition & 1 deletion components/menu/style/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@

// disable margin collapsed
.@{menu-prefix-cls}-submenu {
padding-bottom: 0.01px;
padding-bottom: 0.02px;
}

.@{menu-prefix-cls}-item:not(:last-child) {
Expand Down
4 changes: 0 additions & 4 deletions components/select/style/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -382,10 +382,6 @@
}
}

&-allow-clear &-selection--single &-selection-selected-value {
padding-right: 16px;
}

&-allow-clear &-selection--multiple &-selection__rendered,
&-show-arrow &-selection--multiple &-selection__rendered {
margin-right: 20px; // In case that clear button will overlap content
Expand Down
10 changes: 4 additions & 6 deletions components/slider/__tests__/__snapshots__/demo.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -1032,11 +1032,9 @@ exports[`renders ./components/slider/demo/tip-formatter.md correctly 1`] = `
`;

exports[`renders ./components/slider/demo/vertical.md correctly 1`] = `
<div
style="height:300px"
>
<div>
<div
style="float:left;height:300px;margin-left:70px"
style="display:inline-block;height:300px;margin-left:70px"
>
<div
class="ant-slider ant-slider-vertical"
Expand Down Expand Up @@ -1067,7 +1065,7 @@ exports[`renders ./components/slider/demo/vertical.md correctly 1`] = `
</div>
</div>
<div
style="float:left;height:300px;margin-left:70px"
style="display:inline-block;height:300px;margin-left:70px"
>
<div
class="ant-slider ant-slider-vertical"
Expand Down Expand Up @@ -1108,7 +1106,7 @@ exports[`renders ./components/slider/demo/vertical.md correctly 1`] = `
</div>
</div>
<div
style="float:left;height:300px;margin-left:70px"
style="display:inline-block;height:300px;margin-left:70px"
>
<div
class="ant-slider ant-slider-with-marks ant-slider-vertical"
Expand Down
4 changes: 2 additions & 2 deletions components/slider/demo/vertical.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ The vertical Slider.
import { Slider } from 'antd';

const style = {
float: 'left',
display: 'inline-block',
height: 300,
marginLeft: 70,
};
Expand All @@ -35,7 +35,7 @@ const marks = {
};

ReactDOM.render(
<div style={{ height: 300 }}>
<div>
<div style={style}>
<Slider vertical defaultValue={30} />
</div>
Expand Down
6 changes: 3 additions & 3 deletions components/table/Table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -807,7 +807,7 @@ class Table<T> extends React.Component<InternalTableProps<T>, TableState<T>> {
current: this.state.pagination.current,
};
}
this.setState(newState, () => this.scrollToFirstRow());
this.setState(newState, this.scrollToFirstRow);

this.props.store.setState({
selectionDirty: false,
Expand All @@ -834,7 +834,7 @@ class Table<T> extends React.Component<InternalTableProps<T>, TableState<T>> {
pageSize,
current,
};
this.setState({ pagination: nextPagination });
this.setState({ pagination: nextPagination }, this.scrollToFirstRow);

const { onChange } = this.props;
if (onChange) {
Expand Down Expand Up @@ -878,7 +878,7 @@ class Table<T> extends React.Component<InternalTableProps<T>, TableState<T>> {

// Controlled
if (this.getSortOrderColumns().length === 0) {
this.setState(newState, () => this.scrollToFirstRow());
this.setState(newState, this.scrollToFirstRow);
}

const { onChange } = this.props;
Expand Down
22 changes: 20 additions & 2 deletions components/table/__tests__/Table.pagination.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,14 +79,32 @@ describe('Table.pagination', () => {
expect(wrapper.find('.ant-pagination.mini')).toHaveLength(1);
});

// TODO
it('should scroll to first row when page change', () => {
const wrapper = mount(createTable({ scroll: { y: 20 } }));
const wrapper = mount(
createTable({ scroll: { y: 20 }, pagination: { showSizeChanger: true, pageSize: 2 } }),
);
const scrollToSpy = jest.spyOn(
wrapper
.find('Table')
.first()
.instance(),
'scrollToFirstRow',
);
expect(scrollToSpy).toHaveBeenCalledTimes(0);

wrapper
.find('Pager')
.last()
.simulate('click');
expect(scrollToSpy).toHaveBeenCalledTimes(1);

wrapper.find('.ant-select').simulate('click');
wrapper
.find('MenuItem')
.find('li')
.last()
.simulate('click');
expect(scrollToSpy).toHaveBeenCalledTimes(2);
});

it('fires change event', () => {
Expand Down
4 changes: 2 additions & 2 deletions components/table/demo/fixed-columns-header.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ title:

适合同时展示有大量数据和数据列。

> 若列头与内容不对齐或出现列重复,请指定**固定列**的宽度 `width`。如果指定 `width` 不生效,请尝试建议留一列不设宽度以适应弹性布局,或者检查是否有[超长连续字段破坏布局](https://github.com/ant-design/ant-design/issues/13825#issuecomment-449889241)
> 若列头与内容不对齐或出现列重复,请指定**固定列**的宽度 `width`。如果指定 `width` 不生效或出现白色垂直空隙,请尝试建议留一列不设宽度以适应弹性布局,或者检查是否有[超长连续字段破坏布局](https://github.com/ant-design/ant-design/issues/13825#issuecomment-449889241)
>
> 建议指定 `scroll.x` 为大于表格宽度的固定值或百分比。注意,且非固定列宽度之和不要超过 `scroll.x`
## en-US

A Solution for displaying large amounts of data with long columns.

> Specify the width of columns if header and cell do not align properly. If specified width is not working, please try to leave one column at least without width to fit fluid layout, or make sure no [long word to break table layout](https://github.com/ant-design/ant-design/issues/13825#issuecomment-449889241).
> Specify the width of columns if header and cell do not align properly. If specified width is not working or have gutter between columns, please try to leave one column at least without width to fit fluid layout, or make sure no [long word to break table layout](https://github.com/ant-design/ant-design/issues/13825#issuecomment-449889241).
>
> A fixed value which is greater than table width for `scroll.x` is recommended. The sum of unfixed columns should not greater than `scroll.x`.
Expand Down
4 changes: 2 additions & 2 deletions components/table/demo/fixed-columns.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ title:

对于列数很多的数据,可以固定前后的列,横向滚动查看其它数据,需要和 `scroll.x` 配合使用。

> 若列头与内容不对齐或出现列重复,请指定**固定列**的宽度 `width`。如果指定 `width` 不生效,请尝试建议留一列不设宽度以适应弹性布局,或者检查是否有[超长连续字段破坏布局](https://github.com/ant-design/ant-design/issues/13825#issuecomment-449889241)
> 若列头与内容不对齐或出现列重复,请指定**固定列**的宽度 `width`。如果指定 `width` 不生效或出现白色垂直空隙,请尝试建议留一列不设宽度以适应弹性布局,或者检查是否有[超长连续字段破坏布局](https://github.com/ant-design/ant-design/issues/13825#issuecomment-449889241)
>
> 建议指定 `scroll.x` 为大于表格宽度的固定值或百分比。注意,且非固定列宽度之和不要超过 `scroll.x`
## en-US

To fix some columns and scroll inside other columns, and you must set `scroll.x` meanwhile.

> Specify the width of columns if header and cell do not align properly. If specified width is not working, please try to leave one column at least without width to fit fluid layout, or make sure no [long word to break table layout](https://github.com/ant-design/ant-design/issues/13825#issuecomment-449889241).
> Specify the width of columns if header and cell do not align properly. If specified width is not working or have gutter between columns, please try to leave one column at least without width to fit fluid layout, or make sure no [long word to break table layout](https://github.com/ant-design/ant-design/issues/13825#issuecomment-449889241).
>
> A fixed value which is greater than table width for `scroll.x` is recommended. The sum of unfixed columns should not greater than `scroll.x`.
Expand Down
4 changes: 2 additions & 2 deletions components/table/demo/fixed-header.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ title:

方便一页内展示大量数据。

需要指定 column 的 `width` 属性,否则列头和内容可能不对齐。如果指定 `width` 不生效,请尝试建议留一列不设宽度以适应弹性布局,或者检查是否有[超长连续字段破坏布局](https://github.com/ant-design/ant-design/issues/13825#issuecomment-449889241)
需要指定 column 的 `width` 属性,否则列头和内容可能不对齐。如果指定 `width` 不生效或出现白色垂直空隙,请尝试建议留一列不设宽度以适应弹性布局,或者检查是否有[超长连续字段破坏布局](https://github.com/ant-design/ant-design/issues/13825#issuecomment-449889241)

## en-US

Display large amounts of data in scrollable view.

> Specify width of columns if header and cell do not align properly. If specified width is not working, please try to leave one column at least without width to fit fluid layout, or make sure no [long word to break table layout](https://github.com/ant-design/ant-design/issues/13825#issuecomment-449889241).
> Specify width of columns if header and cell do not align properly. If specified width is not working or have gutter between columns, please try to leave one column at least without width to fit fluid layout, or make sure no [long word to break table layout](https://github.com/ant-design/ant-design/issues/13825#issuecomment-449889241).
```jsx
import { Table } from 'antd';
Expand Down
12 changes: 6 additions & 6 deletions components/tree-select/__tests__/__snapshots__/demo.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ exports[`renders ./components/tree-select/demo/async.md correctly 1`] = `
aria-haspopup="listbox"
class="ant-select ant-select-enabled"
role="combobox"
style="width:300px"
style="width:100%"
tabindex="0"
>
<span
Expand Down Expand Up @@ -53,7 +53,7 @@ exports[`renders ./components/tree-select/demo/basic.md correctly 1`] = `
aria-haspopup="listbox"
class="ant-select ant-select-enabled ant-select-allow-clear"
role="combobox"
style="width:300px"
style="width:100%"
tabindex="0"
>
<span
Expand Down Expand Up @@ -101,7 +101,7 @@ exports[`renders ./components/tree-select/demo/checkable.md correctly 1`] = `
aria-haspopup="listbox"
class="ant-select ant-select-enabled"
role="combobox"
style="width:300px"
style="width:100%"
tabindex="-1"
>
<span
Expand Down Expand Up @@ -184,7 +184,7 @@ exports[`renders ./components/tree-select/demo/multiple.md correctly 1`] = `
aria-haspopup="listbox"
class="ant-select ant-select-enabled ant-select-allow-clear"
role="combobox"
style="width:300px"
style="width:100%"
tabindex="-1"
>
<span
Expand Down Expand Up @@ -231,7 +231,7 @@ exports[`renders ./components/tree-select/demo/suffix.md correctly 1`] = `
aria-haspopup="listbox"
class="ant-select ant-select-enabled ant-select-allow-clear"
role="combobox"
style="width:300px"
style="width:100%"
tabindex="0"
>
<span
Expand Down Expand Up @@ -279,7 +279,7 @@ exports[`renders ./components/tree-select/demo/treeData.md correctly 1`] = `
aria-haspopup="listbox"
class="ant-select ant-select-enabled"
role="combobox"
style="width:300px"
style="width:100%"
tabindex="0"
>
<span
Expand Down
2 changes: 1 addition & 1 deletion components/tree-select/demo/async.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class Demo extends React.Component {
return (
<TreeSelect
treeDataSimpleMode
style={{ width: 300 }}
style={{ width: '100%' }}
value={this.state.value}
dropdownStyle={{ maxHeight: 400, overflow: 'auto' }}
placeholder="Please select"
Expand Down
2 changes: 1 addition & 1 deletion components/tree-select/demo/basic.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class Demo extends React.Component {
return (
<TreeSelect
showSearch
style={{ width: 300 }}
style={{ width: '100%' }}
value={this.state.value}
dropdownStyle={{ maxHeight: 400, overflow: 'auto' }}
placeholder="Please select"
Expand Down
2 changes: 1 addition & 1 deletion components/tree-select/demo/checkable.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ class Demo extends React.Component {
showCheckedStrategy: SHOW_PARENT,
searchPlaceholder: 'Please select',
style: {
width: 300,
width: '100%',
},
};
return <TreeSelect {...tProps} />;
Expand Down
2 changes: 1 addition & 1 deletion components/tree-select/demo/multiple.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class Demo extends React.Component {
return (
<TreeSelect
showSearch
style={{ width: 300 }}
style={{ width: '100%' }}
value={this.state.value}
dropdownStyle={{ maxHeight: 400, overflow: 'auto' }}
placeholder="Please select"
Expand Down
2 changes: 1 addition & 1 deletion components/tree-select/demo/suffix.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class Demo extends React.Component {
<TreeSelect
showSearch
suffixIcon={icon}
style={{ width: 300 }}
style={{ width: '100%' }}
value={this.state.value}
dropdownStyle={{ maxHeight: 400, overflow: 'auto' }}
placeholder="Please select"
Expand Down
2 changes: 1 addition & 1 deletion components/tree-select/demo/treeData.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class Demo extends React.Component {
render() {
return (
<TreeSelect
style={{ width: 300 }}
style={{ width: '100%' }}
value={this.state.value}
dropdownStyle={{ maxHeight: 400, overflow: 'auto' }}
treeData={treeData}
Expand Down
1 change: 1 addition & 0 deletions components/upload/interface.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ export interface UploadFile<T = any> {
linkProps?: any;
type: string;
xhr?: T;
preview?: string;
}

export interface UploadChangeParam<T extends object = UploadFile> {
Expand Down

0 comments on commit 5bf96bb

Please sign in to comment.