From 440c95c3c85c8ca6bc49a997a787ece71e4c9cde Mon Sep 17 00:00:00 2001 From: CCherry07 <2405693142@qq.com> Date: Mon, 20 Mar 2023 20:25:17 +0800 Subject: [PATCH 1/3] fix: ant-piker-cell-range-hover-end style error --- components/date-picker/style/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/date-picker/style/index.ts b/components/date-picker/style/index.ts index dbb787952e..e8bbc50ab5 100644 --- a/components/date-picker/style/index.ts +++ b/components/date-picker/style/index.ts @@ -655,7 +655,7 @@ export const genPanelStyle = (token: SharedPickerToken): CSSObject => { }, }, [`${componentCls}-cell-range-hover-end::after`]: { - insetInlineEnd: hoverCellFixedDistance, + insetInlineEnd: 0, borderInlineEnd: `${lineWidth}px dashed ${pickerDateHoverRangeBorderColor}`, borderStartStartRadius: 0, borderBottomStartRadius: 0, From 9bc6be7f25d8eeefabbdeb3008baa5ab18dfb32d Mon Sep 17 00:00:00 2001 From: CCherry07 <2405693142@qq.com> Date: Mon, 20 Mar 2023 21:52:13 +0800 Subject: [PATCH 2/3] feat: be consistent with antd --- components/date-picker/style/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/date-picker/style/index.ts b/components/date-picker/style/index.ts index e8bbc50ab5..445f160843 100644 --- a/components/date-picker/style/index.ts +++ b/components/date-picker/style/index.ts @@ -332,7 +332,7 @@ export const genPanelStyle = (token: SharedPickerToken): CSSObject => { const pickerPanelWidth = pickerPanelCellWidth * 7 + paddingSM * 2 + 4; const hoverCellFixedDistance = - (pickerPanelWidth - paddingXS * 2) / 3 - pickerYearMonthCellWidth / 2; + (pickerPanelWidth - paddingXS * 2) / 3 - pickerYearMonthCellWidth - paddingXS - 4; return { [componentCls]: { @@ -655,7 +655,7 @@ export const genPanelStyle = (token: SharedPickerToken): CSSObject => { }, }, [`${componentCls}-cell-range-hover-end::after`]: { - insetInlineEnd: 0, + insetInlineEnd: hoverCellFixedDistance, borderInlineEnd: `${lineWidth}px dashed ${pickerDateHoverRangeBorderColor}`, borderStartStartRadius: 0, borderBottomStartRadius: 0, From f3e671f3e7075daee8d21cb8bda5428b5e2fea52 Mon Sep 17 00:00:00 2001 From: CCherry07 <2405693142@qq.com> Date: Mon, 20 Mar 2023 22:53:28 +0800 Subject: [PATCH 3/3] feat: be consistent with antd --- components/date-picker/style/index.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/components/date-picker/style/index.ts b/components/date-picker/style/index.ts index 445f160843..4e92852fd3 100644 --- a/components/date-picker/style/index.ts +++ b/components/date-picker/style/index.ts @@ -331,8 +331,9 @@ export const genPanelStyle = (token: SharedPickerToken): CSSObject => { } = token; const pickerPanelWidth = pickerPanelCellWidth * 7 + paddingSM * 2 + 4; + const hoverCellFixedDistance = - (pickerPanelWidth - paddingXS * 2) / 3 - pickerYearMonthCellWidth - paddingXS - 4; + (pickerPanelWidth - paddingXS * 2) / 3 - pickerYearMonthCellWidth - paddingSM; return { [componentCls]: { @@ -658,17 +659,17 @@ export const genPanelStyle = (token: SharedPickerToken): CSSObject => { insetInlineEnd: hoverCellFixedDistance, borderInlineEnd: `${lineWidth}px dashed ${pickerDateHoverRangeBorderColor}`, borderStartStartRadius: 0, - borderBottomStartRadius: 0, + borderEndStartRadius: 0, borderStartEndRadius: borderRadius, - borderBottomEndRadius: borderRadius, + borderEndEndRadius: borderRadius, [`${componentCls}-panel-rtl &`]: { insetInlineStart: hoverCellFixedDistance, borderInlineStart: `${lineWidth}px dashed ${pickerDateHoverRangeBorderColor}`, borderStartStartRadius: borderRadius, - borderBottomStartRadius: borderRadius, + borderEndStartRadius: borderRadius, borderStartEndRadius: 0, - borderBottomEndRadius: 0, + borderEndEndRadius: 0, }, }, }, @@ -1429,6 +1430,7 @@ export default genComponentStyleHook( initInputToken>(token), initPickerPanelToken(token), ); + return [ genPickerStyle(pickerToken), genPickerStatusStyle(pickerToken),