import _defineProperty from "@babel/runtime/helpers/defineProperty";
import _objectSpread from "@babel/runtime/helpers/objectSpread";

/**
 * Web Form Component
 *
 */
import React, { PureComponent } from 'react';
import PropTypes from 'prop-types';
import classnames from 'classnames';
import { registerElement, validateDOMAttributes } from '../../shared/component-helper'; // import './style/dnb-form.css' // no good solution to import the style here

const renderProps = {};
export const propTypes = {
  class: PropTypes.string,

  /** React props */
  className: PropTypes.string,
  children: PropTypes.oneOfType([PropTypes.string, PropTypes.node, PropTypes.func]) // Web Component props

};
export const defaultProps = _objectSpread({
  class: null,

  /** React props */
  className: null,
  children: null
}, renderProps);
export default class Form extends PureComponent {
  static enableWebComponent() {
    registerElement(Form.tagName, Form, defaultProps);
  }

  constructor(props) {
    super(props);

    _defineProperty(this, "state", {
      value: null
    });

    this.state.value = props.range_val;
  }

  render() {
    const {
      children,
      className,
      class: _className
    } = this.props;
    const params = {
      className: classnames('dnb-form', className, _className) // also used for code markup simulation

    };
    validateDOMAttributes(this.props, params);
    return React.createElement("form", params, children);
  }

}

_defineProperty(Form, "tagName", 'dnb-form');

_defineProperty(Form, "defaultProps", defaultProps);

Form.propTypes = process.env.NODE_ENV !== "production" ? propTypes : {};