From da1d8df417052ce24a70765781dd83560eddd8fe Mon Sep 17 00:00:00 2001 From: thinkasany <480968828@qq.com> Date: Sun, 14 Jul 2024 00:36:43 +0800 Subject: [PATCH] type: support string | number (#49810) (#49855) * type(token): height / width support string | number * rever --- components/badge/style/index.ts | 4 ++-- components/calendar/style/index.ts | 12 ++++++------ components/card/style/index.ts | 8 ++++---- components/carousel/style/index.ts | 6 +++--- components/cascader/style/index.ts | 6 +++--- components/empty/style/index.ts | 2 +- components/form/style/index.ts | 2 +- components/layout/style/index.ts | 2 +- components/list/style/index.ts | 4 ++-- components/mentions/style/index.ts | 4 ++-- components/menu/style/index.ts | 14 +++++++------- components/modal/style/index.ts | 4 ++-- components/notification/style/index.ts | 4 ++-- components/popover/style/index.ts | 6 +++--- components/result/style/index.ts | 4 ++-- components/skeleton/style/index.ts | 2 +- components/slider/style/index.ts | 4 ++-- components/spin/style/index.ts | 2 +- components/steps/style/index.ts | 2 +- components/switch/style/index.ts | 8 ++++---- components/table/style/index.ts | 6 +++--- components/tabs/style/index.ts | 6 +++--- components/timeline/style/index.ts | 4 ++-- components/tour/style/index.ts | 4 ++-- components/transfer/style/index.ts | 12 ++++++------ 25 files changed, 66 insertions(+), 66 deletions(-) diff --git a/components/badge/style/index.ts b/components/badge/style/index.ts index ab785e6647..e4bb83f70c 100644 --- a/components/badge/style/index.ts +++ b/components/badge/style/index.ts @@ -17,12 +17,12 @@ export interface ComponentToken { * @desc 徽标高度 * @descEN Height of badge */ - indicatorHeight: number; + indicatorHeight: number | string; /** * @desc 小号徽标高度 * @descEN Height of small badge */ - indicatorHeightSM: number; + indicatorHeightSM: number | string; /** * @desc 点状徽标尺寸 * @descEN Size of dot badge diff --git a/components/calendar/style/index.ts b/components/calendar/style/index.ts index e4d126a49c..43552cbdd4 100644 --- a/components/calendar/style/index.ts +++ b/components/calendar/style/index.ts @@ -16,17 +16,17 @@ export interface ComponentToken { * @desc 年选择器宽度 * @descEN Width of year select */ - yearControlWidth: number; + yearControlWidth: number | string; /** * @desc 月选择器宽度 * @descEN Width of month select */ - monthControlWidth: number; + monthControlWidth: number | string; /** * @desc 迷你日历内容高度 * @descEN Height of mini calendar content */ - miniContentHeight: number; + miniContentHeight: number | string; /** * @desc 完整日历背景色 * @descEN Background color of full calendar @@ -46,9 +46,9 @@ export interface ComponentToken { interface CalendarToken extends FullToken<'Calendar'>, PickerPanelToken, PanelComponentToken { calendarCls: string; - dateValueHeight: number; - weekHeight: number; - dateContentHeight: number; + dateValueHeight: number | string; + weekHeight: number | string; + dateContentHeight: number | string; } export const genCalendarStyles = (token: CalendarToken): CSSObject => { diff --git a/components/card/style/index.ts b/components/card/style/index.ts index 72a113accd..ad515dc647 100644 --- a/components/card/style/index.ts +++ b/components/card/style/index.ts @@ -15,22 +15,22 @@ export interface ComponentToken { * @desc 卡片头部文字大小 * @descEN Font size of card header */ - headerFontSize: number; + headerFontSize: number | string; /** * @desc 小号卡片头部文字大小 * @descEN Font size of small card header */ - headerFontSizeSM: number; + headerFontSizeSM: number | string; /** * @desc 卡片头部高度 * @descEN Height of card header */ - headerHeight: number; + headerHeight: number | string; /** * @desc 小号卡片头部高度 * @descEN Height of small card header */ - headerHeightSM: number; + headerHeightSM: number | string; /** * @desc 操作区背景色 * @descEN Background color of card actions diff --git a/components/carousel/style/index.ts b/components/carousel/style/index.ts index 247481c00e..f3d92ee8c0 100644 --- a/components/carousel/style/index.ts +++ b/components/carousel/style/index.ts @@ -9,12 +9,12 @@ export interface ComponentToken { * @desc 指示点宽度 * @descEN Width of indicator */ - dotWidth: number; + dotWidth: number | string; /** * @desc 指示点高度 * @descEN Height of indicator */ - dotHeight: number; + dotHeight: number | string; /** * @desc 指示点之间的间距 * @descEN gap between indicator @@ -31,7 +31,7 @@ export interface ComponentToken { * @desc 激活态指示点宽度 * @descEN Width of active indicator */ - dotActiveWidth: number; + dotActiveWidth: number | string; /** * @desc 切换箭头大小 * @descEN Size of arrows diff --git a/components/cascader/style/index.ts b/components/cascader/style/index.ts index 7b03acd1a1..cf7b251b55 100644 --- a/components/cascader/style/index.ts +++ b/components/cascader/style/index.ts @@ -11,17 +11,17 @@ export interface ComponentToken { * @desc 选择器宽度 * @descEN Width of Cascader */ - controlWidth: number; + controlWidth: number | string; /** * @desc 选项宽度 * @descEN Width of item */ - controlItemWidth: number; + controlItemWidth: number | string; /** * @desc 下拉菜单高度 * @descEN Height of dropdown */ - dropdownHeight: number; + dropdownHeight: number | string; /** * @desc 选项选中时背景色 * @descEN Background color of selected item diff --git a/components/empty/style/index.ts b/components/empty/style/index.ts index 407efb8b33..cab541407c 100644 --- a/components/empty/style/index.ts +++ b/components/empty/style/index.ts @@ -11,7 +11,7 @@ interface EmptyToken extends FullToken<'Empty'> { emptyImgCls: string; emptyImgHeight: number | string; emptyImgHeightSM: number | string; - emptyImgHeightMD: number; + emptyImgHeightMD: number | string; } // ============================== Shared ============================== diff --git a/components/form/style/index.ts b/components/form/style/index.ts index ab41b07a1b..e2bfab692d 100644 --- a/components/form/style/index.ts +++ b/components/form/style/index.ts @@ -29,7 +29,7 @@ export interface ComponentToken { * @desc 标签高度 * @descEN Label height */ - labelHeight: number; + labelHeight: number | string; /** * @desc 标签冒号前间距 * @descEN Label colon margin-inline-start diff --git a/components/layout/style/index.ts b/components/layout/style/index.ts index 457f5d2226..33071f490c 100644 --- a/components/layout/style/index.ts +++ b/components/layout/style/index.ts @@ -58,7 +58,7 @@ export interface ComponentToken { * @desc 侧边栏开关高度 * @descEN Height of sider trigger */ - triggerHeight: number; + triggerHeight: number | string; /** * @desc 侧边栏开关背景色 * @descEN Background Color of sider trigger diff --git a/components/list/style/index.ts b/components/list/style/index.ts index 96898832bb..390f23e84c 100644 --- a/components/list/style/index.ts +++ b/components/list/style/index.ts @@ -11,7 +11,7 @@ export interface ComponentToken { * @desc 内容宽度 * @descEN Width of content */ - contentWidth: number; + contentWidth: number | string; /** * @desc 大号列表项内间距 * @descEN Padding of large item @@ -66,7 +66,7 @@ export interface ComponentToken { interface ListToken extends FullToken<'List'> { listBorderedCls: string; - minHeight: number; + minHeight: number | string; } const genBorderedStyle = (token: ListToken): CSSObject => { diff --git a/components/mentions/style/index.ts b/components/mentions/style/index.ts index 919c7e091b..b2ac18dff9 100644 --- a/components/mentions/style/index.ts +++ b/components/mentions/style/index.ts @@ -27,12 +27,12 @@ export interface ComponentToken extends SharedComponentToken { * @desc 弹层高度 * @descEN Height of popup */ - dropdownHeight: number; + dropdownHeight: number | string; /** * @desc 菜单项高度 * @descEN Height of menu item */ - controlItemWidth: number; + controlItemWidth: number | string; } type MentionsToken = FullToken<'Mentions'> & diff --git a/components/menu/style/index.ts b/components/menu/style/index.ts index 3c2655262a..521ca0e3c1 100644 --- a/components/menu/style/index.ts +++ b/components/menu/style/index.ts @@ -19,7 +19,7 @@ export interface ComponentToken { * @desc 弹出菜单的宽度 * @descEN Width of popup menu */ - dropdownWidth: number; + dropdownWidth: number | string; /** * @desc 弹出菜单的 z-index * @descEN z-index of popup menu @@ -205,12 +205,12 @@ export interface ComponentToken { // Ink Bar /** @deprecated Use `activeBarWidth` instead */ - colorActiveBarWidth: number; + colorActiveBarWidth: number | string; /** * @desc 菜单项指示条宽度 * @descEN Width of menu item active bar */ - activeBarWidth: number; + activeBarWidth: number | string; /** @deprecated Use `activeBarHeight` instead */ colorActiveBarHeight: number; @@ -226,7 +226,7 @@ export interface ComponentToken { * @desc 菜单项指示条边框宽度 * @descEN Border width of menu item active bar */ - activeBarBorderWidth: number; + activeBarBorderWidth: number | string; /** * @desc 菜单项横向外间距 @@ -247,12 +247,12 @@ export interface ComponentToken { * @desc 菜单项高度 * @descEN Height of menu item */ - itemHeight: number; + itemHeight: number | string; /** * @desc 收起后的宽度 * @descEN Width when collapsed */ - collapsedWidth: number; + collapsedWidth: number | string; /** * @desc 弹出框背景色 * @descEN Background color of popup @@ -366,7 +366,7 @@ export interface ComponentToken { */ darkDangerItemActiveBg: string; /** @internal */ - itemWidth: string; + itemWidth: number | string; } export interface MenuToken extends FullToken<'Menu'> { diff --git a/components/modal/style/index.ts b/components/modal/style/index.ts index bcd2882608..d29679b9a4 100644 --- a/components/modal/style/index.ts +++ b/components/modal/style/index.ts @@ -20,7 +20,7 @@ export interface ComponentToken { * @desc 标题行高 * @descEN Line height of title */ - titleLineHeight: number; + titleLineHeight: number | string; /** * @desc 标题字体大小 * @descEN Font size of title @@ -73,7 +73,7 @@ export interface ModalToken extends FullToken<'Modal'> { modalHeaderHeight: number | string; modalFooterBorderColorSplit: string; modalFooterBorderStyle: string; - modalFooterBorderWidth: number; + modalFooterBorderWidth: number | string; modalCloseIconColor: string; modalCloseIconHoverColor: string; modalCloseBtnSize: number | string; diff --git a/components/notification/style/index.ts b/components/notification/style/index.ts index 2bbc3356ab..6baad8ea55 100644 --- a/components/notification/style/index.ts +++ b/components/notification/style/index.ts @@ -20,11 +20,11 @@ export interface ComponentToken { * @desc 提醒框宽度 * @descEN Width of Notification */ - width: number; + width: number | string; } export interface NotificationToken extends FullToken<'Notification'> { - animationMaxHeight: number; + animationMaxHeight: number | string; notificationBg: string; notificationPadding: string; notificationPaddingVertical: number; diff --git a/components/popover/style/index.ts b/components/popover/style/index.ts index 69b273627b..2cbaf02cf0 100644 --- a/components/popover/style/index.ts +++ b/components/popover/style/index.ts @@ -18,18 +18,18 @@ export interface ComponentToken extends ArrowToken, ArrowOffsetToken { * @desc 气泡卡片宽度 * @descEN Width of Popover */ - width?: number; + width?: number | string; /** * @deprecated Please use `titleMinWidth` instead * @desc 气泡卡片最小宽度 * @descEN Min width of Popover */ - minWidth?: number; + minWidth?: number | string; /** * @desc 气泡卡片标题最小宽度 * @descEN Min width of Popover title */ - titleMinWidth: number; + titleMinWidth: number | string; /** * @desc 气泡卡片 z-index * @descEN z-index of Popover diff --git a/components/result/style/index.ts b/components/result/style/index.ts index b8a454c04a..7d1d793a7d 100644 --- a/components/result/style/index.ts +++ b/components/result/style/index.ts @@ -29,8 +29,8 @@ export interface ComponentToken { } interface ResultToken extends FullToken<'Result'> { - imageWidth: number; - imageHeight: number; + imageWidth: number | string; + imageHeight: number | string; resultInfoIconColor: string; resultSuccessIconColor: string; resultWarningIconColor: string; diff --git a/components/skeleton/style/index.ts b/components/skeleton/style/index.ts index 934202d802..7a225353a6 100644 --- a/components/skeleton/style/index.ts +++ b/components/skeleton/style/index.ts @@ -24,7 +24,7 @@ export type ComponentToken = { * @desc 标题骨架屏高度 * @descEN Height of title skeleton */ - titleHeight: number; + titleHeight: number | string; /** * @desc 骨架屏圆角 * @descEN Border radius of skeleton diff --git a/components/slider/style/index.ts b/components/slider/style/index.ts index 164d4d6d73..4d972e486a 100644 --- a/components/slider/style/index.ts +++ b/components/slider/style/index.ts @@ -38,12 +38,12 @@ export interface ComponentToken { * @desc 滑块边框宽度 * @descEN Border width of handle */ - handleLineWidth: number; + handleLineWidth: number | string; /** * @desc 滑块边框宽度(悬浮态) * @descEN Border width of handle when hover */ - handleLineWidthHover: number; + handleLineWidthHover: number | string; /** * @desc 滑块圆点尺寸 * @descEN Size of dot diff --git a/components/spin/style/index.ts b/components/spin/style/index.ts index f96c53f68e..e047acf1e3 100644 --- a/components/spin/style/index.ts +++ b/components/spin/style/index.ts @@ -10,7 +10,7 @@ export interface ComponentToken { * @desc 内容区域高度 * @descEN Height of content area */ - contentHeight: number; + contentHeight: number | string; /** * @desc 加载图标尺寸 * @descEN Loading icon size diff --git a/components/steps/style/index.ts b/components/steps/style/index.ts index 1c1e05d607..352de57230 100644 --- a/components/steps/style/index.ts +++ b/components/steps/style/index.ts @@ -81,7 +81,7 @@ export interface ComponentToken { * @desc 标题行高 * @descEN Line height of title */ - titleLineHeight: number; + titleLineHeight: number | string; /** * @internal */ diff --git a/components/switch/style/index.ts b/components/switch/style/index.ts index 4bb34c53a7..6af3a71668 100644 --- a/components/switch/style/index.ts +++ b/components/switch/style/index.ts @@ -11,22 +11,22 @@ export interface ComponentToken { * @desc 开关高度 * @descEN Height of Switch */ - trackHeight: number; + trackHeight: number | string; /** * @desc 小号开关高度 * @descEN Height of small Switch */ - trackHeightSM: number; + trackHeightSM: number | string; /** * @desc 开关最小宽度 * @descEN Minimum width of Switch */ - trackMinWidth: number; + trackMinWidth: number | string; /** * @desc 小号开关最小宽度 * @descEN Minimum width of small Switch */ - trackMinWidthSM: number; + trackMinWidthSM: number | string; /** * @desc 开关内边距 * @descEN Padding of Switch diff --git a/components/table/style/index.ts b/components/table/style/index.ts index 0e675f05ad..d41d2731d6 100644 --- a/components/table/style/index.ts +++ b/components/table/style/index.ts @@ -166,7 +166,7 @@ export interface ComponentToken { * @desc 选择列宽度 * @descEN Width of selection column */ - selectionColumnWidth: number; + selectionColumnWidth: number | string; /** * @desc Sticky 模式下滚动条背景色 * @descEN Background of sticky scrollbar @@ -214,14 +214,14 @@ export interface TableToken extends FullToken<'Table'> { tableFixedHeaderSortActiveBg: string; tableHeaderFilterActiveBg: string; tableFilterDropdownBg: string; - tableFilterDropdownHeight: number; + tableFilterDropdownHeight: number | string; tableRowHoverBg: string; tableSelectedRowBg: string; tableSelectedRowHoverBg: string; tableFontSizeMiddle: number; tableFontSizeSmall: number; - tableSelectionColumnWidth: number; + tableSelectionColumnWidth: number | string; tableExpandIconBg: string; tableExpandColumnWidth: number | string; tableExpandedRowBg: string; diff --git a/components/tabs/style/index.ts b/components/tabs/style/index.ts index b88be98550..a9c3d18df9 100644 --- a/components/tabs/style/index.ts +++ b/components/tabs/style/index.ts @@ -21,7 +21,7 @@ export interface ComponentToken { * @desc 卡片标签页高度 * @descEN Height of card tab */ - cardHeight: number; + cardHeight: number | string; /** * @desc 卡片标签页内间距 * @descEN Padding of card tab @@ -134,8 +134,8 @@ export interface TabsToken extends FullToken<'Tabs'> { dropdownEdgeChildVerticalPadding: number; tabsNavWrapPseudoWidth: number; tabsActiveTextShadow: string; - tabsDropdownHeight: number; - tabsDropdownWidth: number; + tabsDropdownHeight: number | string; + tabsDropdownWidth: number | string; tabsHorizontalItemMargin: string; tabsHorizontalItemMarginRTL: string; } diff --git a/components/timeline/style/index.ts b/components/timeline/style/index.ts index ff219c63bc..9bc8485119 100644 --- a/components/timeline/style/index.ts +++ b/components/timeline/style/index.ts @@ -15,12 +15,12 @@ export interface ComponentToken { * @desc 轨迹宽度 * @descEN Line width */ - tailWidth: number; + tailWidth: number | string; /** * @desc 节点边框宽度 * @descEN Border width of node */ - dotBorderWidth: number; + dotBorderWidth: number | string; /** * @desc 节点背景色 * @descEN Background color of node diff --git a/components/tour/style/index.ts b/components/tour/style/index.ts index 43695a3db3..2a4b76d14d 100644 --- a/components/tour/style/index.ts +++ b/components/tour/style/index.ts @@ -37,8 +37,8 @@ export interface ComponentToken extends ArrowOffsetToken, ArrowToken { interface TourToken extends FullToken<'Tour'> { tourZIndexPopup: number; - indicatorWidth: number; - indicatorHeight: number; + indicatorWidth: number | string; + indicatorHeight: number | string; tourBorderRadius: number; } diff --git a/components/transfer/style/index.ts b/components/transfer/style/index.ts index cee0e5892a..d7107c71bc 100644 --- a/components/transfer/style/index.ts +++ b/components/transfer/style/index.ts @@ -10,32 +10,32 @@ export interface ComponentToken { * @desc 列表宽度 * @descEN Width of list */ - listWidth: number; + listWidth: number | string; /** * @desc 大号列表宽度 * @descEN Width of large list */ - listWidthLG: number; + listWidthLG: number | string; /** * @desc 列表高度 * @descEN Height of list */ - listHeight: number; + listHeight: number | string; /** * @desc 列表项高度 * @descEN Height of list item */ - itemHeight: number; + itemHeight: number | string; /** * @desc 列表项纵向内边距 * @descEN Vertical padding of list item */ - itemPaddingBlock: number; + itemPaddingBlock: number | string; /** * @desc 顶部高度 * @descEN Height of header */ - headerHeight: number; + headerHeight: number | string; } interface TransferToken extends FullToken<'Transfer'> {