mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-05 01:19:45 +08:00
fix: InputNumber handleVisible token should work as expected (#51728)
This commit is contained in:
parent
9cc7dc1e15
commit
c3b75819a9
@ -250,7 +250,7 @@ const genInputNumberStyles: GenerateStyle<InputNumberToken> = (token: InputNumbe
|
|||||||
position: 'absolute',
|
position: 'absolute',
|
||||||
insetBlockStart: 0,
|
insetBlockStart: 0,
|
||||||
insetInlineEnd: 0,
|
insetInlineEnd: 0,
|
||||||
width: 0,
|
width: token.handleVisibleWidth,
|
||||||
opacity: handleOpacity,
|
opacity: handleOpacity,
|
||||||
height: '100%',
|
height: '100%',
|
||||||
borderStartStartRadius: 0,
|
borderStartStartRadius: 0,
|
||||||
|
@ -55,17 +55,22 @@ export interface ComponentToken extends SharedComponentToken {
|
|||||||
* @internal
|
* @internal
|
||||||
*/
|
*/
|
||||||
handleOpacity: number;
|
handleOpacity: number;
|
||||||
|
/**
|
||||||
|
* @internal
|
||||||
|
*/
|
||||||
|
handleVisibleWidth: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
export type InputNumberToken = FullToken<'InputNumber'> & SharedInputToken;
|
export type InputNumberToken = FullToken<'InputNumber'> & SharedInputToken;
|
||||||
|
|
||||||
export const prepareComponentToken: GetDefaultToken<'InputNumber'> = (token) => {
|
export const prepareComponentToken: GetDefaultToken<'InputNumber'> = (token) => {
|
||||||
const handleVisible = token.handleVisible ?? 'auto';
|
const handleVisible = token.handleVisible ?? 'auto';
|
||||||
|
const handleWidth = token.controlHeightSM - token.lineWidth * 2;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
...initComponentToken(token),
|
...initComponentToken(token),
|
||||||
controlWidth: 90,
|
controlWidth: 90,
|
||||||
handleWidth: token.controlHeightSM - token.lineWidth * 2,
|
handleWidth,
|
||||||
handleFontSize: token.fontSize / 2,
|
handleFontSize: token.fontSize / 2,
|
||||||
handleVisible,
|
handleVisible,
|
||||||
handleActiveBg: token.colorFillAlter,
|
handleActiveBg: token.colorFillAlter,
|
||||||
@ -76,5 +81,6 @@ export const prepareComponentToken: GetDefaultToken<'InputNumber'> = (token) =>
|
|||||||
handleHoverColor: token.colorPrimary,
|
handleHoverColor: token.colorPrimary,
|
||||||
handleBorderColor: token.colorBorder,
|
handleBorderColor: token.colorBorder,
|
||||||
handleOpacity: handleVisible === true ? 1 : 0,
|
handleOpacity: handleVisible === true ? 1 : 0,
|
||||||
|
handleVisibleWidth: handleVisible === true ? handleWidth : 0,
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user