qm-ui
Version:
千米公有云管理端UI基础组件库
79 lines (54 loc) • 3.58 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = undefined;
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
var _class, _temp; /**
* @author gcy[of1518]
* @date 16/10/11
*
* @description Gallery组件的实现
*/
var _react = require('react');
var _react2 = _interopRequireDefault(_react);
var _classnames = require('classnames');
var _classnames2 = _interopRequireDefault(_classnames);
var _element = require('./element');
var _element2 = _interopRequireDefault(_element);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _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; }
function _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) : subClass.__proto__ = superClass; }
var FormUI = (_temp = _class = function (_Component) {
_inherits(FormUI, _Component);
function FormUI(props) {
_classCallCheck(this, FormUI);
return _possibleConstructorReturn(this, (FormUI.__proto__ || Object.getPrototypeOf(FormUI)).call(this, props));
}
_createClass(FormUI, [{
key: 'render',
value: function render() {
var _classNames;
var _props = this.props,
prefixCls = _props.prefixCls,
className = _props.className,
inline = _props.inline,
horizontal = _props.horizontal,
vertical = _props.vertical;
var formClassName = (0, _classnames2.default)(prefixCls, (_classNames = {}, _defineProperty(_classNames, prefixCls + '-horizontal', horizontal), _defineProperty(_classNames, prefixCls + '-vertical', vertical), _defineProperty(_classNames, prefixCls + '-inline', inline), _classNames), className);
return _react2.default.createElement(
'form',
{ className: formClassName },
this.props.children
);
}
}]);
return FormUI;
}(_react.Component), _class.defaultProps = {
prefixCls: 'ant-form',
className: ''
}, _temp);
exports.default = FormUI;
FormUI.ElementUI = _element2.default;