Skip to content

Commit

Permalink
Fix Multiple Typescript Definitions (#762)
Browse files Browse the repository at this point in the history
typescript(*):  add dotsClass for Slider, correct popupContainer's definitions
  • Loading branch information
alvarto authored and youluna committed Jun 4, 2019
1 parent de73489 commit 40de21d
Show file tree
Hide file tree
Showing 11 changed files with 26 additions and 37 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@
"shallow-element-equals": "^1.0.1"
},
"devDependencies": {
"@types/react": "^16.8.13",
"@alifd/api-extractor": "^3.4.0",
"@alifd/babel-preset-next": "^2.0.0",
"@alifd/doc-parser": "^1.0.0",
Expand Down
8 changes: 2 additions & 6 deletions types/balloon/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,7 @@ export interface TooltipProps extends React.HTMLAttributes<HTMLElement> {
/**
* 指定浮层渲染的父节点, 可以为节点id的字符串,也可以返回节点的函数。
*/
popupContainer?:
| string
| ((target: React.ReactElement<any>) => React.ReactElement<any>);
popupContainer?: string | HTMLElement | ((target: HTMLElement) => HTMLElement);

/**
* 弹层id, 传入值才会支持无障碍
Expand Down Expand Up @@ -217,9 +215,7 @@ export interface BalloonProps extends React.HTMLAttributes<HTMLElement> {
/**
* 指定浮层渲染的父节点, 可以为节点id的字符串,也可以返回节点的函数。
*/
popupContainer?:
| string
| ((target: React.ReactElement<any>) => React.ReactElement<any>);
popupContainer?: string | HTMLElement | ((target: HTMLElement) => HTMLElement);

/**
* 弹层组件style,透传给Popup
Expand Down
4 changes: 1 addition & 3 deletions types/cascader-select/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,9 +195,7 @@ export interface CascaderSelectProps extends HTMLAttributesWeak {
/**
* 下拉框挂载的容器节点
*/
popupContainer?:
| string
| ((target: React.ReactElement<any>) => React.ReactElement<any>);
popupContainer?: string | HTMLElement | ((target: HTMLElement) => HTMLElement);

/**
* 透传到 Popup 的属性对象
Expand Down
16 changes: 4 additions & 12 deletions types/date-picker/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,7 @@ export interface MonthPickerProps extends HTMLAttributesWeak {
/**
* 弹层容器
*/
popupContainer?: (
target: React.ReactElement<any>
) => React.ReactElement<any>;
popupContainer?: string | HTMLElement | ((target: HTMLElement) => HTMLElement);

/**
* 弹层自定义样式
Expand Down Expand Up @@ -247,9 +245,7 @@ export interface RangePickerProps extends HTMLAttributesWeak {
/**
* 弹层容器
*/
popupContainer?: (
target: React.ReactElement<any>
) => React.ReactElement<any>;
popupContainer?: string | HTMLElement | ((target: HTMLElement) => HTMLElement);

/**
* 弹层自定义样式
Expand Down Expand Up @@ -393,9 +389,7 @@ export interface YearPickerProps extends HTMLAttributesWeak {
/**
* 弹层容器
*/
popupContainer?: (
target: React.ReactElement<any>
) => React.ReactElement<any>;
popupContainer?: string | HTMLElement | ((target: HTMLElement) => HTMLElement);

/**
* 弹层自定义样式
Expand Down Expand Up @@ -538,9 +532,7 @@ export interface DatePickerProps extends HTMLAttributesWeak {
/**
* 弹层容器
*/
popupContainer?: (
target: React.ReactElement<any>
) => React.ReactElement<any>;
popupContainer?: string | HTMLElement | ((target: HTMLElement) => HTMLElement);

/**
* 弹层自定义样式
Expand Down
4 changes: 1 addition & 3 deletions types/menu-button/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@ export interface MenuButtonProps extends HTMLAttributesWeak {
/**
* 弹层容器
*/
popupContainer?: (
target: React.ReactElement<any>
) => React.ReactElement<any>;
popupContainer?: string | HTMLElement | ((target: HTMLElement) => HTMLElement);

/**
* 弹层展开状态
Expand Down
4 changes: 1 addition & 3 deletions types/search/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,7 @@ export interface SearchProps extends HTMLAttributesWeak {
/**
* 弹层挂载的容器节点
*/
popupContainer?:
| string
| ((target: React.ReactElement<any>) => React.ReactElement<any>);
popupContainer?: string | HTMLElement | ((target: HTMLElement) => HTMLElement);

/**
* 弹层的 className
Expand Down
8 changes: 2 additions & 6 deletions types/select/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,7 @@ export interface AutoCompleteProps extends HTMLAttributesWeak {
/**
* 弹层挂载的容器节点
*/
popupContainer?:
| string
| ((target: React.ReactElement<any>) => React.ReactElement<any>);
popupContainer?: string | HTMLElement | ((target: HTMLElement) => HTMLElement);

/**
* 弹层的 className
Expand Down Expand Up @@ -239,9 +237,7 @@ export interface SelectProps extends HTMLAttributesWeak {
/**
* 弹层挂载的容器节点
*/
popupContainer?:
| string
| ((target: React.ReactElement<any>) => React.ReactElement<any>);
popupContainer?: string | HTMLElement | ((target: HTMLElement) => HTMLElement);

/**
* 弹层的 className
Expand Down
5 changes: 5 additions & 0 deletions types/slider/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,11 @@ export interface SliderProps extends HTMLAttributesWeak {
*/
dots?: boolean;

/**
* 导航锚点的 CSS 类
*/
dotsClass?: string;

/**
* 导航锚点位置
*/
Expand Down
7 changes: 7 additions & 0 deletions types/table/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ export interface TableProps extends React.HTMLAttributes<HTMLElement> {
* 设置每一行的属性,如果返回值和其他针对行操作的属性冲突则无效。
*/
getRowProps?: (record: {}, index: number) => {};
rowProps?: (record: {}, index: number) => {};

/**
* 设置单元格的属性,通过该属性可以进行合并单元格
Expand All @@ -178,6 +179,12 @@ export interface TableProps extends React.HTMLAttributes<HTMLElement> {
dataIndex: string,
record: {}
) => {};
cellProps?: (
rowIndex: number,
colIndex: number,
dataIndex: string,
record: {}
) => {};

/**
* 表格是否具有边框
Expand Down
2 changes: 1 addition & 1 deletion types/time-picker/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ export interface TimePickerProps extends HTMLAttributesWeak {
/**
* 弹层容器
*/
popupContainer?: (target: {}) => React.ReactNode;
popupContainer?: string | HTMLElement | ((target: HTMLElement) => HTMLElement);

/**
* 弹层对齐方式, 详情见Overlay 文档
Expand Down
4 changes: 1 addition & 3 deletions types/tree-select/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,9 +161,7 @@ export interface TreeSelectProps extends HTMLAttributesWeak {
/**
* 下拉框挂载的容器节点
*/
popupContainer?:
| string
| ((target: React.ReactElement<any>) => React.ReactElement<any>);
popupContainer?: string | HTMLElement | ((target: HTMLElement) => HTMLElement);

/**
* 透传到 Popup 的属性对象
Expand Down

0 comments on commit 40de21d

Please sign in to comment.