Skip to content

Commit 975d70e

Browse files
JavanShensnow-monsterbaohangxingtangjinzhou
authored
fix: some type & doc (#6292)
* fix: typo (#6218) * fix: typo * docs<upload>: docs update * fix: type of minute in props disabledDateTime of DatePicker (#6233) * docs: typo (#6256) * feat: tooltip added overlayInnerStyle attribute * Update abstractTooltipProps.ts * Update Tooltip.tsx --------- Co-authored-by: lyn <[email protected]> Co-authored-by: H1mple <[email protected]> Co-authored-by: tangjinzhou <[email protected]>
1 parent c301c63 commit 975d70e

File tree

13 files changed

+40
-38
lines changed

13 files changed

+40
-38
lines changed

components/affix/index.tsx

+11-11
Original file line numberDiff line numberDiff line change
@@ -127,23 +127,23 @@ const Affix = defineComponent({
127127
newState.affixStyle = {
128128
position: 'fixed',
129129
top: fixedTop,
130-
width: placeholderReact.width + 'px',
131-
height: placeholderReact.height + 'px',
130+
width: placeholderRect.width + 'px',
131+
height: placeholderRect.height + 'px',
132132
};
133133
newState.placeholderStyle = {
134-
width: placeholderReact.width + 'px',
135-
height: placeholderReact.height + 'px',
134+
width: placeholderRect.width + 'px',
135+
height: placeholderRect.height + 'px',
136136
};
137137
} else if (fixedBottom !== undefined) {
138138
newState.affixStyle = {
139139
position: 'fixed',
140140
bottom: fixedBottom,
141-
width: placeholderReact.width + 'px',
142-
height: placeholderReact.height + 'px',
141+
width: placeholderRect.width + 'px',
142+
height: placeholderRect.height + 'px',
143143
};
144144
newState.placeholderStyle = {
145-
width: placeholderReact.width + 'px',
146-
height: placeholderReact.height + 'px',
145+
width: placeholderRect.width + 'px',
146+
height: placeholderRect.height + 'px',
147147
};
148148
}
149149

@@ -179,9 +179,9 @@ const Affix = defineComponent({
179179
const targetNode = target();
180180
if (targetNode && placeholderNode.value) {
181181
const targetRect = getTargetRect(targetNode);
182-
const placeholderReact = getTargetRect(placeholderNode.value as HTMLElement);
183-
const fixedTop = getFixedTop(placeholderReact, targetRect, offsetTop.value);
184-
const fixedBottom = getFixedBottom(placeholderReact, targetRect, offsetBottom.value);
182+
const placeholderRect = getTargetRect(placeholderNode.value as HTMLElement);
183+
const fixedTop = getFixedTop(placeholderRect, targetRect, offsetTop.value);
184+
const fixedBottom = getFixedBottom(placeholderRect, targetRect, offsetBottom.value);
185185
if (
186186
(fixedTop !== undefined && affixStyle.top === fixedTop) ||
187187
(fixedBottom !== undefined && affixStyle.bottom === fixedBottom)

components/affix/utils.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,19 @@ export function getTargetRect(target: BindElement): DOMRect {
99
: ({ top: 0, bottom: window.innerHeight } as DOMRect);
1010
}
1111

12-
export function getFixedTop(placeholderReact: DOMRect, targetRect: DOMRect, offsetTop: number) {
13-
if (offsetTop !== undefined && targetRect.top > placeholderReact.top - offsetTop) {
12+
export function getFixedTop(placeholderRect: DOMRect, targetRect: DOMRect, offsetTop: number) {
13+
if (offsetTop !== undefined && targetRect.top > placeholderRect.top - offsetTop) {
1414
return `${offsetTop + targetRect.top}px`;
1515
}
1616
return undefined;
1717
}
1818

1919
export function getFixedBottom(
20-
placeholderReact: DOMRect,
20+
placeholderRect: DOMRect,
2121
targetRect: DOMRect,
2222
offsetBottom: number,
2323
) {
24-
if (offsetBottom !== undefined && targetRect.bottom < placeholderReact.bottom + offsetBottom) {
24+
if (offsetBottom !== undefined && targetRect.bottom < placeholderRect.bottom + offsetBottom) {
2525
const targetBottomOffset = window.innerHeight - targetRect.bottom;
2626
return `${offsetBottom + targetBottomOffset}px`;
2727
}

components/button/index.en-US.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ Different button styles can be generated by setting Button properties. The recom
4040
| htmlType | set the original html `type` of `button`, see: [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#attr-type) | string | `button` | |
4141
| icon | set the icon of button, see: Icon component | v-slot | - | |
4242
| loading | set the loading status of button | boolean \| { delay: number } | `false` | |
43-
| shape | Can be set button shape | `default` \| `circle` \| `round` | 'default' | |
43+
| shape | Can be set button shape | `default` \| `circle` \| `round` | `default` | |
4444
| size | set the size of button | `large` \| `middle` \| `small` | `middle` | |
4545
| target | same as target attribute of a, works when href is specified | string | - | |
4646
| type | can be set button type | `primary` \| `ghost` \| `dashed` \| `link` \| `text` \| `default` | `default` | |

components/button/index.zh-CN.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ cover: https://gw.alipayobjects.com/zos/alicdn/fNUKzY1sk/Button.svg
4343
| htmlType | 设置 `button` 原生的 `type` 值,可选值请参考 [HTML 标准](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#attr-type) | string | `button` | |
4444
| icon | 设置按钮的图标类型 | v-slot | - | |
4545
| loading | 设置按钮载入状态 | boolean \| { delay: number } | `false` | |
46-
| shape | 设置按钮形状 | `default` \| `circle` \| `round` | 'default' | |
46+
| shape | 设置按钮形状 | `default` \| `circle` \| `round` | `default` | |
4747
| size | 设置按钮大小 | `large` \| `middle` \| `small` | `middle` | |
4848
| target | 相当于 a 链接的 target 属性,href 存在时生效 | string | - | |
4949
| type | 设置按钮类型 | `primary` \| `ghost` \| `dashed` \| `link` \| `text` \| `default` | `default` | |

components/input/demo/textarea.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ For multi-line input.
1919
<a-textarea v-model:value="value" placeholder="Basic usage" :rows="4" />
2020
<br />
2121
<br />
22-
<a-textarea :rows="4" placeholder="maxLength is 6" :maxlength="6" />
22+
<a-textarea :rows="4" placeholder="maxlength is 6" :maxlength="6" />
2323
</template>
2424
<script lang="ts">
2525
import { defineComponent, ref } from 'vue';

components/select/index.en-US.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ Select component to select value from options.
5050
| maxTagTextLength | Max text length to show | number | - | |
5151
| menuItemSelectedIcon | The custom menuItemSelected icon | VNode \| slot | - | |
5252
| mode | Set mode of Select | 'multiple' \| 'tags' | - | |
53-
| notFoundContent | Specify content to show when no result matches.. | string\|slot | 'Not Found' | |
53+
| notFoundContent | Specify content to show when no result matches.. | string\|slot | `Not Found` | |
5454
| open | Controlled open state of dropdown | boolean | - | |
5555
| option | custom render option by slot | v-slot:option="{value, label, [disabled, key, title]}" | - | 2.2.5 |
5656
| optionFilterProp | Which prop value of option will be used for filter if filterOption is true | string | value | |

components/select/index.zh-CN.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,15 @@ cover: https://mdn.alipayobjects.com/huamei_7uahnr/afts/img/A*zo76T7KQx2UAAAAAAA
4242
| filterOption | 是否根据输入项进行筛选。当其为一个函数时,会接收 `inputValue` `option` 两个参数,当 `option` 符合筛选条件时,应返回 `true`,反之则返回 `false`| `boolean` \| `function(inputValue, option)` | true | |
4343
| filterSort | 搜索时对筛选结果项的排序函数, 类似[Array.sort](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort)里的 compareFunction | (optionA: Option, optionB: Option) => number | - | 3.0 |
4444
| firstActiveValue | 默认高亮的选项 | string\|string\[] | - | |
45-
| getPopupContainer | 菜单渲染父节点。默认渲染到 body 上,如果你遇到菜单滚动定位问题,试试修改为滚动的区域,并相对其定位。 | Function(triggerNode) | () => document.body | |
45+
| getPopupContainer | 菜单渲染父节点。默认渲染到 body 上,如果你遇到菜单滚动定位问题,试试修改为滚动的区域,并相对其定位。 | function(triggerNode) | () => document.body | |
4646
| labelInValue | 是否把每个选项的 label 包装到 value 中,会把 Select 的 value 类型从 `string` 变为 `{key: string, label: vNodes, originLabel: any}` 的格式, originLabel(3.1) 保持原始类型,如果通过 a-select-option children 构造的节点,该值是是个函数(即 a-select-option 的默认插槽) | boolean | false | |
4747
| listHeight | 设置弹窗滚动高度 | number | 256 | |
4848
| maxTagCount | 最多显示多少个 tag | number | - | |
4949
| maxTagPlaceholder | 隐藏 tag 时显示的内容 | slot \| function(omittedValues) | - | |
5050
| maxTagTextLength | 最大显示的 tag 文本长度 | number | - | |
5151
| menuItemSelectedIcon | 自定义当前选中的条目图标 | VNode \| slot | - | |
5252
| mode | 设置 Select 的模式为多选或标签 | 'multiple' \| 'tags' \| 'combobox' | - | |
53-
| notFoundContent | 当下拉列表为空时显示的内容 | string\|slot | 'Not Found' | |
53+
| notFoundContent | 当下拉列表为空时显示的内容 | string\|slot | `Not Found` | |
5454
| open | 是否展开下拉菜单 | boolean | - | |
5555
| option | 通过 option 插槽,自定义节点 | v-slot:option="{value, label, [disabled, key, title]}" | - | 2.2.5 |
5656
| optionFilterProp | 搜索时过滤对应的 option 属性,不支持 children | string | value | |

components/tooltip/Tooltip.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ export default defineComponent({
239239
computed(() => !injectFromPopover.value),
240240
);
241241
return () => {
242-
const { openClassName, overlayClassName } = props;
242+
const { openClassName, overlayClassName, overlayInnerStyle } = props;
243243
let children = filterEmpty(slots.default?.()) ?? null;
244244
children = children.length === 1 ? children[0] : children;
245245

@@ -268,8 +268,8 @@ export default defineComponent({
268268
hashId.value,
269269
);
270270
const formattedOverlayInnerStyle = {
271-
...props.overlayInnerStyle,
272271
...colorInfo.value.overlayStyle,
272+
...overlayInnerStyle,
273273
};
274274
const arrowContentStyle = colorInfo.value.arrowStyle;
275275
const vcTooltipProps = {

components/tooltip/index.en-US.md

+1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ The following APIs are shared by Tooltip, Popconfirm, Popover.
3434
| mouseLeaveDelay | Delay in seconds, before tooltip is hidden on mouse leave | number | 0.1 | |
3535
| overlayClassName | Class name of the tooltip card | string | - | |
3636
| overlayStyle | Style of the tooltip card | object | - | |
37+
| overlayInnerStyle | Style of the tooltip inner content | object | - | 4.0.0 |
3738
| placement | The position of the tooltip relative to the target, which can be one of `top` `left` `right` `bottom` `topLeft` `topRight` `bottomLeft` `bottomRight` `leftTop` `leftBottom` `rightTop` `rightBottom` | string | `top` | |
3839
| trigger | Tooltip trigger mode | `hover` \| `focus` \| `click` \| `contextmenu` | `hover` | |
3940
| open(v-model) | Whether the floating tooltip card is open or not, Use `visible` under 4.0.0 | boolean | `false` | 4.0.0 |

components/tooltip/index.zh-CN.md

+1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ cover: https://gw.alipayobjects.com/zos/alicdn/Vyyeu8jq2/Tooltp.svg
3535
| mouseLeaveDelay | 鼠标移出后延时多少才隐藏 Tooltip,单位:秒 | number | 0.1 | |
3636
| overlayClassName | 卡片类名 | string || |
3737
| overlayStyle | 卡片样式 | object || |
38+
| overlayInnerStyle | 卡片内容区域样式 | object || 4.0 |
3839
| placement | 气泡框位置,可选 `top` `left` `right` `bottom` `topLeft` `topRight` `bottomLeft` `bottomRight` `leftTop` `leftBottom` `rightTop` `rightBottom` | string | top | |
3940
| trigger | 触发行为,可选 `hover/focus/click/contextmenu` | string | hover | |
4041
| open(v-model) | 用于手动控制浮层显隐, 小于 4.0.0 使用 `visible` | boolean | false | 4.0 |

components/upload/index.en-US.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Uploading is the process of publishing information (web pages, text, pictures, v
2222
| accept | File types that can be accepted. See [input accept Attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file#accept) | string | - | | |
2323
| action | Uploading URL | string\|(file) => `Promise` | - | | |
2424
| beforeUpload | Hook function which will be executed before uploading. Uploading will be stopped with `false` or a rejected Promise returned. | (file, fileList) => `boolean` \| `Promise` | - | |
25-
| customRequest | override for the default xhr behavior allowing for additional customization and ability to implement your own XMLHttpRequest | Function | - | | |
25+
| customRequest | override for the default xhr behavior allowing for additional customization and ability to implement your own XMLHttpRequest | function | - | | |
2626
| data | Uploading params or function which can return uploading params. | object\|function(file) | - | | |
2727
| directory | support upload whole directory ([caniuse](https://caniuse.com/#feat=input-file-directory)) | boolean | false | | |
2828
| directory | Support upload whole directory([caniuse](https://caniuse.com/#feat=input-file-directory)| boolean | false | 3.0 | |
@@ -32,7 +32,7 @@ Uploading is the process of publishing information (web pages, text, pictures, v
3232
| headers | Set request headers, valid above IE10. | object | - | | |
3333
| iconRender | Custom show icon | v-slot:iconRender="{file: UploadFile, listType?: UploadListType}" | - | 3.0 | |
3434
| isImageUrl | Customize if render &lt;img /> in thumbnail | (file: UploadFile) => boolean | - | 3.0 | |
35-
| itemRender | Custom item of uploadList | v-slot:itemRender="{originNode: ReactElement, file: UploadFile, fileList: object\[], actions: { download: function, preview: function, remove: function }" | - | 3.0 | |
35+
| itemRender | Custom item of uploadList | v-slot:itemRender="{originNode: VNode, file: UploadFile, fileList: object\[], actions: { download: function, preview: function, remove: function }" | - | 3.0 | |
3636
| listType | Built-in stylesheets, support for three types: `text`, `picture` or `picture-card` | string | `text` | | |
3737
| maxCount | Limit the number of uploaded files. Will replace current one when `maxCount` is `1` | number | - | 3.0 | |
3838
| method | http method of upload request | string | `post` | 1.5.0 | |
@@ -43,19 +43,19 @@ Uploading is the process of publishing information (web pages, text, pictures, v
4343
| previewIcon | custom preview icon | v-slot:iconRender="{file: UploadFile}" | - | 3.0 | |
4444
| progress | Custom progress bar | [ProgressProps](/components/progress/#API) (support `type="line"` only) | { strokeWidth: 2, showInfo: false } | 3.0 | |
4545
| removeIcon | custom remove icon | v-slot:iconRender="{file: UploadFile}" | - | 3.0 | |
46-
| showUploadList | Whether to show default upload list, could be an object to specify `showPreviewIcon`, `showRemoveIcon` and `showDownloadIcon` individually | Boolean or { showPreviewIcon?: boolean, showRemoveIcon?: boolean, showDownloadIcon?: boolean } | true | showDownloadIcon(3.0) | |
46+
| showUploadList | Whether to show default upload list, could be an object to specify `showPreviewIcon`, `showRemoveIcon` and `showDownloadIcon` individually | boolean \| { showPreviewIcon?: boolean, showRemoveIcon?: boolean, showDownloadIcon?: boolean } | true | showDownloadIcon(3.0) | |
4747
| supportServerRender | Need to be turned on while the server side is rendering. | boolean | false | | |
4848
| withCredentials | ajax upload with cookie sent | boolean | false | | |
4949

5050
### events
5151

5252
| Events Name | Description | Arguments | Version | |
5353
| --- | --- | --- | --- | --- |
54-
| change | A callback function, can be executed when uploading state is changing. See [change](#change) | Function | - | |
55-
| download | Click the method to download the file, pass the method to perform the method logic, do not pass the default jump to the new TAB. | Function(file): void | Jump to new TAB | 1.5.0 |
54+
| change | A callback function, can be executed when uploading state is changing. See [change](#change) | function | - | |
55+
| download | Click the method to download the file, pass the method to perform the method logic, do not pass the default jump to the new TAB. | function(file): void | Jump to new TAB | 1.5.0 |
5656
| drop | A callback function executed when files are dragged and dropped into upload area | (event: DragEvent) => void | - | 3.0 |
57-
| preview | A callback function, will be executed when file link or preview icon is clicked. | Function(file) | - | |
58-
| reject | A callback function, will be executed when drop files is not accept. | Function(fileList) | - | |
57+
| preview | A callback function, will be executed when file link or preview icon is clicked. | function(file) | - | |
58+
| reject | A callback function, will be executed when drop files is not accept. | function(fileList) | - | |
5959
| remove   | A callback function, will be executed when removing file button is clicked, remove event will be prevented when return value is false or a Promise which resolve(false) or reject | function(file): boolean \| Promise | -   | 3.0 |
6060

6161
### UploadFile

0 commit comments

Comments
 (0)