UNPKG

2.68 kBJavaScriptView Raw
1'use strict';
2
3Object.defineProperty(exports, "__esModule", {
4 value: true
5});
6
7var _react = require('react');
8
9var _react2 = _interopRequireDefault(_react);
10
11var _propTypes = require('prop-types');
12
13var _propTypes2 = _interopRequireDefault(_propTypes);
14
15function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
16
17function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; }
18
19function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
20
21function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
22
23function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : _defaults(subClass, superClass); }
24
25var propTypes = {
26 clsfix: _propTypes2["default"].string,
27 disabled: _propTypes2["default"].bool
28};
29var defaultProps = {
30 clsfix: 'ac-form-layout'
31};
32
33var FormLayout = function (_Component) {
34 _inherits(FormLayout, _Component);
35
36 function FormLayout() {
37 _classCallCheck(this, FormLayout);
38
39 return _possibleConstructorReturn(this, _Component.apply(this, arguments));
40 }
41
42 FormLayout.prototype.render = function render() {
43 var _props = this.props,
44 clsfix = _props.clsfix,
45 children = _props.children,
46 disabled = _props.disabled,
47 className = _props.className;
48
49 var clsses = clsfix;
50 if (className) clsses += ' ' + className;
51 if (disabled) clsses += ' disabled';
52 return _react2["default"].createElement(
53 'div',
54 { className: clsses },
55 children
56 );
57 };
58
59 return FormLayout;
60}(_react.Component);
61
62;
63FormLayout.propTypes = propTypes;
64FormLayout.defaultProps = defaultProps;
65exports["default"] = FormLayout;
66module.exports = exports['default'];
\No newline at end of file