File tree Expand file tree Collapse file tree 6 files changed +19
-18
lines changed
styles/components/widgets Expand file tree Collapse file tree 6 files changed +19
-18
lines changed Original file line number Diff line number Diff line change @@ -96,7 +96,10 @@ class Fold extends Component {
9696 < div className = "fold__top__arrow-title" >
9797 { arrowIcon }
9898 { icon }
99- < div className = "fold__top__title" > { name } </ div >
99+ < div
100+ className = "fold__top__title"
101+ dangerouslySetInnerHTML = { { __html : name } }
102+ />
100103 </ div >
101104 { deleteButton ( deleteContainer ) }
102105 </ div >
Original file line number Diff line number Diff line change @@ -68,3 +68,5 @@ MenuPanel.propTypes = {
6868 question : PropTypes . bool ,
6969 show : PropTypes . bool ,
7070} ;
71+
72+ MenuPanel . plotly_editor_traits = { is_menu_panel : true } ;
Original file line number Diff line number Diff line change 11import Info from '../fields/Info' ;
2- import MenuPanel from './MenuPanel' ;
32import React , { Component , cloneElement } from 'react' ;
43import PropTypes from 'prop-types' ;
54import {
@@ -28,7 +27,7 @@ class Section extends Component {
2827 this . sectionVisible = isVisible === true ;
2928
3029 this . children = React . Children . map ( nextProps . children , child => {
31- if ( child . type === MenuPanel ) {
30+ if ( ( child . type . plotly_editor_traits || { } ) . is_menu_panel ) {
3231 // Process the first menuPanel. Ignore the rest. MenuPanel does
3332 // not affect visibility.
3433 if ( ! this . menuPanel ) {
Original file line number Diff line number Diff line change 11import PropTypes from 'prop-types' ;
2- import React , { cloneElement , Component } from 'react' ;
3- import Button from '../widgets/Button' ;
2+ import React , { Component } from 'react' ;
43
54export default class SingleSidebarItem extends Component {
65 render ( ) {
7- let { children} = this . props ;
8- children = React . Children . map ( children , child => {
9- if ( child . type === Button ) {
10- return cloneElement ( child , { className : 'button--menu' } ) ;
11- }
12- return child ;
13- } ) ;
14- return children ? (
15- < div className = "sidebar__item--single" > { children } </ div >
6+ return this . props . children ? (
7+ < div className = "sidebar__item--single" > { this . props . children } </ div >
168 ) : null ;
179 }
1810}
Original file line number Diff line number Diff line change @@ -17,8 +17,8 @@ import {localize} from '../lib';
1717const GraphCreatePanel = ( { localize : _ } ) => {
1818 return (
1919 < TraceAccordion canAdd >
20- < TraceSelector label = { _ ( 'Type' ) } attr = "type" show />
2120 < TextEditor label = { _ ( 'Name' ) } attr = "name" richTextOnly />
21+ < TraceSelector label = { _ ( 'Type' ) } attr = "type" show />
2222
2323 < Section name = { _ ( 'Data' ) } >
2424 < DataSelector label = { _ ( 'Labels' ) } attr = "labels" />
Original file line number Diff line number Diff line change @@ -31,7 +31,6 @@ button {
3131 position : relative ;
3232 overflow : hidden ;
3333 }
34-
3534 & __label {
3635 padding-left : var (--spacing-half-unit );
3736 }
@@ -51,9 +50,15 @@ button {
5150 padding-left : 0 ;
5251 }
5352 }
54- & --menu {
55- min-width : 75px ;
53+
54+ // If a button is placed in the sidebar,
55+ // it should grow to the width of the available space.
56+ @at-root .sidebar .button {
57+ width : calc (100% - var (--spacing-base-unit ));
58+ margin-left : var (--spacing-half-unit );
59+ margin-right : var (--spacing-half-unit );
5660 }
61+
5762 & --default {
5863 @include button ();
5964 }
You can’t perform that action at this time.
0 commit comments