UNPKG

@momentum-ui/react-collaboration

Version:

Cisco Momentum UI Framework for React Collaboration Applications

18 lines 1.26 kB
import React from 'react'; import classnames from 'classnames'; import { DEFAULTS, STYLE } from './Slider.constants'; import './Slider.style.scss'; import { useSliderSideEffects } from './Slider.hooks'; var Slider = function (props) { var ariaLabel = props.ariaLabel, _a = props.isDisabled, isDisabled = _a === void 0 ? DEFAULTS.DISABLED : _a, _b = props.step, step = _b === void 0 ? DEFAULTS.STEP : _b, _c = props.minValue, minValue = _c === void 0 ? DEFAULTS.MIN : _c, _d = props.maxValue, maxValue = _d === void 0 ? DEFAULTS.MAX : _d, _e = props.value, value = _e === void 0 ? DEFAULTS.VALUE : _e, onChange = props.onChange, className = props.className, id = props.id, style = props.style; var _f = useSliderSideEffects({ onChange: onChange, value: value, step: step, minValue: minValue, maxValue: maxValue, }), inputRef = _f.inputRef, handleChange = _f.handleChange; return (React.createElement("input", { ref: inputRef, type: "range", value: value, min: minValue, max: maxValue, "aria-label": ariaLabel, onChange: handleChange, step: step, className: classnames(className, STYLE.wrapper), id: id, style: style, disabled: isDisabled })); }; export default Slider; //# sourceMappingURL=Slider.js.map