mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-12-02 03:59:01 +08:00
Merge pull request #38540 from ant-design/fix-picker
fix: picker missing motion
This commit is contained in:
commit
3e3a3a0ed8
@ -7,7 +7,14 @@ import {
|
||||
genHoverStyle,
|
||||
initInputToken,
|
||||
} from '../../input/style';
|
||||
import { slideDownIn, slideDownOut, slideUpIn, slideUpOut } from '../../style/motion';
|
||||
import {
|
||||
initSlideMotion,
|
||||
initMoveMotion,
|
||||
slideDownIn,
|
||||
slideDownOut,
|
||||
slideUpIn,
|
||||
slideUpOut,
|
||||
} from '../../style/motion';
|
||||
import type { FullToken, GenerateStyle } from '../../theme';
|
||||
import { genComponentStyleHook, mergeToken } from '../../theme';
|
||||
import type { GlobalToken } from '../../theme/interface';
|
||||
@ -848,7 +855,7 @@ export const genPanelStyle = (token: SharedPickerToken): CSSObject => {
|
||||
};
|
||||
};
|
||||
|
||||
const genPickerStatusStyle: GenerateStyle<PickerToken> = token => {
|
||||
const genPickerStatusStyle: GenerateStyle<PickerToken> = (token) => {
|
||||
const {
|
||||
componentCls,
|
||||
colorBgContainer,
|
||||
@ -905,7 +912,7 @@ const genPickerStatusStyle: GenerateStyle<PickerToken> = token => {
|
||||
};
|
||||
};
|
||||
|
||||
const genPickerStyle: GenerateStyle<PickerToken> = token => {
|
||||
const genPickerStyle: GenerateStyle<PickerToken> = (token) => {
|
||||
const {
|
||||
componentCls,
|
||||
antCls,
|
||||
@ -952,7 +959,8 @@ const genPickerStyle: GenerateStyle<PickerToken> = token => {
|
||||
presetsMaxWidth,
|
||||
} = token;
|
||||
|
||||
return {
|
||||
return [
|
||||
{
|
||||
[componentCls]: {
|
||||
...resetComponent(token),
|
||||
...genPikerPadding(token, controlHeight, fontSize, inputPaddingHorizontal),
|
||||
@ -1373,7 +1381,14 @@ const genPickerStyle: GenerateStyle<PickerToken> = token => {
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
},
|
||||
|
||||
// Follow code may reuse in other components
|
||||
initSlideMotion(token, 'slide-up'),
|
||||
initSlideMotion(token, 'slide-down'),
|
||||
initMoveMotion(token, 'move-up'),
|
||||
initMoveMotion(token, 'move-down'),
|
||||
];
|
||||
};
|
||||
|
||||
export const initPickerPanelToken = (token: TokenWithCommonCls<GlobalToken>): PickerPanelToken => {
|
||||
@ -1403,14 +1418,14 @@ export const initPickerPanelToken = (token: TokenWithCommonCls<GlobalToken>): Pi
|
||||
// ============================== Export ==============================
|
||||
export default genComponentStyleHook(
|
||||
'DatePicker',
|
||||
token => {
|
||||
(token) => {
|
||||
const pickerToken = mergeToken<PickerToken>(
|
||||
initInputToken<FullToken<'DatePicker'>>(token),
|
||||
initPickerPanelToken(token),
|
||||
);
|
||||
return [genPickerStyle(pickerToken), genPickerStatusStyle(pickerToken)];
|
||||
},
|
||||
token => ({
|
||||
(token) => ({
|
||||
presetsWidth: 120,
|
||||
presetsMaxWidth: 200,
|
||||
zIndexPopup: token.zIndexPopupBase + 50,
|
||||
|
Loading…
Reference in New Issue
Block a user