From 7c4109601a60944eba5170e881b1088b43e5f89e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=B9=A4=E4=BB=99?= Date: Mon, 30 Dec 2024 17:13:42 +0800 Subject: [PATCH] feat(RangeSelector): add -input-start and -input-end className to differ inputs --- src/PickerInput/Selector/Input.tsx | 13 ++++++++---- src/PickerInput/Selector/RangeSelector.tsx | 6 ++++-- tests/__snapshots__/range.spec.tsx.snap | 24 +++++++++++----------- 3 files changed, 25 insertions(+), 18 deletions(-) diff --git a/src/PickerInput/Selector/Input.tsx b/src/PickerInput/Selector/Input.tsx index 9bf9d7edb..fe92e83e3 100644 --- a/src/PickerInput/Selector/Input.tsx +++ b/src/PickerInput/Selector/Input.tsx @@ -52,6 +52,7 @@ export interface InputProps extends Omit((props, ref) => { const { + className, active, showActiveCls = true, suffixIcon, @@ -377,10 +378,14 @@ const Input = React.forwardRef((props, ref) => { return (
( if (input) { const { offsetWidth, offsetLeft, offsetParent } = input.nativeElement; const parentWidth = (offsetParent as HTMLElement)?.offsetWidth || 0; - const activeOffset = placementRight ? (parentWidth - offsetWidth - offsetLeft) : offsetLeft; + const activeOffset = placementRight ? parentWidth - offsetWidth - offsetLeft : offsetLeft; setActiveBarStyle(({ insetInlineStart, insetInlineEnd, ...rest }) => ({ ...rest, width: offsetWidth, - [offsetUnit]: activeOffset + [offsetUnit]: activeOffset, })); onActiveOffset(activeOffset); } @@ -243,6 +243,7 @@ function RangeSelector( (