@@ -4,15 +4,27 @@ import {UnconnectedDateTimePicker} from './DateTimePicker';
44import PropTypes from 'prop-types' ;
55import React , { Component } from 'react' ;
66import { connectToContainer } from 'lib' ;
7+ import Info from './Info' ;
8+ import { MULTI_VALUED } from 'lib/constants' ;
79
810export class UnconnectedAxisRangeValue extends Component {
911 render ( ) {
10- return this . props . multiValued ||
11- ( this . props . fullContainer && this . props . fullContainer . type === 'date' ) ? (
12- < UnconnectedDateTimePicker { ...this . props } />
13- ) : (
14- < UnconnectedNumeric { ...this . props } />
15- ) ;
12+ // only when all axes have the type date, can we output an UnconnectedDateTimePicker
13+ if ( this . props . fullContainer && this . props . fullContainer . type === 'date' ) {
14+ return < UnconnectedDateTimePicker { ...this . props } /> ;
15+ }
16+ // If its multivalued, it can be multivalued for different reasons:
17+ // - the range is different, but same type
18+ // - the type is different (i.e. date + number axes)
19+ // If we're in the case of a mixed axis type (i.e. date + number) case,
20+ // There's going to be a this.props.fullContainer.type, but it's going to be MULTIVALUED
21+ if ( this . props . multiValued && this . props . fullContainer . type === MULTI_VALUED ) {
22+ return < Info { ...this . props } /> ;
23+ }
24+
25+ // For cases that the range is numeric, but does not have the same number
26+ // Or numeric and has the same number
27+ return < UnconnectedNumeric { ...this . props } /> ;
1628 }
1729}
1830
0 commit comments