UNPKG

@momentum-ui/react

Version:

Cisco Momentum UI framework for ReactJs applications

50 lines (37 loc) 2.05 kB
var _excluded = ["name", "children"]; function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } /** @component form */ import React from 'react'; import PropTypes from 'prop-types'; var Form = /*#__PURE__*/function (_React$PureComponent) { _inheritsLoose(Form, _React$PureComponent); function Form() { return _React$PureComponent.apply(this, arguments) || this; } var _proto = Form.prototype; _proto.render = function render() { var _this$props = this.props, name = _this$props.name, children = _this$props.children, props = _objectWithoutPropertiesLoose(_this$props, _excluded); return /*#__PURE__*/React.createElement("form", _extends({ name: name, className: "md-form" }, props), children); }; return Form; }(React.PureComponent); Form.propTypes = { /** @prop Children node to render inside Form | null */ children: PropTypes.node, /** @prop Form name */ name: PropTypes.string.isRequired }; Form.defaultProps = { children: null }; Form.displayName = 'Form'; export default Form;