choerodon-ui
Version:
An enterprise-class UI design language and React-based implementation
81 lines (63 loc) • 2.31 kB
JavaScript
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
import _createClass from "@babel/runtime/helpers/createClass";
import _inherits from "@babel/runtime/helpers/inherits";
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
function _createSuper(Derived) {
function isNativeReflectConstruct() {
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
if (Reflect.construct.sham) return false;
if (typeof Proxy === "function") return true;
try {
Date.prototype.toString.call(Reflect.construct(Date, [], function () {}));
return true;
} catch (e) {
return false;
}
}
return function () {
var Super = _getPrototypeOf(Derived),
result;
if (isNativeReflectConstruct()) {
var NewTarget = _getPrototypeOf(this).constructor;
result = Reflect.construct(Super, arguments, NewTarget);
} else {
result = Super.apply(this, arguments);
}
return _possibleConstructorReturn(this, result);
};
}
import { Children, cloneElement, isValidElement, PureComponent } from 'react';
var FormVirtualGroup =
/*#__PURE__*/
function (_PureComponent) {
_inherits(FormVirtualGroup, _PureComponent);
var _super = _createSuper(FormVirtualGroup);
function FormVirtualGroup() {
_classCallCheck(this, FormVirtualGroup);
return _super.apply(this, arguments);
}
_createClass(FormVirtualGroup, [{
key: "render",
value: function render() {
var _this$props = this.props,
children = _this$props.children,
otherProps = _objectWithoutProperties(_this$props, ["children"]);
if (children) {
return Children.map(children, function (child) {
if (isValidElement(child)) {
return cloneElement(child, otherProps);
}
return child;
});
}
return null;
}
}]);
return FormVirtualGroup;
}(PureComponent);
export { FormVirtualGroup as default };
FormVirtualGroup.displayName = 'FormVirtualGroup';
FormVirtualGroup.__PRO_FORM_VIRTUAL_GROUP = true;
//# sourceMappingURL=FormVirtualGroup.js.map