Skip to content

Commit a47a820

Browse files
committed
cr pagination & popover & popconfirm & tree-select
1 parent f94f50f commit a47a820

File tree

7 files changed

+15
-12
lines changed

7 files changed

+15
-12
lines changed

components/pagination/Pagination.jsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import MiniSelect from './MiniSelect';
44
import LocaleReceiver from '../locale-provider/LocaleReceiver';
55
import { getOptionProps } from '../_util/props-util';
66
import VcPagination from '../vc-pagination';
7+
import enUS from '../pagination/locale/en_US';
78
import Icon from '../icon';
89
import { ConfigConsumerProps } from '../config-provider';
910

@@ -44,7 +45,7 @@ export default {
4445
...PaginationProps(),
4546
},
4647
inject: {
47-
configProvider: { default: () => ({}) },
48+
configProvider: { default: () => ConfigConsumerProps },
4849
},
4950
methods: {
5051
getIconsProps(prefixCls) {
@@ -118,7 +119,7 @@ export default {
118119
},
119120
render() {
120121
return (
121-
<LocaleReceiver componentName="Pagination" scopedSlots={{ default: this.renderPagination }} />
122+
<LocaleReceiver componentName="Pagination" defaultLocale={enUS} scopedSlots={{ default: this.renderPagination }} />
122123
);
123124
},
124125
};

components/popconfirm/index.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ const Popconfirm = {
4141
},
4242
},
4343
inject: {
44-
configProvider: { default: () => ({}) },
44+
configProvider: { default: () => ConfigConsumerProps },
4545
},
4646
data() {
4747
const props = getOptionProps(this);

components/popover/index.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const Popover = {
1010
name: 'APopover',
1111
props: {
1212
...props,
13-
prefixCls: PropTypes.string.def('ant-popover'),
13+
prefixCls: PropTypes.string,
1414
transitionName: PropTypes.string.def('zoom-big'),
1515
content: PropTypes.any,
1616
title: PropTypes.any,
@@ -20,7 +20,7 @@ const Popover = {
2020
event: 'visibleChange',
2121
},
2222
inject: {
23-
configProvider: { default: () => ({}) },
23+
configProvider: { default: () => ConfigConsumerProps },
2424
},
2525
methods: {
2626
getPopupDomNode() {

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@
2626
| suffixIcon | The custom suffix icon | VNode \| slot | - |
2727
| treeCheckable | Whether to show checkbox on the treeNodes | boolean | false |
2828
| treeCheckStrictly | Whether to check nodes precisely (in the `checkable` mode), means parent and child nodes are not associated, and it will make `labelInValue` be true | boolean | false |
29-
| treeData | Data of the treeNodes, manual construction work is no longer needed if this property has been set(ensure the Uniqueness of each value) | array&lt;{ value, label, children, [disabled, disableCheckbox, selectable] }> | \[] |
30-
| treeDataSimpleMode | Enable simple mode of treeData.(treeData should like this: [{id:1, pId:0, value:'1', label:"test1",...},...], pId is parent node's id) | false\|Array&lt;{ id: string, pId: string, rootPId: null }> | false |
29+
| treeData | Data of the treeNodes, manual construction work is no longer needed if this property has been set(ensure the Uniqueness of each value) | array\<{ value, title, children, \[disabled, disableCheckbox, selectable] }> | \[] |
30+
| treeDataSimpleMode | Enable simple mode of treeData. Changes the `treeData` schema to: \[{id:1, pId:0, value:'1', title:"test1",...},...] where pId is parent node's id). It is possible to replace the default `id` and `pId` keys by providing object to `treeDataSimpleMode` | false\|object\<{ id: string, pId: string, rootPId: null }> | false |
3131
| treeDefaultExpandAll | Whether to expand all treeNodes by default | boolean | false |
3232
| treeDefaultExpandedKeys | Default expanded treeNodes | string\[] \| number\[] | - |
3333
| treeExpandedKeys(.sync) | Set expanded keys | string\[] \| number\[] | - |

components/tree-select/index.jsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ const TreeSelect = {
3333
event: 'change',
3434
},
3535
inject: {
36-
configProvider: { default: () => ({}) },
36+
configProvider: { default: () => ConfigConsumerProps },
3737
},
3838
created() {
3939
warning(
@@ -99,9 +99,7 @@ const TreeSelect = {
9999
const getPrefixCls = this.configProvider.getPrefixCls || ConfigConsumerProps.getPrefixCls;
100100
const prefixCls = getPrefixCls('select', customizePrefixCls);
101101

102-
const renderEmpty =
103-
(this.configProvider.renderEmpty && this.configProvider.renderEmpty()) ||
104-
ConfigConsumerProps.renderEmpty;
102+
const renderEmpty = this.configProvider.renderEmpty;
105103
const notFoundContent = getComponentFromProp(this, 'notFoundContent');
106104
const { getPopupContainer: getContextPopupContainer } = this.configProvider;
107105
const rest = omit(restProps, [

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
| treeCheckable | 显示 checkbox | boolean | false |
2828
| treeCheckStrictly | checkable 状态下节点选择完全受控(父子节点选中状态不再关联),会使得 `labelInValue` 强制为 true | boolean | false |
2929
| treeData | treeNodes 数据,如果设置则不需要手动构造 TreeNode 节点(value 在整个树范围内唯一) | array&lt;{value, label, children, [disabled, disableCheckbox, selectable]}> | \[] |
30-
| treeDataSimpleMode | 使用简单格式的 treeData,具体设置参考可设置的类型 (此时 treeData 应变为这样的数据结构: [{id:1, pId:0, value:'1', label:"test1",...},...], `pId` 是父节点的 id) | false\|Array&lt;{ id: string, pId: string, rootPId: null }> | false |
30+
| treeDataSimpleMode | 使用简单格式的 treeData,具体设置参考可设置的类型 (此时 treeData 应变为这样的数据结构: \[{id:1, pId:0, value:'1', label:"test1",...},...], `pId` 是父节点的 id) | false\|Array&lt;{ id: string, pId: string, rootPId: null }> | false |
3131
| treeDefaultExpandAll | 默认展开所有树节点 | boolean | false |
3232
| treeDefaultExpandedKeys | 默认展开的树节点 | string\[] \| number\[] | - |
3333
| treeExpandedKeys(.sync) | 设置展开的树节点 | string\[] \| number\[] | - |

types/tree-select.d.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ export interface TreeData {
1818
export declare class TreeSelect extends AntdComponent {
1919
static TreeNode: typeof TreeNode;
2020

21+
treeIcon?: boolean;
22+
23+
notFoundContent?: any;
24+
2125
/**
2226
* Whether allow clear
2327
* @default false

0 commit comments

Comments
 (0)