-
Notifications
You must be signed in to change notification settings - Fork 319
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(tooltip): 新增lite模式子组件,rate/imageviewer改用lite版本 (#1546)
* test(collapse): add missing usage demo n * fix(select): option设置content未生效问题 * fix(notification): 集中修改多个问题 classname无法定义,closebtn/icon无法支持bool设置,非自动关闭demo修改 * feat(notification): 支持plugin模式下config设置 支持plugin模式下config设置 fix #1376 * docs(notification): api doc update * fix(notification,alert): 修复classsprefix,close不支持function * feat(tooltip): 新增lite版本 n * feat(tooltip): rate, imageviewer替换tooltiplite n * docs(tooltip): demo update * docs(tooltip): doc n * feat(tooltip,button): 增加lite动画transition,mouse offset问题修复,button disabled采用div Co-authored-by: lincao <lincao@tencent.com>
- Loading branch information
1 parent
b4dc640
commit a64312b
Showing
25 changed files
with
686 additions
and
376 deletions.
There are no files selected for viewing
Submodule _common
updated
5 files
+6 −0 | docs/web/api/tooltip.md | |
+34 −0 | js/utils/getPosition.ts | |
+1 −0 | style/web/_variables.less | |
+1 −1 | style/web/components/popup/_index.less | |
+8 −1 | style/web/components/tooltip/_index.less |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import React, { cloneElement } from 'react'; | ||
|
||
const wrapDisabledButton = (children, appendProps = {}) => { | ||
// disable情况下button不响应mouse事件,但需要展示tooltip,所以要包裹一层 | ||
if (children.type === 'button' && children?.props?.disabled) { | ||
const displayStyle = children.props?.style?.display ? children.props.style.display : 'inline-block'; | ||
const child = cloneElement(children, { | ||
style: { | ||
...children?.props?.style, | ||
pointerEvents: 'none', | ||
}, | ||
}); | ||
return ( | ||
<span {...appendProps} style={{ display: displayStyle, cursor: 'not-allowed' }}> | ||
{child} | ||
</span> | ||
); | ||
} | ||
return null; | ||
}; | ||
|
||
export default wrapDisabledButton; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.