"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports["default"] = void 0;

var _react = _interopRequireDefault(require("react"));

var _propTypes = require("prop-types");

var _rcSlider = _interopRequireDefault(require("rc-slider"));

require("rc-slider/assets/index.css");

require("./slider.css");

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }

var SliderWithTooltip = _rcSlider["default"].createSliderWithTooltip(_rcSlider["default"]);

var Range = _rcSlider["default"].createSliderWithTooltip(_rcSlider["default"].Range);

var Slider = function Slider(_ref) {
  var min = _ref.min,
      max = _ref.max,
      onChange = _ref.onChange,
      showStepMarkers = _ref.showStepMarkers,
      step = _ref.step,
      value = _ref.value,
      SliderComponent = _ref.SliderComponent;
  return _react["default"].createElement("span", {
    className: "civic-slider-container"
  }, _react["default"].createElement(SliderComponent, {
    dots: showStepMarkers,
    min: min,
    max: max,
    step: step,
    value: value,
    onChange: onChange
  }));
};

Slider.SliderWithTooltip = function (props) {
  return _react["default"].createElement("span", {
    className: "civic-slider-container"
  }, _react["default"].createElement(SliderWithTooltip, props));
};

Slider.SliderWithRange = function (props) {
  return _react["default"].createElement("span", {
    className: "civic-slider-container"
  }, _react["default"].createElement(Range, props));
};

Slider.propTypes = {
  max: _propTypes.number.isRequired,
  min: _propTypes.number.isRequired,
  onChange: _propTypes.func.isRequired,
  showStepMarkers: _propTypes.bool,
  step: _propTypes.number,
  value: _propTypes.number.isRequired,
  SliderComponent: _propTypes.node
};
Slider.defaultProps = {
  showStepMarkers: false,
  step: 1,
  SliderComponent: _rcSlider["default"]
};
var _default = Slider;
exports["default"] = _default;