1
+ 'use strict' ;
2
+
3
+ var _lodashLangIsObject2 = require ( 'lodash/lang/isObject' ) ;
4
+
5
+ var _lodashLangIsObject3 = _interopRequireDefault ( _lodashLangIsObject2 ) ;
6
+
7
+ Object . defineProperty ( exports , '__esModule' , {
8
+ value : true
9
+ } ) ;
10
+
11
+ var _createClass = ( function ( ) { function defineProperties ( target , props ) { for ( var i = 0 ; i < props . length ; i ++ ) { var descriptor = props [ i ] ; descriptor . enumerable = descriptor . enumerable || false ; descriptor . configurable = true ; if ( 'value' in descriptor ) descriptor . writable = true ; Object . defineProperty ( target , descriptor . key , descriptor ) ; } } return function ( Constructor , protoProps , staticProps ) { if ( protoProps ) defineProperties ( Constructor . prototype , protoProps ) ; if ( staticProps ) defineProperties ( Constructor , staticProps ) ; return Constructor ; } ; } ) ( ) ;
12
+
13
+ var _get = function get ( _x , _x2 , _x3 ) { var _again = true ; _function: while ( _again ) { var object = _x , property = _x2 , receiver = _x3 ; desc = parent = getter = undefined ; _again = false ; if ( object === null ) object = Function . prototype ; var desc = Object . getOwnPropertyDescriptor ( object , property ) ; if ( desc === undefined ) { var parent = Object . getPrototypeOf ( object ) ; if ( parent === null ) { return undefined ; } else { _x = parent ; _x2 = property ; _x3 = receiver ; _again = true ; continue _function; } } else if ( 'value' in desc ) { return desc . value ; } else { var getter = desc . get ; if ( getter === undefined ) { return undefined ; } return getter . call ( receiver ) ; } } } ;
14
+
15
+ function _classCallCheck ( instance , Constructor ) { if ( ! ( instance instanceof Constructor ) ) { throw new TypeError ( 'Cannot call a class as a function' ) ; } }
16
+
17
+ function _inherits ( subClass , superClass ) { if ( typeof superClass !== 'function' && superClass !== null ) { throw new TypeError ( 'Super expression must either be null or a function, not ' + typeof superClass ) ; } subClass . prototype = Object . create ( superClass && superClass . prototype , { constructor : { value : subClass , enumerable : false , writable : true , configurable : true } } ) ; if ( superClass ) Object . setPrototypeOf ? Object . setPrototypeOf ( subClass , superClass ) : subClass . __proto__ = superClass ; }
18
+
19
+ var _linkClass = require ( './linkClass' ) ;
20
+
21
+ var _linkClass2 = _interopRequireDefault ( _linkClass ) ;
22
+
23
+ var _react = require ( 'react' ) ;
24
+
25
+ var _react2 = _interopRequireDefault ( _react ) ;
26
+
27
+ function _interopRequireDefault ( obj ) { return obj && obj . __esModule ? obj : { 'default' : obj } ; }
28
+
29
+ var extendReactClass = undefined ;
30
+
31
+ extendReactClass = function ( Component , defaultStyles , options ) {
32
+ return ( function ( _Component ) {
33
+ _inherits ( _class , _Component ) ;
34
+
35
+ function _class ( ) {
36
+ _classCallCheck ( this , _class ) ;
37
+
38
+ _get ( Object . getPrototypeOf ( _class . prototype ) , 'constructor' , this ) . apply ( this , arguments ) ;
39
+ }
40
+
41
+ _createClass ( _class , [ {
42
+ key : 'render' ,
43
+ value : function render ( ) {
44
+ var renderResult = undefined ,
45
+ styles = undefined ;
46
+
47
+ if ( this . props . styles ) {
48
+ styles = this . props . styles ;
49
+ } else if ( ( 0 , _lodashLangIsObject3 [ 'default' ] ) ( defaultStyles ) ) {
50
+ styles = defaultStyles ;
51
+ } else {
52
+ styles = { } ;
53
+ }
54
+
55
+ renderResult = _get ( Object . getPrototypeOf ( _class . prototype ) , 'render' , this ) . call ( this ) ;
56
+
57
+ if ( renderResult ) {
58
+ return ( 0 , _linkClass2 [ 'default' ] ) ( renderResult , styles , options ) ;
59
+ }
60
+
61
+ return _react2 [ 'default' ] . createElement ( 'noscript' ) ;
62
+ }
63
+ } ] ) ;
64
+
65
+ return _class ;
66
+ } ) ( Component ) ;
67
+ } ;
68
+
69
+ exports [ 'default' ] = extendReactClass ;
70
+ module . exports = exports [ 'default' ] ;
0 commit comments