Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
return React__default.cloneElement(child, _extends({}, child.props, {
className: classNames
}));
default:
return child;
}
});
}());
};
return FormGroup;
}(React.Component);
FormGroup.defaultProps = reactstrap.FormGroup.defaultProps;
FormGroup.propTypes = reactstrap.FormGroup.propTypes;
/**
* HeaderContext
* {
* type: PropTypes.oneOf([SLIM, CENTER, NAVBAR]).isRequired
* }
*/
var HeaderContext = React__default.createContext({});
var SLIM = 'slim';
var CENTER = 'center';
var NAVBAR = 'navbar';
var propTypes$6 = {
/** Classi addizionali per il componente Header */
className: PropTypes.string,
_proto.render = function render() {
var _this2 = this;
var _this$state = this.state,
active = _this$state.active,
value = _this$state.value;
var _this$props = this.props,
children = _this$props.children,
className = _this$props.className,
col = _this$props.col,
rest = _objectWithoutPropertiesLoose(_this$props, ["children", "className", "col"]);
var hasValue = !!value;
var classNames = [className, active ? 'active' : '', col ? 'col' : ''].join(' ');
return React__default.createElement(reactstrap.FormGroup, _extends({}, rest, {
className: classNames
}), function () {
return React__default.Children.map(children, function (child) {
if (child === null) return;
var _child$props = child.props,
_onFocus = _child$props.onFocus,
_onBlur = _child$props.onBlur,
_onChange = _child$props.onChange,
className = _child$props.className;
switch (child.type) {
case reactstrap.Input:
var isLabelActive = null;
return React__default.cloneElement(child, _extends({}, child.props, {
onFocus: function onFocus() {
_this2.onFocus(_onFocus);
classNames = hasValue || hasChildValue ? [className, 'active'].join(' ') : className;
return React__default.cloneElement(child, _extends({}, child.props, {
className: classNames
}));
default:
return child;
}
});
}());
};
return FormGroup;
}(React.Component);
FormGroup.defaultProps = reactstrap.FormGroup.defaultProps;
FormGroup.propTypes = reactstrap.FormGroup.propTypes;
/**
* HeaderContext
* {
* type: PropTypes.oneOf([SLIM, CENTER, NAVBAR]).isRequired
* }
*/
var HeaderContext = React__default.createContext({});
var SLIM = 'slim';
var CENTER = 'center';
var NAVBAR = 'navbar';
var propTypes$6 = {
/** Classi addizionali per il componente Header */