|
|
@ -5,6 +5,7 @@ import type { SliderRef } from 'rc-slider/lib/Slider'; |
|
|
|
import React from 'react'; |
|
|
|
import warning from '../_util/warning'; |
|
|
|
import { ConfigContext } from '../config-provider'; |
|
|
|
import DisabledContext from '../config-provider/DisabledContext'; |
|
|
|
import type { TooltipPlacement } from '../tooltip'; |
|
|
|
import SliderTooltip from './SliderTooltip'; |
|
|
|
import useStyle from './style'; |
|
|
@ -103,6 +104,7 @@ const Slider = React.forwardRef<SliderRef, SliderSingleProps | SliderRangeProps> |
|
|
|
range, |
|
|
|
className, |
|
|
|
rootClassName, |
|
|
|
disabled, |
|
|
|
// Deprecated Props
|
|
|
|
tooltipPrefixCls: legacyTooltipPrefixCls, |
|
|
|
tipFormatter: legacyTipFormatter, |
|
|
@ -114,6 +116,8 @@ const Slider = React.forwardRef<SliderRef, SliderSingleProps | SliderRangeProps> |
|
|
|
} = props; |
|
|
|
|
|
|
|
const { getPrefixCls, direction, getPopupContainer } = React.useContext(ConfigContext); |
|
|
|
const contextDisabled = React.useContext(DisabledContext); |
|
|
|
const mergedDisabled = disabled ?? contextDisabled; |
|
|
|
const [opens, setOpens] = React.useState<Opens>({}); |
|
|
|
|
|
|
|
const toggleTooltipOpen = (index: number, open: boolean) => { |
|
|
@ -238,6 +242,7 @@ const Slider = React.forwardRef<SliderRef, SliderSingleProps | SliderRangeProps> |
|
|
|
range={mergedRange} |
|
|
|
draggableTrack={draggableTrack} |
|
|
|
className={cls} |
|
|
|
disabled={mergedDisabled} |
|
|
|
ref={ref} |
|
|
|
prefixCls={prefixCls} |
|
|
|
handleRender={handleRender} |
|
|
|