Skip to content

Commit

Permalink
temp(*): merge master
Browse files Browse the repository at this point in the history
  • Loading branch information
myronliu347 committed Mar 20, 2019
2 parents 277de7e + 7cfa4c3 commit 7ca109c
Show file tree
Hide file tree
Showing 95 changed files with 1,656 additions and 548 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Expand Up @@ -15,6 +15,7 @@ before_script:
script:
- npm run eslint
- npm run stylelint
- npm run test:a11y
- npm test
- codecov

Expand Down
65 changes: 65 additions & 0 deletions CHANGELOG.md
@@ -1,5 +1,70 @@
# Change Log

<a name="1.13.8"></a>
## [1.13.8](https://github.com/alibaba-fusion/next/compare/1.13.7...1.13.8) (2019-03-14)


### Bug Fixes

* **ConfigProvider:** config on components should take higher priority ([87917c8](https://github.com/alibaba-fusion/next/commit/87917c8))




<a name="1.13.7"></a>
## [1.13.7](https://github.com/alibaba-fusion/next/compare/1.13.6...1.13.7) (2019-03-13)


### Bug Fixes

* **Select:** css override fail when using theme ([5f80ead](https://github.com/alibaba-fusion/next/commit/5f80ead))




<a name="1.13.6"></a>
## [1.13.6](https://github.com/alibaba-fusion/next/compare/1.13.5...1.13.6) (2019-03-13)


### Bug Fixes

* **DatePicker:** disabledDate will auto disable month ([94276d2](https://github.com/alibaba-fusion/next/commit/94276d2))
* **Step:** labelPlacement value change dbl times ([3c7ae73](https://github.com/alibaba-fusion/next/commit/3c7ae73))
* **Tag:** close button not showing in select when text too long ([fd341f8](https://github.com/alibaba-fusion/next/commit/fd341f8))
* **Upload:** className not pass in ([cb33e75](https://github.com/alibaba-fusion/next/commit/cb33e75))
* **Upload:** drag upload no trigger onDrop ([5f58f29](https://github.com/alibaba-fusion/next/commit/5f58f29))
* **Upload:** fix setValue fail in onSuccess ([384c379](https://github.com/alibaba-fusion/next/commit/384c379))


### Features

* **ConfigProvider:** add ErrorBoundary ([ada2b5b](https://github.com/alibaba-fusion/next/commit/ada2b5b))
* **Range:** RTL feature of Range Component ([2127ee6](https://github.com/alibaba-fusion/next/commit/2127ee6))
* **Select:** can unselect all ([77077a2](https://github.com/alibaba-fusion/next/commit/77077a2))
* **Tab:** RTL feature of Tab ([142af04](https://github.com/alibaba-fusion/next/commit/142af04))


<a name="1.13.5"></a>
## [1.13.5](https://github.com/alibaba-fusion/next/compare/1.13.3...1.13.5) (2019-03-07)


### Bug Fixes

* **Collapse:** fix nested collapse icon ([7a6842a](https://github.com/alibaba-fusion/next/commit/7a6842a))
* **DatePicker:** date range picker select time error ([59eaa9c](https://github.com/alibaba-fusion/next/commit/59eaa9c))
* **Step:** step-item param of labelPlacement change update bug ([f0939af](https://github.com/alibaba-fusion/next/commit/f0939af))
* **Tab:** can't scroll when active item is inside view ([a8f4d18](https://github.com/alibaba-fusion/next/commit/a8f4d18))
* **Table:** extra lock columns when enough space && dataSource=[], close[#364](https://github.com/alibaba-fusion/next/issues/364) ([b9c2328](https://github.com/alibaba-fusion/next/commit/b9c2328))


### Features

* **NumberPicker:** consider [] as [.] ([8369b4a](https://github.com/alibaba-fusion/next/commit/8369b4a))
* **Upload:** add rtl support ([5505d6d](https://github.com/alibaba-fusion/next/commit/5505d6d))




<a name="1.13.4"></a>
## [1.13.4](https://github.com/alibaba-fusion/next/compare/1.13.3...1.13.4) (2019-02-28)

Expand Down
6 changes: 3 additions & 3 deletions LATESTLOG.md
@@ -1,10 +1,10 @@
# Latest Log

## [1.13.4](https://github.com/alibaba-fusion/next/compare/1.13.3...1.13.4) (2019-02-28)
## [1.13.8](https://github.com/alibaba-fusion/next/compare/1.13.7...1.13.8) (2019-03-14)


### Features
### Bug Fixes

* **NumberPicker:** consider [] as [.] ([8369b4a](https://github.com/alibaba-fusion/next/commit/8369b4a))
* **ConfigProvider:** config on components should take higher priority ([87917c8](https://github.com/alibaba-fusion/next/commit/87917c8))


6 changes: 3 additions & 3 deletions docs/balloon/index.md
Expand Up @@ -37,13 +37,13 @@
| align | 弹出层位置<br><br>**可选值**:<br>'t'(上)<br>'r'(右)<br>'b'(下)<br>'l'(左)<br>'tl'(上左)<br>'tr'(上右)<br>'bl'(下左)<br>'br'(下右)<br>'lt'(左上)<br>'lb'(左下)<br>'rt'(右上)<br>'rb'(右下 及其 两两组合) | Enum | 'b' |
| offset | 弹层相对于trigger的定位的微调 | Array | [0, 0] |
| trigger | 触发元素 | any | &lt;span /> |
| triggerType | 触发行为<br>鼠标悬浮, 鼠标点击('hover','click')或者它们组成的数组,如 ['hover', 'click'], 若弹窗内容有复杂交互请使用click | String/Array | 'hover' |
| triggerType | 触发行为<br>鼠标悬浮, 获取到焦点, 鼠标点击('hover','focus','click')或者它们组成的数组,如 ['hover', 'focus'] | String/Array | 'hover' |
| onClose | 任何visible为false时会触发的事件<br><br>**签名**:<br>Function() => void | Function | func.noop |
| needAdjust | 是否进行自动位置调整 | Boolean | false |
| delay | 弹层在触发以后的延时显示, 单位毫秒 ms | Number | - |
| afterClose | 浮层关闭后触发的事件, 如果有动画,则在动画结束后触发<br><br>**签名**:<br>Function() => void | Function | func.noop |
| shouldUpdatePosition | 强制更新定位信息 | Boolean | - |
| autoFocus | 弹层出现后是否自动focus到内部第一个元素 | Boolean | true |
| autoFocus | 弹层出现后是否自动focus到内部第一个元素 | Boolean | false |
| safeNode | 安全节点:对于triggetType为click的浮层,会在点击除了浮层外的其它区域时关闭浮层.safeNode用于添加不触发关闭的节点, 值可以是dom节点的id或者是节点的dom对象 | String | undefined |
| safeId | 用来指定safeNode节点的id,和safeNode配合使用 | String | null |
| animation | 配置动画的播放方式 | Object/Boolean | { in: 'zoomIn', out: 'zoomOut', } |
Expand All @@ -61,7 +61,7 @@
| children | tooltip的内容 | any | - |
| align | 弹出层位置<br><br>**可选值**:<br>'t'(上)<br>'r'(右)<br>'b'(下)<br>'l'(左)<br>'tl'(上左)<br>'tr'(上右)<br>'bl'(下左)<br>'br'(下右)<br>'lt'(左上)<br>'lb'(左下)<br>'rt'(右上)<br>'rb'(右下 及其 两两组合) | Enum | 'b' |
| trigger | 触发元素 | any | &lt;span /> |
| triggerType | 触发行为<br>鼠标悬浮, 鼠标点击('hover', 'click')或者它们组成的数组,如 ['hover', 'click'], 若有复杂交互,推荐使用`<Balloon triggerType="click">` | String/Array | 'hover' |
| triggerType | 触发行为<br>鼠标悬浮, 获取到焦点, 鼠标点击('hover','focus','click')或者它们组成的数组,如 ['hover', 'focus'] | String/Array | 'hover' |
| popupStyle | 弹层组件style,透传给Popup | Object | - |
| popupClassName | 弹层组件className,透传给Popup | String | - |
| popupProps | 弹层组件属性,透传给Popup | Object | - |
Expand Down
2 changes: 1 addition & 1 deletion docs/calendar/index.en-us.md
Expand Up @@ -40,5 +40,5 @@ moment.locale('zh-cn');
| onSelect | Callback when select a date <br><br>**signature**:<br>Function(value: Object) => void<br>**parameter**:<br>_value_: {Object} date object | Function | func.noop |
| dateCellRender | Render function for date cell<br><br>**signature**:<br>Function(value: Object) => ReactNode<br>**parameter**:<br>_value_: {Object} date object<br>**return**:<br>{ReactNode} null<br> | Function | (value) => value.date() |
| monthCellRender | Render function for month cell<br><br>**signature**:<br>Function(calendarDate: Object) => ReactNode<br>**parameter**:<br>_calendarDate_: {Object} current date object<br>**return**:<br>{ReactNode} null<br> | Function | - |
| disabledDate | Function to disable dates <br><br>**signature**:<br>Function(calendarDate: Object) => Boolean<br>**parameter**:<br>_calendarDate_: {Object} current date object<br>**return**:<br>{Boolean} null<br> | Function | - |
| disabledDate | Function to disable dates <br><br>**signature**:<br>Function(calendarDate: Object) => Boolean<br>**parameter**:<br>_calendarDate_: {Object} current date object<br>_view_: {Enum} current view type: 'year', 'month', 'date' <br>**return**:<br>{Boolean} null<br> | Function | - |

24 changes: 12 additions & 12 deletions docs/calendar/index.md
Expand Up @@ -29,15 +29,15 @@ moment.locale('zh-cn');

### Calendar

| 参数 | 说明 | 类型 | 默认值 |
| -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- | ----------------------- |
| defaultValue | 默认选中的日期(moment 对象) | custom | - |
| shape | 展现形态<br><br>**可选值**:<br>'card', 'fullscreen', 'panel' | Enum | 'fullscreen' |
| value | 选中的日期值 (moment 对象) | custom | - |
| showOtherMonth | 是否展示非本月的日期 | Boolean | true |
| defaultVisibleMonth | 默认展示的月份<br><br>**签名**:<br>Function() => void | Function | - |
| onSelect | 选择日期单元格时的回调<br><br>**签名**:<br>Function(value: Object) => void<br>**参数**:<br>_value_: {Object} 对应的日期值 (moment 对象) | Function | func.noop |
| onVisibleMonthChange | 展现的月份变化时的回调<br><br>**签名**:<br>Function(value: Object, reason: String) => void<br>**参数**:<br>_value_: {Object} 显示的月份 (moment 对象)<br>_reason_: {String} 触发月份改变原因 | Function | func.noop |
| dateCellRender | 自定义日期渲染函数<br><br>**签名**:<br>Function(value: Object) => ReactNode<br>**参数**:<br>_value_: {Object} 日期值(moment对象)<br>**返回值**:<br>{ReactNode} null<br> | Function | (value) => value.date() |
| monthCellRender | 自定义月份渲染函数<br><br>**签名**:<br>Function(calendarDate: Object) => ReactNode<br>**参数**:<br>_calendarDate_: {Object} 对应 Calendar 返回的自定义日期对象<br>**返回值**:<br>{ReactNode} null<br> | Function | - |
| disabledDate | 不可选择的日期<br><br>**签名**:<br>Function(calendarDate: Object) => Boolean<br>**参数**:<br>_calendarDate_: {Object} 对应 Calendar 返回的自定义日期对象<br>**返回值**:<br>{Boolean} null<br> | Function | - |
| 参数 | 说明 | 类型 | 默认值 |
| -------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- | --------------------- |
| defaultValue | 默认选中的日期(moment 对象) | custom | - |
| shape | 展现形态<br><br>**可选值**:<br>'card', 'fullscreen', 'panel' | Enum | 'fullscreen' |
| value | 选中的日期值 (moment 对象) | custom | - |
| showOtherMonth | 是否展示非本月的日期 | Boolean | true |
| defaultVisibleMonth | 默认展示的月份<br><br>**签名**:<br>Function() => void | Function | - |
| onSelect | 选择日期单元格时的回调<br><br>**签名**:<br>Function(value: Object) => void<br>**参数**:<br>_value_: {Object} 对应的日期值 (moment 对象) | Function | func.noop |
| onVisibleMonthChange | 展现的月份变化时的回调<br><br>**签名**:<br>Function(value: Object, reason: String) => void<br>**参数**:<br>_value_: {Object} 显示的月份 (moment 对象)<br>_reason_: {String} 触发月份改变原因 | Function | func.noop |
| dateCellRender | 自定义日期渲染函数<br><br>**签名**:<br>Function(value: Object) => ReactNode<br>**参数**:<br>_value_: {Object} 日期值(moment对象)<br>**返回值**:<br>{ReactNode} null<br> | Function | value => value.date() |
| monthCellRender | 自定义月份渲染函数<br><br>**签名**:<br>Function(calendarDate: Object) => ReactNode<br>**参数**:<br>_calendarDate_: {Object} 对应 Calendar 返回的自定义日期对象<br>**返回值**:<br>{ReactNode} null<br> | Function | - |
| disabledDate | 不可选择的日期<br><br>**签名**:<br>Function(calendarDate: Object, view: String) => Boolean<br>**参数**:<br>_calendarDate_: {Object} 对应 Calendar 返回的自定义日期对象<br>_view_: {String} 当前视图类型,year: 年, month: 月, date: 日<br>**返回值**:<br>{Boolean} null<br> | Function | - |
2 changes: 1 addition & 1 deletion docs/cascader-select/demo/accessibility.md
@@ -1,6 +1,6 @@
# 无障碍

- order: 8
- order: 9

请参考`ARIA and KeyBoard`

Expand Down
50 changes: 50 additions & 0 deletions docs/cascader-select/demo/custom.md
@@ -0,0 +1,50 @@
# 渲染 DataSource 中不存在的 value

- order: 8

---

```jsx
import { CascaderSelect } from '@alifd/next';
import 'whatwg-fetch';

class Demo extends React.Component {
constructor(props) {
super(props);

this.state = {
data: []
};

this.handleChange = this.handleChange.bind(this);
}

componentDidMount() {
fetch('https://os.alipayobjects.com/rmsportal/ODDwqcDFTLAguOvWEolX.json')
.then(response => response.json())
.then(data => {
data[1].disabled = true;
this.setState({ data });
})
.catch(e => console.log(e));
}

handleChange(value, data, extra) {
console.log(value, data, extra);
}

valueRender = (item) => {
if (item.label) {
return item.label; // 正常的item
}

// value在 dataSouce里不存在时渲染。
return item.value === '432988' ? '不存在的' : item.value;
};

render() {
return <CascaderSelect valueRender={this.valueRender} defaultValue="432988" style={{ width: '302px' }} dataSource={this.state.data} onChange={this.handleChange} />;
}
}
ReactDOM.render(<Demo />, mountNode)
```

0 comments on commit 7ca109c

Please sign in to comment.