@@ -38,6 +38,7 @@ emptyFunction.thatReturnsArgument = function (arg) {
38
38
39
39
module . exports = emptyFunction ;
40
40
} , { } ] , 2 :[ function ( require , module , exports ) {
41
+ ( function ( process ) {
41
42
/**
42
43
* Copyright (c) 2013-present, Facebook, Inc.
43
44
* All rights reserved.
@@ -63,7 +64,7 @@ module.exports = emptyFunction;
63
64
64
65
var validateFormat = function validateFormat ( format ) { } ;
65
66
66
- if ( "production" !== 'production' ) {
67
+ if ( process . env . NODE_ENV !== 'production' ) {
67
68
validateFormat = function validateFormat ( format ) {
68
69
if ( format === undefined ) {
69
70
throw new Error ( 'invariant requires an error message argument' ) ;
@@ -93,7 +94,9 @@ function invariant(condition, format, a, b, c, d, e, f) {
93
94
}
94
95
95
96
module . exports = invariant ;
96
- } , { } ] , 3 :[ function ( require , module , exports ) {
97
+ } ) . call ( this , require ( '_process' ) )
98
+ } , { "_process" :5 } ] , 3 :[ function ( require , module , exports ) {
99
+ ( function ( process ) {
97
100
/**
98
101
* Copyright 2014-2015, Facebook, Inc.
99
102
* All rights reserved.
@@ -117,7 +120,7 @@ var emptyFunction = require('./emptyFunction');
117
120
118
121
var warning = emptyFunction ;
119
122
120
- if ( "production" !== 'production' ) {
123
+ if ( process . env . NODE_ENV !== 'production' ) {
121
124
( function ( ) {
122
125
var printWarning = function printWarning ( format ) {
123
126
for ( var _len = arguments . length , args = Array ( _len > 1 ? _len - 1 : 0 ) , _key = 1 ; _key < _len ; _key ++ ) {
@@ -160,7 +163,8 @@ if ("production" !== 'production') {
160
163
}
161
164
162
165
module . exports = warning ;
163
- } , { "./emptyFunction" :1 } ] , 4 :[ function ( require , module , exports ) {
166
+ } ) . call ( this , require ( '_process' ) )
167
+ } , { "./emptyFunction" :1 , "_process" :5 } ] , 4 :[ function ( require , module , exports ) {
164
168
( function ( global ) {
165
169
/**
166
170
* Lodash (Custom Build) <https://lodash.com/>
@@ -2183,6 +2187,10 @@ process.off = noop;
2183
2187
process . removeListener = noop ;
2184
2188
process . removeAllListeners = noop ;
2185
2189
process . emit = noop ;
2190
+ process . prependListener = noop ;
2191
+ process . prependOnceListener = noop ;
2192
+
2193
+ process . listeners = function ( name ) { return [ ] }
2186
2194
2187
2195
process . binding = function ( name ) {
2188
2196
throw new Error ( 'process.binding is not supported' ) ;
@@ -2273,11 +2281,14 @@ module.exports = checkPropTypes;
2273
2281
2274
2282
var emptyFunction = require ( 'fbjs/lib/emptyFunction' ) ;
2275
2283
var invariant = require ( 'fbjs/lib/invariant' ) ;
2284
+ var ReactPropTypesSecret = require ( './lib/ReactPropTypesSecret' ) ;
2276
2285
2277
2286
module . exports = function ( ) {
2278
- // Important!
2279
- // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.
2280
- function shim ( ) {
2287
+ function shim ( props , propName , componentName , location , propFullName , secret ) {
2288
+ if ( secret === ReactPropTypesSecret ) {
2289
+ // It is still safe when called from React.
2290
+ return ;
2291
+ }
2281
2292
invariant (
2282
2293
false ,
2283
2294
'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
@@ -2289,6 +2300,8 @@ module.exports = function() {
2289
2300
function getShim ( ) {
2290
2301
return shim ;
2291
2302
} ;
2303
+ // Important!
2304
+ // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.
2292
2305
var ReactPropTypes = {
2293
2306
array : shim ,
2294
2307
bool : shim ,
@@ -2315,7 +2328,7 @@ module.exports = function() {
2315
2328
return ReactPropTypes ;
2316
2329
} ;
2317
2330
2318
- } , { "fbjs/lib/emptyFunction" :1 , "fbjs/lib/invariant" :2 } ] , 8 :[ function ( require , module , exports ) {
2331
+ } , { "./lib/ReactPropTypesSecret" : 10 , " fbjs/lib/emptyFunction" :1 , "fbjs/lib/invariant" :2 } ] , 8 :[ function ( require , module , exports ) {
2319
2332
( function ( process ) {
2320
2333
/**
2321
2334
* Copyright 2013-present, Facebook, Inc.
@@ -2639,6 +2652,20 @@ module.exports = function(isValidElement, throwOnDirectAccess) {
2639
2652
return emptyFunction . thatReturnsNull ;
2640
2653
}
2641
2654
2655
+ for ( var i = 0 ; i < arrayOfTypeCheckers . length ; i ++ ) {
2656
+ var checker = arrayOfTypeCheckers [ i ] ;
2657
+ if ( typeof checker !== 'function' ) {
2658
+ warning (
2659
+ false ,
2660
+ 'Invalid argument supplid to oneOfType. Expected an array of check functions, but ' +
2661
+ 'received %s at index %s.' ,
2662
+ getPostfixForTypeWarning ( checker ) ,
2663
+ i
2664
+ ) ;
2665
+ return emptyFunction . thatReturnsNull ;
2666
+ }
2667
+ }
2668
+
2642
2669
function validate ( props , propName , componentName , location , propFullName ) {
2643
2670
for ( var i = 0 ; i < arrayOfTypeCheckers . length ; i ++ ) {
2644
2671
var checker = arrayOfTypeCheckers [ i ] ;
@@ -2771,6 +2798,9 @@ module.exports = function(isValidElement, throwOnDirectAccess) {
2771
2798
// This handles more types than `getPropType`. Only used for error messages.
2772
2799
// See `createPrimitiveTypeChecker`.
2773
2800
function getPreciseType ( propValue ) {
2801
+ if ( typeof propValue === 'undefined' || propValue === null ) {
2802
+ return '' + propValue ;
2803
+ }
2774
2804
var propType = getPropType ( propValue ) ;
2775
2805
if ( propType === 'object' ) {
2776
2806
if ( propValue instanceof Date ) {
@@ -2782,6 +2812,23 @@ module.exports = function(isValidElement, throwOnDirectAccess) {
2782
2812
return propType ;
2783
2813
}
2784
2814
2815
+ // Returns a string that is postfixed to a warning about an invalid type.
2816
+ // For example, "undefined" or "of type array"
2817
+ function getPostfixForTypeWarning ( value ) {
2818
+ var type = getPreciseType ( value ) ;
2819
+ switch ( type ) {
2820
+ case 'array' :
2821
+ case 'object' :
2822
+ return 'an ' + type ;
2823
+ case 'boolean' :
2824
+ case 'date' :
2825
+ case 'regexp' :
2826
+ return 'a ' + type ;
2827
+ default :
2828
+ return type ;
2829
+ }
2830
+ }
2831
+
2785
2832
// Returns class name of the object, if any.
2786
2833
function getClassName ( propValue ) {
2787
2834
if ( ! propValue . constructor || ! propValue . constructor . name ) {
@@ -2854,7 +2901,7 @@ module.exports = ReactPropTypesSecret;
2854
2901
Object . defineProperty ( exports , "__esModule" , {
2855
2902
value : true
2856
2903
} ) ;
2857
- exports . Chart = exports . defaults = exports . Bubble = exports . Polar = exports . Radar = exports . HorizontalBar = exports . Bar = exports . Line = exports . Pie = exports . Doughnut = undefined ;
2904
+ exports . Chart = exports . defaults = exports . Scatter = exports . Bubble = exports . Polar = exports . Radar = exports . HorizontalBar = exports . Bar = exports . Line = exports . Pie = exports . Doughnut = undefined ;
2858
2905
2859
2906
var _extends = Object . assign || function ( target ) { for ( var i = 1 ; i < arguments . length ; i ++ ) { var source = arguments [ i ] ; for ( var key in source ) { if ( Object . prototype . hasOwnProperty . call ( source , key ) ) { target [ key ] = source [ key ] ; } } } return target ; } ;
2860
2907
@@ -3149,7 +3196,13 @@ ChartComponent.propTypes = {
3149
3196
options : _propTypes2 . default . object ,
3150
3197
plugins : _propTypes2 . default . arrayOf ( _propTypes2 . default . object ) ,
3151
3198
redraw : _propTypes2 . default . bool ,
3152
- type : _propTypes2 . default . oneOf ( [ 'doughnut' , 'pie' , 'line' , 'bar' , 'horizontalBar' , 'radar' , 'polarArea' , 'bubble' ] ) ,
3199
+ type : function type ( props , propName , componentName ) {
3200
+ if ( ! Object . keys ( _chart2 . default . controllers ) . find ( function ( chartType ) {
3201
+ return chartType === props [ propName ] ;
3202
+ } ) ) {
3203
+ return new Error ( 'Invalid chart type `' + props [ propName ] + '` supplied to' + ' `' + componentName + '`.' ) ;
3204
+ }
3205
+ } ,
3153
3206
width : _propTypes2 . default . number ,
3154
3207
datasetKeyProvider : _propTypes2 . default . func
3155
3208
} ;
@@ -3375,6 +3428,32 @@ var Bubble = exports.Bubble = function (_React$Component9) {
3375
3428
return Bubble ;
3376
3429
} ( _react2 . default . Component ) ;
3377
3430
3431
+ var Scatter = exports . Scatter = function ( _React$Component10 ) {
3432
+ _inherits ( Scatter , _React$Component10 ) ;
3433
+
3434
+ function Scatter ( ) {
3435
+ _classCallCheck ( this , Scatter ) ;
3436
+
3437
+ return _possibleConstructorReturn ( this , ( Scatter . __proto__ || Object . getPrototypeOf ( Scatter ) ) . apply ( this , arguments ) ) ;
3438
+ }
3439
+
3440
+ _createClass ( Scatter , [ {
3441
+ key : 'render' ,
3442
+ value : function render ( ) {
3443
+ var _this20 = this ;
3444
+
3445
+ return _react2 . default . createElement ( ChartComponent , _extends ( { } , this . props , {
3446
+ ref : function ref ( _ref10 ) {
3447
+ return _this20 . chart_instance = _ref10 && _ref10 . chart_instance ;
3448
+ } ,
3449
+ type : 'scatter'
3450
+ } ) ) ;
3451
+ }
3452
+ } ] ) ;
3453
+
3454
+ return Scatter ;
3455
+ } ( _react2 . default . Component ) ;
3456
+
3378
3457
var defaults = exports . defaults = _chart2 . default . defaults ;
3379
3458
exports . Chart = _chart2 . default ;
3380
3459
0 commit comments