mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-27 12:39:49 +08:00
* type(token): height / width support string | number * rever
This commit is contained in:
parent
d9f70d738c
commit
da1d8df417
@ -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
|
||||
|
@ -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 => {
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -11,7 +11,7 @@ interface EmptyToken extends FullToken<'Empty'> {
|
||||
emptyImgCls: string;
|
||||
emptyImgHeight: number | string;
|
||||
emptyImgHeightSM: number | string;
|
||||
emptyImgHeightMD: number;
|
||||
emptyImgHeightMD: number | string;
|
||||
}
|
||||
|
||||
// ============================== Shared ==============================
|
||||
|
@ -29,7 +29,7 @@ export interface ComponentToken {
|
||||
* @desc 标签高度
|
||||
* @descEN Label height
|
||||
*/
|
||||
labelHeight: number;
|
||||
labelHeight: number | string;
|
||||
/**
|
||||
* @desc 标签冒号前间距
|
||||
* @descEN Label colon margin-inline-start
|
||||
|
@ -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
|
||||
|
@ -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 => {
|
||||
|
@ -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'> &
|
||||
|
@ -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'> {
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
|
@ -24,7 +24,7 @@ export type ComponentToken = {
|
||||
* @desc 标题骨架屏高度
|
||||
* @descEN Height of title skeleton
|
||||
*/
|
||||
titleHeight: number;
|
||||
titleHeight: number | string;
|
||||
/**
|
||||
* @desc 骨架屏圆角
|
||||
* @descEN Border radius of skeleton
|
||||
|
@ -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
|
||||
|
@ -10,7 +10,7 @@ export interface ComponentToken {
|
||||
* @desc 内容区域高度
|
||||
* @descEN Height of content area
|
||||
*/
|
||||
contentHeight: number;
|
||||
contentHeight: number | string;
|
||||
/**
|
||||
* @desc 加载图标尺寸
|
||||
* @descEN Loading icon size
|
||||
|
@ -81,7 +81,7 @@ export interface ComponentToken {
|
||||
* @desc 标题行高
|
||||
* @descEN Line height of title
|
||||
*/
|
||||
titleLineHeight: number;
|
||||
titleLineHeight: number | string;
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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'> {
|
||||
|
Loading…
Reference in New Issue
Block a user