| 1 |
/** |
| 2 |
* External dependencies |
| 3 |
*/ |
| 4 |
import GeneralSettings from './Sidebar/GeneralSettings.js'; |
| 5 |
import HorizontalAxisSettings from './Sidebar/HorizontalAxisSettings.js'; |
| 6 |
import VerticalAxisSettings from './Sidebar/VerticalAxisSettings.js'; |
| 7 |
import PieSettings from './Sidebar/PieSettings.js'; |
| 8 |
import ResidueSettings from './Sidebar/ResidueSettings.js'; |
| 9 |
import LinesSettings from './Sidebar/LinesSettings.js'; |
| 10 |
import BarsSettings from './Sidebar/BarsSettings.js'; |
| 11 |
import CandlesSettings from './Sidebar/CandlesSettings.js'; |
| 12 |
import MapSettings from './Sidebar/MapSettings.js'; |
| 13 |
import ColorAxis from './Sidebar/ColorAxis.js'; |
| 14 |
import SizeAxis from './Sidebar/SizeAxis.js'; |
| 15 |
import MagnifyingGlass from './Sidebar/MagnifyingGlass.js'; |
| 16 |
import GaugeSettings from './Sidebar/GaugeSettings.js'; |
| 17 |
import TimelineSettings from './Sidebar/TimelineSettings.js'; |
| 18 |
import TableSettings from './Sidebar/TableSettings.js'; |
| 19 |
import RowCellSettings from './Sidebar/RowCellSettings.js'; |
| 20 |
import ComboSettings from './Sidebar/ComboSettings.js'; |
| 21 |
import SeriesSettings from './Sidebar/SeriesSettings.js'; |
| 22 |
import SlicesSettings from './Sidebar/SlicesSettings.js'; |
| 23 |
import ColumnSettings from './Sidebar/ColumnSettings.js'; |
| 24 |
import LayoutAndChartArea from './Sidebar/LayoutAndChartArea.js'; |
| 25 |
import FrontendActions from './Sidebar/FrontendActions.js'; |
| 26 |
import ManualConfiguration from './Sidebar/ManualConfiguration.js'; |
| 27 |
|
| 28 |
/** |
| 29 |
* WordPress dependencies |
| 30 |
*/ |
| 31 |
const { |
| 32 |
Component, |
| 33 |
Fragment |
| 34 |
} = wp.element; |
| 35 |
|
| 36 |
class Sidebar extends Component { |
| 37 |
constructor() { |
| 38 |
super( ...arguments ); |
| 39 |
} |
| 40 |
|
| 41 |
render() { |
| 42 |
|
| 43 |
const type = this.props.chart['visualizer-chart-type']; |
| 44 |
|
| 45 |
return ( |
| 46 |
<Fragment> |
| 47 |
|
| 48 |
<GeneralSettings chart={ this.props.chart } edit={ this.props.edit } /> |
| 49 |
|
| 50 |
{ ( -1 >= [ 'table', 'gauge', 'geo', 'pie', 'timeline', 'dataTable' ].indexOf( type ) ) && ( |
| 51 |
<HorizontalAxisSettings chart={ this.props.chart } edit={ this.props.edit } /> |
| 52 |
) } |
| 53 |
|
| 54 |
{ ( -1 >= [ 'table', 'gauge', 'geo', 'pie', 'timeline', 'dataTable' ].indexOf( type ) ) && ( |
| 55 |
<VerticalAxisSettings chart={ this.props.chart } edit={ this.props.edit } /> |
| 56 |
) } |
| 57 |
|
| 58 |
{ ( 0 <= [ 'pie' ].indexOf( type ) ) && ( |
| 59 |
<Fragment> |
| 60 |
|
| 61 |
<PieSettings chart={ this.props.chart } edit={ this.props.edit } /> |
| 62 |
|
| 63 |
<ResidueSettings chart={ this.props.chart } edit={ this.props.edit } /> |
| 64 |
|
| 65 |
</Fragment> |
| 66 |
) } |
| 67 |
|
| 68 |
{ ( 0 <= [ 'area', 'scatter', 'line' ].indexOf( type ) ) && ( |
| 69 |
<LinesSettings chart={ this.props.chart } edit={ this.props.edit } /> |
| 70 |
) } |
| 71 |
|
| 72 |
{ ( 0 <= [ 'bar', 'column' ].indexOf( type ) ) && ( |
| 73 |
<BarsSettings chart={ this.props.chart } edit={ this.props.edit } /> |
| 74 |
) } |
| 75 |
|
| 76 |
{ ( 0 <= [ 'candlestick' ].indexOf( type ) ) && ( |
| 77 |
<CandlesSettings chart={ this.props.chart } edit={ this.props.edit } /> |
| 78 |
) } |
| 79 |
|
| 80 |
{ ( 0 <= [ 'geo' ].indexOf( type ) ) && ( |
| 81 |
<Fragment> |
| 82 |
|
| 83 |
<MapSettings chart={ this.props.chart } edit={ this.props.edit } /> |
| 84 |
|
| 85 |
<ColorAxis chart={ this.props.chart } edit={ this.props.edit } /> |
| 86 |
|
| 87 |
<SizeAxis chart={ this.props.chart } edit={ this.props.edit } /> |
| 88 |
|
| 89 |
<MagnifyingGlass chart={ this.props.chart } edit={ this.props.edit } /> |
| 90 |
|
| 91 |
</Fragment> |
| 92 |
) } |
| 93 |
|
| 94 |
{ ( 0 <= [ 'gauge' ].indexOf( type ) ) && ( |
| 95 |
<GaugeSettings chart={ this.props.chart } edit={ this.props.edit } /> |
| 96 |
) } |
| 97 |
|
| 98 |
{ ( 0 <= [ 'timeline' ].indexOf( type ) ) && ( |
| 99 |
<TimelineSettings chart={ this.props.chart } edit={ this.props.edit } /> |
| 100 |
) } |
| 101 |
|
| 102 |
{ ( 0 <= [ 'table', 'dataTable' ].indexOf( type ) ) && ( |
| 103 |
<Fragment> |
| 104 |
|
| 105 |
<TableSettings chart={ this.props.chart } edit={ this.props.edit } /> |
| 106 |
|
| 107 |
<RowCellSettings chart={ this.props.chart } edit={ this.props.edit } /> |
| 108 |
|
| 109 |
</Fragment> |
| 110 |
) } |
| 111 |
|
| 112 |
{ ( 0 <= [ 'combo' ].indexOf( type ) ) && ( |
| 113 |
<ComboSettings chart={ this.props.chart } edit={ this.props.edit } /> |
| 114 |
) } |
| 115 |
|
| 116 |
{ ( -1 >= [ 'timeline', 'gauge', 'geo', 'pie', 'dataTable' ].indexOf( type ) ) && ( |
| 117 |
<SeriesSettings chart={ this.props.chart } edit={ this.props.edit } /> |
| 118 |
) } |
| 119 |
|
| 120 |
{ ( 0 <= [ 'pie' ].indexOf( type ) ) && ( |
| 121 |
<SlicesSettings chart={ this.props.chart } edit={ this.props.edit } /> |
| 122 |
) } |
| 123 |
|
| 124 |
{ ( 0 <= [ 'dataTable' ].indexOf( type ) ) && ( |
| 125 |
<ColumnSettings chart={ this.props.chart } edit={ this.props.edit } /> |
| 126 |
) } |
| 127 |
|
| 128 |
{ ( -1 >= [ 'dataTable' ].indexOf( type ) ) && ( |
| 129 |
<LayoutAndChartArea chart={ this.props.chart } edit={ this.props.edit } /> |
| 130 |
) } |
| 131 |
|
| 132 |
<FrontendActions chart={ this.props.chart } edit={ this.props.edit } /> |
| 133 |
|
| 134 |
{ ( -1 >= [ 'dataTable' ].indexOf( type ) ) && ( |
| 135 |
<ManualConfiguration chart={ this.props.chart } edit={ this.props.edit } /> |
| 136 |
) } |
| 137 |
</Fragment> |
| 138 |
); |
| 139 |
} |
| 140 |
} |
| 141 |
|
| 142 |
export default Sidebar; |
| 143 |
|