From 6206ef7906b3037963f69d8e9d861ccc53078aa2 Mon Sep 17 00:00:00 2001 From: dengfuping Date: Sat, 14 Dec 2024 18:59:10 +0800 Subject: [PATCH] improve(ui): DateRanger border-radius style --- packages/ui/src/DateRanger/Ranger.tsx | 18 ++++++++++++++---- .../src/DateRanger/demo/updateCurrentTime.tsx | 8 +++----- packages/ui/src/DateRanger/index.less | 8 ++++++-- packages/ui/src/DateRanger/index.md | 2 +- 4 files changed, 24 insertions(+), 12 deletions(-) diff --git a/packages/ui/src/DateRanger/Ranger.tsx b/packages/ui/src/DateRanger/Ranger.tsx index efe3184ff..546034c2c 100644 --- a/packages/ui/src/DateRanger/Ranger.tsx +++ b/packages/ui/src/DateRanger/Ranger.tsx @@ -350,7 +350,11 @@ const Ranger = React.forwardRef((props: DateRangerProps, ref) => { style={rest.style} > -
+
{ > {/* @ts-ignore */} { style={{ paddingInline: 8, borderInlineStart: 0, - borderRadius: 0, + borderTopLeftRadius: 0, + borderBottomLeftRadius: 0, }} onMouseEnter={() => setBackRadioFocused(true)} onMouseLeave={() => setBackRadioFocused(false)} @@ -526,7 +531,12 @@ const Ranger = React.forwardRef((props: DateRangerProps, ref) => { > { if (startTime && endTime) { diff --git a/packages/ui/src/DateRanger/demo/updateCurrentTime.tsx b/packages/ui/src/DateRanger/demo/updateCurrentTime.tsx index 7ba807c61..8dabdc190 100644 --- a/packages/ui/src/DateRanger/demo/updateCurrentTime.tsx +++ b/packages/ui/src/DateRanger/demo/updateCurrentTime.tsx @@ -10,6 +10,7 @@ type TimeRangeRef = { export default () => { const ref = useRef(); const [timeRange, setTimeRange] = useState([]); + const format = 'YYYY-MM-DD HH:mm:ss'; return (
@@ -19,17 +20,14 @@ export default () => { ref.current.updateCurrentTime(); }} > - 更新最新时间 + 从外部更新时间 {timeRange.length && ( - {`${dayjs(timeRange[0]).format('YYYY-MM-DD HH:mm:ss')} ~ ${dayjs(timeRange[1]).format( - 'YYYY-MM-DD HH:mm:ss' - )}`} + {`${dayjs(timeRange[0]).format(format)} ~ ${dayjs(timeRange[1]).format(format)}`} )} - - + ## API