From fcea6b6691f8f1d5448ae291d06553389ad3f9e6 Mon Sep 17 00:00:00 2001 From: Wanpan Date: Tue, 15 Oct 2024 09:51:19 +0800 Subject: [PATCH] fix: Splitter token rename (#51223) Co-authored-by: afc163 --- components/splitter/style/index.ts | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/components/splitter/style/index.ts b/components/splitter/style/index.ts index 221d0b1b2d..06a96d6b3f 100644 --- a/components/splitter/style/index.ts +++ b/components/splitter/style/index.ts @@ -6,12 +6,18 @@ import { genStyleHooks } from '../../theme/internal'; export interface ComponentToken { /** - * @desc 可改变大小标识 元素大小 - * @descEN Height of content area + * @desc 拖拽标识元素大小 + * @descEN Drag and drop the identity element size + * @deprecated Please use `splitBarDraggableSize` instead. */ resizeSpinnerSize: number; /** * @desc 拖拽标识元素大小 + * @descEN Drag and drop the identity element size + */ + splitBarDraggableSize: number; + /** + * @desc 拖拽元素大小 * @descEN Drag the element size */ splitBarSize: number; @@ -71,7 +77,7 @@ const genSplitterStyle: GenerateStyle = (token: SplitterToken): C const { componentCls, colorFill, - resizeSpinnerSize, + splitBarDraggableSize, splitBarSize, splitTriggerSize, controlItemBgHover, @@ -223,7 +229,7 @@ const genSplitterStyle: GenerateStyle = (token: SplitterToken): C }, '&:after': { - height: resizeSpinnerSize, + height: splitBarDraggableSize, width: splitBarSize, }, }, @@ -278,7 +284,7 @@ const genSplitterStyle: GenerateStyle = (token: SplitterToken): C }, '&:after': { - width: resizeSpinnerSize, + width: splitBarDraggableSize, height: splitBarSize, }, }, @@ -329,11 +335,14 @@ export const prepareComponentToken: GetDefaultToken<'Splitter'> = (token) => { const splitBarSize = token.splitBarSize || 2; const splitTriggerSize = token.splitTriggerSize || 6; + // https://github.com/ant-design/ant-design/pull/51223 const resizeSpinnerSize = token.resizeSpinnerSize || 20; + const splitBarDraggableSize = token.splitBarDraggableSize ?? resizeSpinnerSize; return { splitBarSize, splitTriggerSize, + splitBarDraggableSize, resizeSpinnerSize, }; };