import _extends from "@babel/runtime/helpers/extends";
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
import _createClass from "@babel/runtime/helpers/createClass";
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
import _inherits from "@babel/runtime/helpers/inherits";
var _jsxFileName = "/home/builduser/work/57e038ea7326c1ec/packages/wix-design-system/dist/esm/Range/test/RangeTemplate.jsx";
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
import React, { Component } from 'react';
import Range from '..';
import DatePicker from '../../DatePicker';
import Input from '../../Input';
import Text from '../../Text';
var Form = /*#__PURE__*/function (_Component) {
  function Form() {
    _classCallCheck(this, Form);
    return _callSuper(this, Form, arguments);
  }
  _inherits(Form, _Component);
  return _createClass(Form, [{
    key: "componentDidUpdate",
    value: function componentDidUpdate(props) {
      props.onChange(function () {});
    }
  }, {
    key: "componentDidMount",
    value: function componentDidMount() {
      this.props.onChange(function () {});
    }
  }, {
    key: "getComponent",
    value: function getComponent() {
      return /*#__PURE__*/React.createElement(Range, {
        dataHook: this.props.dataHook,
        __self: this,
        __source: {
          fileName: _jsxFileName,
          lineNumber: 18,
          columnNumber: 7
        }
      }, this.props.withLabel ? /*#__PURE__*/React.createElement(Text, {
        tagName: "label",
        __self: this,
        __source: {
          fileName: _jsxFileName,
          lineNumber: 20,
          columnNumber: 11
        }
      }, this.props.label) : null, this.props.rangeType.value === 'InputRange' ? /*#__PURE__*/React.createElement(Input, _extends({
        dataHook: "first-item",
        id: "first"
      }, this.props.firstInput, {
        __self: this,
        __source: {
          fileName: _jsxFileName,
          lineNumber: 23,
          columnNumber: 11
        }
      })) : /*#__PURE__*/React.createElement(DatePicker, _extends({
        dataHook: "first-item",
        placeholderText: "From",
        id: "fromDate"
      }, this.props.firstDate, {
        __self: this,
        __source: {
          fileName: _jsxFileName,
          lineNumber: 25,
          columnNumber: 11
        }
      })), this.props.rangeType.value === 'InputRange' ? /*#__PURE__*/React.createElement(Input, _extends({
        dataHook: "last-item",
        id: "last"
      }, this.props.lastInput, {
        __self: this,
        __source: {
          fileName: _jsxFileName,
          lineNumber: 33,
          columnNumber: 11
        }
      })) : /*#__PURE__*/React.createElement(DatePicker, _extends({
        dataHook: "last-item",
        placeholderText: "To",
        id: "toDate"
      }, this.props.lastDate, {
        __self: this,
        __source: {
          fileName: _jsxFileName,
          lineNumber: 35,
          columnNumber: 11
        }
      })));
    }
  }, {
    key: "render",
    value: function render() {
      return this.getComponent();
    }
  }]);
}(Component);
export { Form as default };