|
|
@ -130,15 +130,16 @@ type SliderProps = BaseInput<number> &
|
|
|
|
|
|
|
|
|
|
|
|
export const Slider: FunctionComponent<SliderProps> = (props) => {
|
|
|
|
export const Slider: FunctionComponent<SliderProps> = (props) => {
|
|
|
|
const { value, update, rest } = useBaseInput(props);
|
|
|
|
const { value, update, rest } = useBaseInput(props);
|
|
|
|
|
|
|
|
const { label, ...sliderProps } = rest;
|
|
|
|
|
|
|
|
|
|
|
|
const { min = 0, max = 100 } = props;
|
|
|
|
const { min = 0, max = 100 } = props;
|
|
|
|
|
|
|
|
|
|
|
|
const marks = useSliderMarks([min, max]);
|
|
|
|
const marks = useSliderMarks([min, max]);
|
|
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
return (
|
|
|
|
<InputWrapper label={rest.label}>
|
|
|
|
<InputWrapper label={label}>
|
|
|
|
<MantineSlider
|
|
|
|
<MantineSlider
|
|
|
|
{...rest}
|
|
|
|
{...sliderProps}
|
|
|
|
marks={marks}
|
|
|
|
marks={marks}
|
|
|
|
onChange={update}
|
|
|
|
onChange={update}
|
|
|
|
value={value ?? 0}
|
|
|
|
value={value ?? 0}
|
|
|
|