2022-05-09 22:20:07 +08:00
|
|
|
|
import type { CSSObject } from '@ant-design/cssinjs';
|
2022-09-20 21:50:36 +08:00
|
|
|
|
import { TinyColor } from '@ctrl/tinycolor';
|
2023-02-19 16:24:20 +08:00
|
|
|
|
import type * as React from 'react';
|
|
|
|
|
import { resetComponent } from '../../style';
|
2022-11-23 20:22:38 +08:00
|
|
|
|
import type { FullToken, GenerateStyle } from '../../theme/internal';
|
|
|
|
|
import { genComponentStyleHook, mergeToken } from '../../theme/internal';
|
2022-03-14 19:12:10 +08:00
|
|
|
|
|
2022-03-29 15:57:39 +08:00
|
|
|
|
// Direction naming standard:
|
|
|
|
|
// Horizontal base:
|
|
|
|
|
// -0-------------
|
|
|
|
|
// vertical: part (水平时,垂直方向命名为 part)
|
|
|
|
|
// horizontal: full (水平时,水平方向命名为 full)
|
|
|
|
|
|
|
|
|
|
export interface ComponentToken {
|
2023-07-05 17:49:59 +08:00
|
|
|
|
/**
|
|
|
|
|
* @desc 滑动输入高度
|
|
|
|
|
* @descEN Height of slider
|
|
|
|
|
*/
|
2022-03-29 15:57:39 +08:00
|
|
|
|
controlSize: number;
|
2023-07-05 17:49:59 +08:00
|
|
|
|
/**
|
|
|
|
|
* @desc 轨道高度
|
|
|
|
|
* @descEN Height of rail
|
|
|
|
|
*/
|
2022-03-14 19:12:10 +08:00
|
|
|
|
railSize: number;
|
2023-07-05 17:49:59 +08:00
|
|
|
|
/**
|
|
|
|
|
* @desc 滑块尺寸
|
|
|
|
|
* @descEN Size of handle
|
|
|
|
|
*/
|
2022-03-29 15:57:39 +08:00
|
|
|
|
handleSize: number;
|
2023-07-05 17:49:59 +08:00
|
|
|
|
/**
|
|
|
|
|
* @desc 滑块尺寸(悬浮态)
|
|
|
|
|
* @descEN Size of handle when hover
|
|
|
|
|
*/
|
2022-09-20 21:50:36 +08:00
|
|
|
|
handleSizeHover: number;
|
2023-07-05 17:49:59 +08:00
|
|
|
|
/**
|
|
|
|
|
* @desc 滑块边框宽度
|
|
|
|
|
* @descEN Border width of handle
|
|
|
|
|
*/
|
2022-09-07 12:00:00 +08:00
|
|
|
|
handleLineWidth: number;
|
2023-07-05 17:49:59 +08:00
|
|
|
|
/**
|
|
|
|
|
* @desc 滑块边框宽度(悬浮态)
|
|
|
|
|
* @descEN Border width of handle when hover
|
|
|
|
|
*/
|
2022-09-07 12:00:00 +08:00
|
|
|
|
handleLineWidthHover: number;
|
2023-07-05 17:49:59 +08:00
|
|
|
|
/**
|
|
|
|
|
* @desc 滑块圆点尺寸
|
|
|
|
|
* @descEN Size of dot
|
|
|
|
|
*/
|
2022-03-14 19:12:10 +08:00
|
|
|
|
dotSize: number;
|
|
|
|
|
}
|
|
|
|
|
|
2022-04-07 20:56:27 +08:00
|
|
|
|
interface SliderToken extends FullToken<'Slider'> {
|
2022-03-29 15:57:39 +08:00
|
|
|
|
marginFull: number;
|
|
|
|
|
marginPart: number;
|
|
|
|
|
marginPartWithMark: number;
|
|
|
|
|
}
|
|
|
|
|
|
2022-03-14 19:12:10 +08:00
|
|
|
|
// =============================== Base ===============================
|
2022-11-17 23:31:41 +08:00
|
|
|
|
const genBaseStyle: GenerateStyle<SliderToken> = (token) => {
|
2022-11-14 15:01:07 +08:00
|
|
|
|
const { componentCls, controlSize, dotSize, marginFull, marginPart, colorFillContentHover } =
|
|
|
|
|
token;
|
2022-03-14 19:12:10 +08:00
|
|
|
|
|
|
|
|
|
return {
|
2022-04-07 20:56:27 +08:00
|
|
|
|
[componentCls]: {
|
2022-03-14 19:12:10 +08:00
|
|
|
|
...resetComponent(token),
|
|
|
|
|
|
|
|
|
|
position: 'relative',
|
2022-03-29 15:57:39 +08:00
|
|
|
|
height: controlSize,
|
|
|
|
|
margin: `${marginPart}px ${marginFull}px`,
|
2022-03-14 19:12:10 +08:00
|
|
|
|
padding: 0,
|
|
|
|
|
cursor: 'pointer',
|
|
|
|
|
touchAction: 'none',
|
|
|
|
|
|
2022-03-29 15:57:39 +08:00
|
|
|
|
[`&-vertical`]: {
|
|
|
|
|
margin: `${marginFull}px ${marginPart}px`,
|
|
|
|
|
},
|
2022-03-14 19:12:10 +08:00
|
|
|
|
|
2022-04-07 20:56:27 +08:00
|
|
|
|
[`${componentCls}-rail`]: {
|
2022-03-14 19:12:10 +08:00
|
|
|
|
position: 'absolute',
|
2022-09-07 12:00:00 +08:00
|
|
|
|
backgroundColor: token.colorFillTertiary,
|
2022-11-01 15:06:38 +08:00
|
|
|
|
borderRadius: token.borderRadiusXS,
|
2022-11-17 23:31:41 +08:00
|
|
|
|
transition: `background-color ${token.motionDurationMid}`,
|
2022-03-14 19:12:10 +08:00
|
|
|
|
},
|
|
|
|
|
|
2022-04-07 20:56:27 +08:00
|
|
|
|
[`${componentCls}-track`]: {
|
2022-03-14 19:12:10 +08:00
|
|
|
|
position: 'absolute',
|
2022-06-28 20:33:01 +08:00
|
|
|
|
backgroundColor: token.colorPrimaryBorder,
|
2022-11-01 15:06:38 +08:00
|
|
|
|
borderRadius: token.borderRadiusXS,
|
2022-11-17 23:31:41 +08:00
|
|
|
|
transition: `background-color ${token.motionDurationMid}`,
|
2022-03-14 19:12:10 +08:00
|
|
|
|
},
|
|
|
|
|
|
2022-11-14 15:01:07 +08:00
|
|
|
|
'&:hover': {
|
|
|
|
|
[`${componentCls}-rail`]: {
|
|
|
|
|
backgroundColor: token.colorFillSecondary,
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
[`${componentCls}-track`]: {
|
|
|
|
|
backgroundColor: token.colorPrimaryBorderHover,
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
[`${componentCls}-dot`]: {
|
|
|
|
|
borderColor: colorFillContentHover,
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
[`${componentCls}-handle::after`]: {
|
|
|
|
|
boxShadow: `0 0 0 ${token.handleLineWidth}px ${token.colorPrimaryBorderHover}`,
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
[`${componentCls}-dot-active`]: {
|
|
|
|
|
borderColor: token.colorPrimary,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
|
2022-04-07 20:56:27 +08:00
|
|
|
|
[`${componentCls}-handle`]: {
|
2022-03-14 19:12:10 +08:00
|
|
|
|
position: 'absolute',
|
|
|
|
|
width: token.handleSize,
|
|
|
|
|
height: token.handleSize,
|
2022-11-14 15:01:07 +08:00
|
|
|
|
outline: 'none',
|
2022-03-14 19:12:10 +08:00
|
|
|
|
|
2022-04-07 20:56:27 +08:00
|
|
|
|
[`${componentCls}-dragging`]: {
|
2022-03-14 19:12:10 +08:00
|
|
|
|
zIndex: 1,
|
|
|
|
|
},
|
|
|
|
|
|
2022-09-20 21:50:36 +08:00
|
|
|
|
// 扩大选区
|
|
|
|
|
'&::before': {
|
|
|
|
|
content: '""',
|
|
|
|
|
position: 'absolute',
|
2022-11-14 15:01:07 +08:00
|
|
|
|
insetInlineStart: -token.handleLineWidth,
|
|
|
|
|
insetBlockStart: -token.handleLineWidth,
|
2022-09-20 21:50:36 +08:00
|
|
|
|
width: token.handleSize + token.handleLineWidth * 2,
|
|
|
|
|
height: token.handleSize + token.handleLineWidth * 2,
|
|
|
|
|
backgroundColor: 'transparent',
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
'&::after': {
|
|
|
|
|
content: '""',
|
|
|
|
|
position: 'absolute',
|
|
|
|
|
insetBlockStart: 0,
|
|
|
|
|
insetInlineStart: 0,
|
|
|
|
|
width: token.handleSize,
|
|
|
|
|
height: token.handleSize,
|
2022-12-09 17:52:34 +08:00
|
|
|
|
backgroundColor: token.colorBgElevated,
|
2022-10-24 15:59:56 +08:00
|
|
|
|
boxShadow: `0 0 0 ${token.handleLineWidth}px ${token.colorPrimaryBorder}`,
|
2022-09-20 21:50:36 +08:00
|
|
|
|
borderRadius: '50%',
|
|
|
|
|
cursor: 'pointer',
|
|
|
|
|
transition: `
|
2022-11-17 23:31:41 +08:00
|
|
|
|
inset-inline-start ${token.motionDurationMid},
|
|
|
|
|
inset-block-start ${token.motionDurationMid},
|
|
|
|
|
width ${token.motionDurationMid},
|
|
|
|
|
height ${token.motionDurationMid},
|
|
|
|
|
box-shadow ${token.motionDurationMid}
|
2022-09-20 21:50:36 +08:00
|
|
|
|
`,
|
|
|
|
|
},
|
|
|
|
|
|
2022-11-14 15:01:07 +08:00
|
|
|
|
'&:hover, &:active, &:focus': {
|
2022-09-20 21:50:36 +08:00
|
|
|
|
'&::before': {
|
2022-11-14 15:01:07 +08:00
|
|
|
|
insetInlineStart: -(
|
|
|
|
|
(token.handleSizeHover - token.handleSize) / 2 +
|
|
|
|
|
token.handleLineWidthHover
|
|
|
|
|
),
|
|
|
|
|
insetBlockStart: -(
|
|
|
|
|
(token.handleSizeHover - token.handleSize) / 2 +
|
|
|
|
|
token.handleLineWidthHover
|
|
|
|
|
),
|
2022-09-20 21:50:36 +08:00
|
|
|
|
width: token.handleSizeHover + token.handleLineWidthHover * 2,
|
|
|
|
|
height: token.handleSizeHover + token.handleLineWidthHover * 2,
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
'&::after': {
|
2022-10-24 15:59:56 +08:00
|
|
|
|
boxShadow: `0 0 0 ${token.handleLineWidthHover}px ${token.colorPrimary}`,
|
2022-09-20 21:50:36 +08:00
|
|
|
|
width: token.handleSizeHover,
|
|
|
|
|
height: token.handleSizeHover,
|
|
|
|
|
insetInlineStart: (token.handleSize - token.handleSizeHover) / 2,
|
|
|
|
|
insetBlockStart: (token.handleSize - token.handleSizeHover) / 2,
|
|
|
|
|
},
|
2022-03-14 19:12:10 +08:00
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
|
2022-04-07 20:56:27 +08:00
|
|
|
|
[`${componentCls}-mark`]: {
|
2022-03-14 19:12:10 +08:00
|
|
|
|
position: 'absolute',
|
|
|
|
|
fontSize: token.fontSize,
|
|
|
|
|
},
|
|
|
|
|
|
2022-04-07 20:56:27 +08:00
|
|
|
|
[`${componentCls}-mark-text`]: {
|
2022-03-14 19:12:10 +08:00
|
|
|
|
position: 'absolute',
|
|
|
|
|
display: 'inline-block',
|
2022-08-04 16:16:50 +08:00
|
|
|
|
color: token.colorTextDescription,
|
2022-03-14 19:12:10 +08:00
|
|
|
|
textAlign: 'center',
|
|
|
|
|
wordBreak: 'keep-all',
|
|
|
|
|
cursor: 'pointer',
|
|
|
|
|
userSelect: 'none',
|
|
|
|
|
|
|
|
|
|
'&-active': {
|
2022-03-22 09:37:37 +08:00
|
|
|
|
color: token.colorText,
|
2022-03-14 19:12:10 +08:00
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
|
2022-04-07 20:56:27 +08:00
|
|
|
|
[`${componentCls}-step`]: {
|
2022-03-14 19:12:10 +08:00
|
|
|
|
position: 'absolute',
|
|
|
|
|
background: 'transparent',
|
2023-02-27 16:26:19 +08:00
|
|
|
|
pointerEvents: 'none',
|
2022-03-14 19:12:10 +08:00
|
|
|
|
},
|
|
|
|
|
|
2022-04-07 20:56:27 +08:00
|
|
|
|
[`${componentCls}-dot`]: {
|
2022-03-14 19:12:10 +08:00
|
|
|
|
position: 'absolute',
|
|
|
|
|
width: dotSize,
|
|
|
|
|
height: dotSize,
|
2022-12-09 17:52:34 +08:00
|
|
|
|
backgroundColor: token.colorBgElevated,
|
|
|
|
|
border: `${token.handleLineWidth}px solid ${token.colorBorderSecondary}`,
|
2022-03-14 19:12:10 +08:00
|
|
|
|
borderRadius: '50%',
|
|
|
|
|
cursor: 'pointer',
|
2022-03-22 20:02:04 +08:00
|
|
|
|
transition: `border-color ${token.motionDurationSlow}`,
|
2023-02-27 16:26:19 +08:00
|
|
|
|
pointerEvents: 'auto',
|
2022-03-14 19:12:10 +08:00
|
|
|
|
|
|
|
|
|
'&-active': {
|
2022-06-28 20:33:01 +08:00
|
|
|
|
borderColor: token.colorPrimaryBorder,
|
2022-03-14 19:12:10 +08:00
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
|
2023-01-20 10:31:27 +08:00
|
|
|
|
[`&${componentCls}-disabled`]: {
|
2022-03-14 19:12:10 +08:00
|
|
|
|
cursor: 'not-allowed',
|
|
|
|
|
|
2022-04-07 20:56:27 +08:00
|
|
|
|
[`${componentCls}-rail`]: {
|
2022-07-21 17:00:42 +08:00
|
|
|
|
backgroundColor: `${token.colorFillSecondary} !important`,
|
2022-03-14 19:12:10 +08:00
|
|
|
|
},
|
|
|
|
|
|
2022-04-07 20:56:27 +08:00
|
|
|
|
[`${componentCls}-track`]: {
|
2022-03-22 13:26:29 +08:00
|
|
|
|
backgroundColor: `${token.colorTextDisabled} !important`,
|
2022-03-14 19:12:10 +08:00
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
[`
|
2022-04-07 20:56:27 +08:00
|
|
|
|
${componentCls}-dot
|
2022-03-14 19:12:10 +08:00
|
|
|
|
`]: {
|
2022-12-09 17:52:34 +08:00
|
|
|
|
backgroundColor: token.colorBgElevated,
|
2022-09-20 21:50:36 +08:00
|
|
|
|
borderColor: token.colorTextDisabled,
|
2022-03-14 19:12:10 +08:00
|
|
|
|
boxShadow: 'none',
|
|
|
|
|
cursor: 'not-allowed',
|
|
|
|
|
},
|
|
|
|
|
|
2022-09-20 21:50:36 +08:00
|
|
|
|
[`${componentCls}-handle::after`]: {
|
2022-12-09 17:52:34 +08:00
|
|
|
|
backgroundColor: token.colorBgElevated,
|
2022-10-24 15:59:56 +08:00
|
|
|
|
cursor: 'not-allowed',
|
2022-09-20 21:50:36 +08:00
|
|
|
|
width: token.handleSize,
|
|
|
|
|
height: token.handleSize,
|
2022-10-24 15:59:56 +08:00
|
|
|
|
boxShadow: `0 0 0 ${token.handleLineWidth}px ${new TinyColor(token.colorTextDisabled)
|
|
|
|
|
.onBackground(token.colorBgContainer)
|
2023-02-19 16:24:20 +08:00
|
|
|
|
.toHexShortString()}`,
|
2022-09-20 21:50:36 +08:00
|
|
|
|
insetInlineStart: 0,
|
|
|
|
|
insetBlockStart: 0,
|
|
|
|
|
},
|
|
|
|
|
|
2022-03-14 19:12:10 +08:00
|
|
|
|
[`
|
2022-04-07 20:56:27 +08:00
|
|
|
|
${componentCls}-mark-text,
|
|
|
|
|
${componentCls}-dot
|
2022-03-14 19:12:10 +08:00
|
|
|
|
`]: {
|
|
|
|
|
cursor: `not-allowed !important`,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// ============================ Horizontal ============================
|
|
|
|
|
const genDirectionStyle = (token: SliderToken, horizontal: boolean): CSSObject => {
|
2022-10-25 17:04:36 +08:00
|
|
|
|
const { componentCls, railSize, handleSize, dotSize } = token;
|
2022-03-14 19:12:10 +08:00
|
|
|
|
|
|
|
|
|
const railPadding: keyof React.CSSProperties = horizontal ? 'paddingBlock' : 'paddingInline';
|
2022-03-29 15:57:39 +08:00
|
|
|
|
const full: keyof React.CSSProperties = horizontal ? 'width' : 'height';
|
|
|
|
|
const part: keyof React.CSSProperties = horizontal ? 'height' : 'width';
|
2022-03-14 19:12:10 +08:00
|
|
|
|
const handlePos: keyof React.CSSProperties = horizontal ? 'insetBlockStart' : 'insetInlineStart';
|
|
|
|
|
const markInset: keyof React.CSSProperties = horizontal ? 'top' : 'insetInlineStart';
|
|
|
|
|
|
|
|
|
|
return {
|
|
|
|
|
[railPadding]: railSize,
|
2022-10-25 17:04:36 +08:00
|
|
|
|
[part]: railSize * 3,
|
2022-03-14 19:12:10 +08:00
|
|
|
|
|
2022-04-07 20:56:27 +08:00
|
|
|
|
[`${componentCls}-rail`]: {
|
2022-03-29 15:57:39 +08:00
|
|
|
|
[full]: '100%',
|
|
|
|
|
[part]: railSize,
|
2022-03-14 19:12:10 +08:00
|
|
|
|
},
|
|
|
|
|
|
2022-04-07 20:56:27 +08:00
|
|
|
|
[`${componentCls}-track`]: {
|
2022-03-29 15:57:39 +08:00
|
|
|
|
[part]: railSize,
|
2022-03-14 19:12:10 +08:00
|
|
|
|
},
|
|
|
|
|
|
2022-04-07 20:56:27 +08:00
|
|
|
|
[`${componentCls}-handle`]: {
|
2022-10-25 17:04:36 +08:00
|
|
|
|
[handlePos]: (railSize * 3 - handleSize) / 2,
|
2022-03-14 19:12:10 +08:00
|
|
|
|
},
|
|
|
|
|
|
2022-04-07 20:56:27 +08:00
|
|
|
|
[`${componentCls}-mark`]: {
|
2022-03-14 19:12:10 +08:00
|
|
|
|
// Reset all
|
|
|
|
|
insetInlineStart: 0,
|
|
|
|
|
top: 0,
|
|
|
|
|
[markInset]: handleSize,
|
2022-03-29 15:57:39 +08:00
|
|
|
|
[full]: '100%',
|
2022-03-14 19:12:10 +08:00
|
|
|
|
},
|
|
|
|
|
|
2022-04-07 20:56:27 +08:00
|
|
|
|
[`${componentCls}-step`]: {
|
2022-03-14 19:12:10 +08:00
|
|
|
|
// Reset all
|
|
|
|
|
insetInlineStart: 0,
|
|
|
|
|
top: 0,
|
|
|
|
|
[markInset]: railSize,
|
2022-03-29 15:57:39 +08:00
|
|
|
|
[full]: '100%',
|
|
|
|
|
[part]: railSize,
|
2022-03-14 19:12:10 +08:00
|
|
|
|
},
|
|
|
|
|
|
2022-04-07 20:56:27 +08:00
|
|
|
|
[`${componentCls}-dot`]: {
|
2022-03-14 19:12:10 +08:00
|
|
|
|
position: 'absolute',
|
|
|
|
|
[handlePos]: (railSize - dotSize) / 2,
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
// ============================ Horizontal ============================
|
2022-11-17 23:31:41 +08:00
|
|
|
|
const genHorizontalStyle: GenerateStyle<SliderToken> = (token) => {
|
2022-04-07 20:56:27 +08:00
|
|
|
|
const { componentCls, marginPartWithMark } = token;
|
2022-03-14 19:12:10 +08:00
|
|
|
|
|
|
|
|
|
return {
|
2022-04-07 20:56:27 +08:00
|
|
|
|
[`${componentCls}-horizontal`]: {
|
2022-03-14 19:12:10 +08:00
|
|
|
|
...genDirectionStyle(token, true),
|
|
|
|
|
|
2022-04-07 20:56:27 +08:00
|
|
|
|
[`&${componentCls}-with-marks`]: {
|
2022-03-29 15:57:39 +08:00
|
|
|
|
marginBottom: marginPartWithMark,
|
2022-03-14 19:12:10 +08:00
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// ============================= Vertical =============================
|
2022-11-17 23:31:41 +08:00
|
|
|
|
const genVerticalStyle: GenerateStyle<SliderToken> = (token) => {
|
2022-04-07 20:56:27 +08:00
|
|
|
|
const { componentCls } = token;
|
2022-03-14 19:12:10 +08:00
|
|
|
|
|
|
|
|
|
return {
|
2022-04-07 20:56:27 +08:00
|
|
|
|
[`${componentCls}-vertical`]: {
|
2022-03-14 19:12:10 +08:00
|
|
|
|
...genDirectionStyle(token, false),
|
|
|
|
|
height: '100%',
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// ============================== Export ==============================
|
2022-04-07 20:56:27 +08:00
|
|
|
|
export default genComponentStyleHook(
|
|
|
|
|
'Slider',
|
2022-11-17 23:31:41 +08:00
|
|
|
|
(token) => {
|
2022-04-11 16:04:00 +08:00
|
|
|
|
const sliderToken = mergeToken<SliderToken>(token, {
|
2022-04-07 20:56:27 +08:00
|
|
|
|
marginPart: (token.controlHeight - token.controlSize) / 2,
|
|
|
|
|
marginFull: token.controlSize / 2,
|
|
|
|
|
marginPartWithMark: token.controlHeightLG - token.controlSize,
|
2022-04-11 16:04:00 +08:00
|
|
|
|
});
|
2022-04-07 20:56:27 +08:00
|
|
|
|
return [
|
2022-04-21 02:06:22 +08:00
|
|
|
|
genBaseStyle(sliderToken),
|
2022-04-07 20:56:27 +08:00
|
|
|
|
genHorizontalStyle(sliderToken),
|
|
|
|
|
genVerticalStyle(sliderToken),
|
|
|
|
|
];
|
|
|
|
|
},
|
2022-11-17 23:31:41 +08:00
|
|
|
|
(token) => {
|
2022-04-07 20:56:27 +08:00
|
|
|
|
// Handle line width is always width-er 1px
|
|
|
|
|
const increaseHandleWidth = 1;
|
2022-09-20 21:50:36 +08:00
|
|
|
|
const controlSize = token.controlHeightLG / 4;
|
|
|
|
|
const controlSizeHover = token.controlHeightSM / 2;
|
2022-09-07 12:00:00 +08:00
|
|
|
|
const handleLineWidth = token.lineWidth + increaseHandleWidth;
|
|
|
|
|
const handleLineWidthHover = token.lineWidth + increaseHandleWidth * 3;
|
2022-04-07 20:56:27 +08:00
|
|
|
|
return {
|
|
|
|
|
controlSize,
|
2022-10-25 17:04:36 +08:00
|
|
|
|
railSize: 4,
|
2022-09-20 21:50:36 +08:00
|
|
|
|
handleSize: controlSize,
|
|
|
|
|
handleSizeHover: controlSizeHover,
|
2022-12-09 17:52:34 +08:00
|
|
|
|
dotSize: 8,
|
2022-09-07 12:00:00 +08:00
|
|
|
|
handleLineWidth,
|
|
|
|
|
handleLineWidthHover,
|
2022-04-07 20:56:27 +08:00
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
);
|