fix: ant-piker-cell-range-hover-end style error (#6373)

* fix: ant-piker-cell-range-hover-end style error

* feat: be consistent with antd

* feat: be consistent with antd
pull/6382/head
Cherry7 2023-03-21 14:08:37 +08:00 committed by GitHub
parent dcc3bb10cb
commit 4d2a37fcd3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 5 deletions

View File

@ -331,8 +331,9 @@ export const genPanelStyle = (token: SharedPickerToken): CSSObject => {
} = token; } = token;
const pickerPanelWidth = pickerPanelCellWidth * 7 + paddingSM * 2 + 4; const pickerPanelWidth = pickerPanelCellWidth * 7 + paddingSM * 2 + 4;
const hoverCellFixedDistance = const hoverCellFixedDistance =
(pickerPanelWidth - paddingXS * 2) / 3 - pickerYearMonthCellWidth / 2; (pickerPanelWidth - paddingXS * 2) / 3 - pickerYearMonthCellWidth - paddingSM;
return { return {
[componentCls]: { [componentCls]: {
@ -658,17 +659,17 @@ export const genPanelStyle = (token: SharedPickerToken): CSSObject => {
insetInlineEnd: hoverCellFixedDistance, insetInlineEnd: hoverCellFixedDistance,
borderInlineEnd: `${lineWidth}px dashed ${pickerDateHoverRangeBorderColor}`, borderInlineEnd: `${lineWidth}px dashed ${pickerDateHoverRangeBorderColor}`,
borderStartStartRadius: 0, borderStartStartRadius: 0,
borderBottomStartRadius: 0, borderEndStartRadius: 0,
borderStartEndRadius: borderRadius, borderStartEndRadius: borderRadius,
borderBottomEndRadius: borderRadius, borderEndEndRadius: borderRadius,
[`${componentCls}-panel-rtl &`]: { [`${componentCls}-panel-rtl &`]: {
insetInlineStart: hoverCellFixedDistance, insetInlineStart: hoverCellFixedDistance,
borderInlineStart: `${lineWidth}px dashed ${pickerDateHoverRangeBorderColor}`, borderInlineStart: `${lineWidth}px dashed ${pickerDateHoverRangeBorderColor}`,
borderStartStartRadius: borderRadius, borderStartStartRadius: borderRadius,
borderBottomStartRadius: borderRadius, borderEndStartRadius: borderRadius,
borderStartEndRadius: 0, borderStartEndRadius: 0,
borderBottomEndRadius: 0, borderEndEndRadius: 0,
}, },
}, },
}, },
@ -1429,6 +1430,7 @@ export default genComponentStyleHook(
initInputToken<FullToken<'DatePicker'>>(token), initInputToken<FullToken<'DatePicker'>>(token),
initPickerPanelToken(token), initPickerPanelToken(token),
); );
return [ return [
genPickerStyle(pickerToken), genPickerStyle(pickerToken),
genPickerStatusStyle(pickerToken), genPickerStatusStyle(pickerToken),