Browse Source

clean up

pull/8993/merge
zombiej 7 years ago
parent
commit
c5f84c7902
  1. 10
      components/date-picker/WeekPicker.tsx
  2. 9
      components/date-picker/__tests__/WeekPicker.test.js
  3. 20
      components/date-picker/__tests__/__snapshots__/WeekPicker.test.js.snap
  4. 3
      components/tree/index.en-US.md
  5. 3
      components/tree/index.zh-CN.md
  6. 2
      package.json

10
components/date-picker/WeekPicker.tsx

@ -40,8 +40,8 @@ export default class WeekPicker extends React.Component<any, any> {
const selectedValue = this.state.value;
const { prefixCls } = this.props;
if (selectedValue &&
current.year() === selectedValue.year() &&
current.week() === selectedValue.week()) {
current.year() === selectedValue.year() &&
current.week() === selectedValue.week()) {
return (
<div className={`${prefixCls}-selected-day`}>
<div className={`${prefixCls}-date`}>
@ -84,6 +84,7 @@ export default class WeekPicker extends React.Component<any, any> {
const {
prefixCls, className, disabled, pickerClass, popupStyle,
pickerInputClass, format, allowClear, locale, localeCode, disabledDate,
style, onFocus, onBlur,
} = this.props;
const pickerValue = this.state.value;
@ -123,8 +124,9 @@ export default class WeekPicker extends React.Component<any, any> {
value={(value && value.format(format)) || ''}
placeholder={placeholder}
className={pickerInputClass}
onFocus={this.props.onFocus}
onBlur={this.props.onBlur}
onFocus={onFocus}
onBlur={onBlur}
style={style}
/>
{clearIcon}
<span className={`${prefixCls}-picker-icon`} />

9
components/date-picker/__tests__/WeekPicker.test.js

@ -1,3 +1,5 @@
import React from 'react';
import { mount } from 'enzyme';
import DatePicker from '..';
import focusTest from '../../../tests/shared/focusTest';
@ -5,4 +7,11 @@ const { WeekPicker } = DatePicker;
describe('WeekPicker', () => {
focusTest(WeekPicker);
it('should support style prop', () => {
const wrapper = mount(
<WeekPicker style={{ width: 400 }} />
);
expect(wrapper.render()).toMatchSnapshot();
});
});

20
components/date-picker/__tests__/__snapshots__/WeekPicker.test.js.snap

@ -0,0 +1,20 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`WeekPicker should support style prop 1`] = `
<span
class="ant-calendar-picker"
>
<span>
<input
class="ant-calendar-picker-input ant-input"
placeholder="Select date"
readonly=""
style="width: 400px;"
value=""
/>
<span
class="ant-calendar-picker-icon"
/>
</span>
</span>
`;

3
components/tree/index.en-US.md

@ -21,9 +21,7 @@ Almost anything can be represented in a tree structure. Examples include directo
| defaultCheckedKeys | Specifies the keys of the default checked treeNodes | string\[] | \[] |
| defaultExpandAll | Whether to expand all treeNodes by default | boolean | false |
| defaultExpandedKeys | Specify the keys of the default expanded treeNodes | string\[] | \[] |
| defaultExpandParent | auto expand parent treeNodes when init | bool | true |
| defaultSelectedKeys | Specifies the keys of the default selected treeNodes | string\[] | \[] |
| disabled | whether disabled the tree | bool | false |
| draggable | Specifies whether this Tree is draggable (IE > 8) | boolean | false |
| expandedKeys | (Controlled) Specifies the keys of the expanded treeNodes | string\[] | \[] |
| filterTreeNode | Defines a function to filter (highlight) treeNodes. When the function returns `true`, the corresponding treeNode will be highlighted | function(node) | - |
@ -49,7 +47,6 @@ Almost anything can be represented in a tree structure. Examples include directo
| -------- | ----------- | ---- | ------- |
| disableCheckbox | Disables the checkbox of the treeNode | boolean | false |
| disabled | Disables the treeNode | boolean | false |
| icon | customize icon. When you pass component, whose render will receive full TreeNode props as component props | element/Function(props):ReactNode | - |
| isLeaf | Determines if this is a leaf node(effective when `loadData` is specified) | boolean | false |
| key | Used with (default)ExpandedKeys / (default)CheckedKeys / (default)SelectedKeys. P.S.: It must be unique in all of treeNodes of the tree! | string | internal calculated position of treeNode |
| selectable | Set whether the treeNode can be selected | boolean | true |

3
components/tree/index.zh-CN.md

@ -22,9 +22,7 @@ subtitle: 树形控件
| defaultCheckedKeys | 默认选中复选框的树节点 | string\[] | \[] |
| defaultExpandAll | 默认展开所有树节点 | boolean | false |
| defaultExpandedKeys | 默认展开指定的树节点 | string\[] | \[] |
| defaultExpandParent | 默认展开父节点 | bool | true |
| defaultSelectedKeys | 默认选中的树节点 | string\[] | \[] |
| disabled | 将树禁用 | bool | false |
| draggable | 设置节点可拖拽(IE>8) | boolean | false |
| expandedKeys | (受控)展开指定的树节点 | string\[] | \[] |
| filterTreeNode | 按需筛选树节点(高亮),返回true | function(node) | - |
@ -50,7 +48,6 @@ subtitle: 树形控件
| --- | --- | --- | --- |
| disableCheckbox | 禁掉 checkbox | boolean | false |
| disabled | 禁掉响应 | boolean | false |
| icon | 自定义图标。可接收组件,props 为当前节点 props | element/Function(props):ReactNode | - |
| isLeaf | 设置为叶子节点(设置了`loadData`时有效) | boolean | false |
| key | 被树的 (default)ExpandedKeys / (default)CheckedKeys / (default)SelectedKeys 属性所用。注意:整个树范围内的所有节点的 key 值不能重复! | string | 内部计算出的节点位置 |
| selectable | 设置节点是否可被选中 | boolean | true |

2
package.json

@ -73,7 +73,7 @@
"rc-tabs": "~9.2.0",
"rc-time-picker": "~3.3.0",
"rc-tooltip": "~3.7.0",
"rc-tree": "~1.8.0",
"rc-tree": "~1.7.11",
"rc-tree-select": "~1.12.0",
"rc-upload": "~2.4.0",
"rc-util": "^4.0.4",

Loading…
Cancel
Save