+ {this.props.name ? (
+
+ ) : null}
+ {this.props.children}
+
+ );
+ }
+}
+
+UnlocalizedSection.plotly_editor_traits = {no_visibility_forcing: false};
+UnlocalizedSection.propTypes = {
+ children: PropTypes.node,
+ name: PropTypes.string,
+ attr: PropTypes.string,
+};
- this.sectionVisible = false;
+export const Section = localize(UnlocalizedSection);
+class PlotlySection extends UnlocalizedSection {
+ constructor(props, context) {
+ super(props, context);
this.determineVisibility(props, context);
}
@@ -25,7 +54,7 @@ class Section extends Component {
this.sectionVisible = Boolean(isVisible);
React.Children.forEach(nextProps.children, child => {
- if (!child || this.foldVisible) {
+ if (!child || this.sectionVisible) {
return;
}
@@ -45,27 +74,8 @@ class Section extends Component {
}
});
}
-
- render() {
- if (!this.sectionVisible) {
- return null;
- }
- return (
-