@@ -24,6 +24,12 @@ var _isDom = require('is-dom');
24
24
25
25
var _isDom2 = _interopRequireDefault ( _isDom ) ;
26
26
27
+ var _actions = require ( './actions' ) ;
28
+
29
+ var actions = _interopRequireWildcard ( _actions ) ;
30
+
31
+ function _interopRequireWildcard ( obj ) { if ( obj && obj . __esModule ) { return obj ; } else { var newObj = { } ; if ( obj != null ) { for ( var key in obj ) { if ( Object . prototype . hasOwnProperty . call ( obj , key ) ) newObj [ key ] = obj [ key ] ; } } newObj . default = obj ; return newObj ; } }
32
+
27
33
function _interopRequireDefault ( obj ) { return obj && obj . __esModule ? obj : { default : obj } ; }
28
34
29
35
function _toConsumableArray ( arr ) { if ( Array . isArray ( arr ) ) { for ( var i = 0 , arr2 = Array ( arr . length ) ; i < arr . length ; i ++ ) { arr2 [ i ] = arr [ i ] ; } return arr2 ; } else { return Array . from ( arr ) ; } }
@@ -286,11 +292,22 @@ function resolve(obj) {
286
292
return names ;
287
293
}
288
294
289
- function deprecatedWarning ( props ) {
290
- if ( props && props . el ) {
295
+ var actionTypes = Object . keys ( actions ) . map ( function ( k ) {
296
+ return actions [ k ] ;
297
+ } ) . filter ( function ( e ) {
298
+ return typeof e === 'string' ;
299
+ } ) ;
300
+ function deprecatedWarning ( action ) {
301
+ var type = action . type ;
302
+ var payload = action . payload ;
303
+
304
+ if ( actionTypes . indexOf ( action . type ) === - 1 ) {
305
+ return ; // Ignore non-related actions
306
+ }
307
+ if ( payload && payload . el ) {
291
308
console . warn ( 'DEPRECATED: Use \'origin\' instead of \'el\' in props for Tooltip component or \'show\' action.' ) ;
292
309
}
293
- if ( props && props . el && props . origin ) {
310
+ if ( payload && payload . el && payload . origin ) {
294
311
console . warn ( 'Do not pass both \'origin\' and \'el\' props at the same time.' ) ;
295
312
}
296
313
}
0 commit comments