-
-
Notifications
You must be signed in to change notification settings - Fork 198
refactor: rename to container #505
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,7 +41,7 @@ | |
"test": "rc-test" | ||
}, | ||
"dependencies": { | ||
"@rc-component/trigger": "^3.6.7", | ||
"@rc-component/trigger": "^3.6.15", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain依赖升级合理,但请确认 Trigger 新增属性可用性 升级到 @rc-component/trigger@^3.6.15 看起来是为支持 uniqueBgClassName/uniqueBgStyle 映射。为避免运行期无效属性导致样式不生效,请确认该版本已正式暴露这两个属性。 请用以下 Web 查询确认属性支持与变更日志: 🌐 Web query:
💡 Result: Short answer: No — @rc-component/trigger (v3.x) does not expose props named uniqueBgClassName or uniqueBgStyle. The component's documented props (README / API) do not list those props. [1] References:
Sources: If you want, I can search specific release (3.6.15) source files (index.tsx / prop types) and paste the exact code lines from that tag. Citations:
移除或替换 uniqueBgClassName/uniqueBgStyle,Trigger v3.6.15 未暴露该 props 🤖 Prompt for AI Agents
|
||
"@rc-component/util": "^1.3.0", | ||
"classnames": "^2.3.1" | ||
}, | ||
|
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -8,7 +8,7 @@ import { useImperativeHandle, useRef } from 'react'; | |||||||||||||||||||||
import { placements } from './placements'; | ||||||||||||||||||||||
import Popup from './Popup'; | ||||||||||||||||||||||
|
||||||||||||||||||||||
export type SemanticName = 'root' | 'arrow' | 'body' | 'uniqueBody'; | ||||||||||||||||||||||
export type SemanticName = 'root' | 'arrow' | 'container' | 'uniqueContainer'; | ||||||||||||||||||||||
|
||||||||||||||||||||||
export interface TooltipProps | ||||||||||||||||||||||
extends Pick< | ||||||||||||||||||||||
|
@@ -154,8 +154,10 @@ const Tooltip = React.forwardRef<TooltipRef, TooltipProps>((props, ref) => { | |||||||||||||||||||||
popupStyle={styles?.root} | ||||||||||||||||||||||
mouseEnterDelay={mouseEnterDelay} | ||||||||||||||||||||||
arrow={mergedArrow} | ||||||||||||||||||||||
uniqueBgClassName={classNames?.uniqueBody} | ||||||||||||||||||||||
uniqueBgStyle={styles?.uniqueBody} | ||||||||||||||||||||||
{...(({ | ||||||||||||||||||||||
uniqueContainerClassName: classNames?.uniqueContainer, | ||||||||||||||||||||||
uniqueContainerStyle: styles?.uniqueContainer, | ||||||||||||||||||||||
} as any))} | ||||||||||||||||||||||
|
{...(({ | |
uniqueContainerClassName: classNames?.uniqueContainer, | |
uniqueContainerStyle: styles?.uniqueContainer, | |
} as any))} | |
{...(({ | |
uniqueContainerClassName: classNames?.uniqueContainer ?? (classNames as any)?.uniqueBody, | |
uniqueContainerStyle: styles?.uniqueContainer ?? (styles as any)?.uniqueBody, | |
uniqueBgClassName: classNames?.uniqueContainer ?? (classNames as any)?.uniqueBody, | |
uniqueBgStyle: styles?.uniqueContainer ?? (styles as any)?.uniqueBody, | |
} as any))} |
🤖 Prompt for AI Agents
In src/Tooltip.tsx around lines 157 to 160, the spread currently casts to any
and only passes new uniqueContainer* props which are ignored by older
@rc-component/trigger versions; update the spread to include both new
(uniqueContainerClassName/uniqueContainerStyle) and legacy
(uniqueBgClassName/uniqueBgStyle) props, preferring the new values when present,
and remove the "as any" cast. Also add a module declaration to augment
TriggerProps with all four fields (uniqueContainerClassName,
uniqueContainerStyle, uniqueBgClassName, uniqueBgStyle) so types are correct and
you can drop the any cast.
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -319,7 +319,7 @@ describe('rc-tooltip', () => { | |||||
it('should apply custom classNames to all semantic elements', () => { | ||||||
const customClassNames = { | ||||||
root: 'custom-root', | ||||||
body: 'custom-body', | ||||||
container: 'custom-body', | ||||||
|
container: 'custom-body', | |
container: 'custom-container', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The documentation for
classNames
andstyles
is incomplete. It should also includearrow
anduniqueBody
as possible keys, according to theSemanticName
type insrc/Tooltip.tsx
.