1 line
35 KiB
JSON
1 line
35 KiB
JSON
|
{"ast":null,"code":"import { unit } from '@ant-design/cssinjs';\nimport { TinyColor } from '@ctrl/tinycolor';\nimport { resetComponent } from '../../style';\nimport { genStyleHooks, mergeToken } from '../../theme/internal';\n// =============================== Base ===============================\nconst genBaseStyle = token => {\n const {\n componentCls,\n antCls,\n controlSize,\n dotSize,\n marginFull,\n marginPart,\n colorFillContentHover,\n handleColorDisabled,\n calc,\n handleSize,\n handleSizeHover,\n handleActiveColor,\n handleActiveOutlineColor,\n handleLineWidth,\n handleLineWidthHover,\n motionDurationMid\n } = token;\n return {\n [componentCls]: Object.assign(Object.assign({}, resetComponent(token)), {\n position: 'relative',\n height: controlSize,\n margin: `${unit(marginPart)} ${unit(marginFull)}`,\n padding: 0,\n cursor: 'pointer',\n touchAction: 'none',\n '&-vertical': {\n margin: `${unit(marginFull)} ${unit(marginPart)}`\n },\n [`${componentCls}-rail`]: {\n position: 'absolute',\n backgroundColor: token.railBg,\n borderRadius: token.borderRadiusXS,\n transition: `background-color ${motionDurationMid}`\n },\n [`${componentCls}-track,${componentCls}-tracks`]: {\n position: 'absolute',\n transition: `background-color ${motionDurationMid}`\n },\n [`${componentCls}-track`]: {\n backgroundColor: token.trackBg,\n borderRadius: token.borderRadiusXS\n },\n [`${componentCls}-track-draggable`]: {\n boxSizing: 'content-box',\n backgroundClip: 'content-box',\n border: 'solid rgba(0,0,0,0)'\n },\n '&:hover': {\n [`${componentCls}-rail`]: {\n backgroundColor: token.railHoverBg\n },\n [`${componentCls}-track`]: {\n backgroundColor: token.trackHoverBg\n },\n [`${componentCls}-dot`]: {\n borderColor: colorFillContentHover\n },\n [`${componentCls}-handle::after`]: {\n boxShadow: `0 0 0 ${unit(handleLineWidth)} ${token.colorPrimaryBorderHover}`\n },\n [`${componentCls}-dot-active`]: {\n borderColor: token.dotActiveBorderColor\n }\n },\n [`${componentCls}-handle`]: {\n position: 'absolute',\n width: handleSize,\n height: handleSize,\n outline: 'none',\n userSelect: 'none',\n // Dragging status\n '&-dragging-delete': {\n opacity: 0\n },\n // 扩大选区\n '&::before': {\n content: '\"\"',\n position: 'absolute',\n insetInlineStart: calc(handleLineWidth).mul(-1).equal(),\n insetBlockStart: calc(handleLineWidth).mul(-1).equal(),\n width: calc(handleSize).add(calc(handleLineWidth).mul(2)).equal(),\n height: calc(handleSize).add(calc(handleLineWidth).mul(2)).equal(),\n backgroundColor: 'transparent'\n },\n '&::after': {\n content: '\"\"',\n position: 'absolute',\n insetBlockStart: 0,\n insetInlineStart: 0,\n width: handleSize,\n height: handleSize,\n backgroundColor: token.colorBgElevated,\n boxShadow: `0 0 0 ${unit(handleLineWidth)} ${token.handleColor}`,\n outline: `0px solid transparent`,\n borderRadius: '50%',\n cursor: 'pointer',\n transition: `\n inset-inline-start ${motionDurationMid},\n inset-block-start ${motionDurationMid},\n width ${motionDurationMid},\n height ${motionDurationMid},\n box-shadow ${motionDurationMid},\n outline ${motionDurationMid}\n `\n },\n '&:hover, &:active, &:focus': {\n '&::before': {\n insetInlineStart: calc(handleSizeHover).sub(handleSize).div(2).add(handleLineWidthHover).mul(-1).equal(),\n insetBlockStart: calc(handleSizeHover).sub(handleSize).div(2).add(handleLineWidthHover).m
|