Skip to content

Commit

Permalink
fix(DatePicker): optimize RangePicker's range area style (ant-design#…
Browse files Browse the repository at this point in the history
…44206)

* feat: optimize range-picker's range area style

* feat: optimize range-picker's range area style

* feat: optimize range-picker's range area style
  • Loading branch information
kiner-tang committed Aug 14, 2023
1 parent e0e373f commit 41cb8be
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,7 @@ export default function generateRangePicker<DateType>(generateConfig: GenerateCo

const [wrapSSR, hashId] = useStyle(prefixCls);

let additionalOverrideProps: any = {};
additionalOverrideProps = {
...additionalOverrideProps,
const additionalOverrideProps: any = {
...(showTime ? getTimeProps({ format, picker, ...showTime }) : {}),
...(picker === 'time' ? getTimeProps({ format, ...props, picker }) : {}),
};
Expand Down
14 changes: 10 additions & 4 deletions components/date-picker/style/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,12 @@ const genPickerCellInnerStyle = (token: SharedPickerToken): CSSObject => {
borderRadius: borderRadiusSM,
transition: `background ${motionDurationMid}, border ${motionDurationMid}`,
},
[`&-range-hover-start, &-range-hover-end`]: {
[pickerCellInnerCls]: {
borderStartEndRadius: 0,
borderEndEndRadius: 0,
},
},

// >>> Hover
[`&:hover:not(${pickerCellCls}-in-view),
Expand Down Expand Up @@ -263,8 +269,8 @@ const genPickerCellInnerStyle = (token: SharedPickerToken): CSSObject => {
&-in-view${pickerCellCls}-range-hover-start::after`]: {
insetInlineStart: (pickerPanelCellWidth - pickerPanelCellHeight) / 2,
borderInlineStart: `${lineWidth}px dashed ${pickerDateHoverRangeBorderColor}`,
borderStartStartRadius: lineWidth,
borderEndStartRadius: lineWidth,
borderStartStartRadius: borderRadiusSM,
borderEndStartRadius: borderRadiusSM,
},

// Edge end
Expand All @@ -275,8 +281,8 @@ const genPickerCellInnerStyle = (token: SharedPickerToken): CSSObject => {
&-in-view${pickerCellCls}-range-hover-end::after`]: {
insetInlineEnd: (pickerPanelCellWidth - pickerPanelCellHeight) / 2,
borderInlineEnd: `${lineWidth}px dashed ${pickerDateHoverRangeBorderColor}`,
borderStartEndRadius: lineWidth,
borderEndEndRadius: lineWidth,
borderStartEndRadius: borderRadiusSM,
borderEndEndRadius: borderRadiusSM,
},

// >>> Disabled
Expand Down

0 comments on commit 41cb8be

Please sign in to comment.