1
- ' use strict' ;
1
+ " use strict" ;
2
2
3
3
Object . defineProperty ( exports , "__esModule" , {
4
- value : true
4
+ value : true
5
5
} ) ;
6
+ exports . default = void 0 ;
6
7
7
- 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 ; } ; } ( ) ;
8
+ var _react = _interopRequireDefault ( require ( "react" ) ) ;
8
9
9
- var _react = require ( 'react' ) ;
10
-
11
- var _react2 = _interopRequireDefault ( _react ) ;
12
-
13
- var _propTypes = require ( 'prop-types' ) ;
14
-
15
- var _propTypes2 = _interopRequireDefault ( _propTypes ) ;
10
+ var _propTypes = _interopRequireDefault ( require ( "prop-types" ) ) ;
16
11
17
12
function _interopRequireDefault ( obj ) { return obj && obj . __esModule ? obj : { default : obj } ; }
18
13
14
+ function _typeof ( obj ) { if ( typeof Symbol === "function" && typeof Symbol . iterator === "symbol" ) { _typeof = function _typeof ( obj ) { return typeof obj ; } ; } else { _typeof = function _typeof ( obj ) { return obj && typeof Symbol === "function" && obj . constructor === Symbol && obj !== Symbol . prototype ? "symbol" : typeof obj ; } ; } return _typeof ( obj ) ; }
15
+
19
16
function _classCallCheck ( instance , Constructor ) { if ( ! ( instance instanceof Constructor ) ) { throw new TypeError ( "Cannot call a class as a function" ) ; } }
20
17
21
- function _possibleConstructorReturn ( self , call ) { if ( ! self ) { throw new ReferenceError ( "this hasn't been initialised - super() hasn't been called" ) ; } return call && ( typeof call === "object" || typeof call === "function" ) ? call : self ; }
18
+ 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 ) ; } }
22
19
23
- 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 ; }
20
+ function _createClass ( Constructor , protoProps , staticProps ) { if ( protoProps ) _defineProperties ( Constructor . prototype , protoProps ) ; if ( staticProps ) _defineProperties ( Constructor , staticProps ) ; return Constructor ; }
24
21
25
- var defaultProps = {
26
- onClick : function onClick ( ) { } ,
27
- className : 'btn' ,
28
- url : null
29
- } ;
22
+ function _possibleConstructorReturn ( self , call ) { if ( call && ( _typeof ( call ) === "object" || typeof call === "function" ) ) { return call ; } if ( self === void 0 ) { throw new ReferenceError ( "this hasn't been initialised - super() hasn't been called" ) ; } return self ; }
30
23
31
- var propTypes = {
32
- onClick : _propTypes2 . default . func ,
33
- className : _propTypes2 . default . string ,
34
- children : _propTypes2 . default . node . isRequired ,
35
- url : _propTypes2 . default . string
36
- } ;
24
+ function _inherits ( subClass , superClass ) { if ( typeof superClass !== "function" && superClass !== null ) { throw new TypeError ( "Super expression must either be null or a function" ) ; } 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 ; }
37
25
38
- var Component = function ( _React$Component ) {
39
- _inherits ( Component , _React$Component ) ;
26
+ var Component =
27
+ /*#__PURE__*/
28
+ function ( _React$Component ) {
29
+ _inherits ( Component , _React$Component ) ;
40
30
41
- function Component ( ) {
42
- _classCallCheck ( this , Component ) ;
31
+ function Component ( ) {
32
+ _classCallCheck ( this , Component ) ;
43
33
44
- return _possibleConstructorReturn ( this , ( Component . __proto__ || Object . getPrototypeOf ( Component ) ) . apply ( this , arguments ) ) ;
34
+ return _possibleConstructorReturn ( this , ( Component . __proto__ || Object . getPrototypeOf ( Component ) ) . apply ( this , arguments ) ) ;
35
+ }
36
+
37
+ _createClass ( Component , [ {
38
+ key : "handleClick" ,
39
+ value : function handleClick ( ) {
40
+ return this . props . onClick ( ) ;
41
+ }
42
+ } , {
43
+ key : "render" ,
44
+ value : function render ( ) {
45
+ var _this = this ;
46
+
47
+ var className = this . props . className ;
48
+
49
+ if ( this . props . url && this . props . url !== '#' ) {
50
+ return _react . default . createElement ( "a" , {
51
+ href : this . props . url ,
52
+ target : "_blank" ,
53
+ className : className
54
+ } , this . props . children ) ;
55
+ }
56
+
57
+ return _react . default . createElement ( "button" , {
58
+ onClick : function onClick ( ) {
59
+ return _this . handleClick ( ) ;
60
+ } ,
61
+ className : className
62
+ } , this . props . children ) ;
45
63
}
64
+ } ] ) ;
46
65
47
- _createClass ( Component , [ {
48
- key : 'handleClick' ,
49
- value : function handleClick ( ) {
50
- return this . props . onClick ( ) ;
51
- }
52
- } , {
53
- key : 'render' ,
54
- value : function render ( ) {
55
- var _this2 = this ;
56
-
57
- var className = this . props . className ;
58
-
59
-
60
- if ( this . props . url && this . props . url !== '#' ) {
61
- return _react2 . default . createElement (
62
- 'a' ,
63
- { href : this . props . url , target : '_blank' , className : className } ,
64
- this . props . children
65
- ) ;
66
- }
67
-
68
- return _react2 . default . createElement (
69
- 'button' ,
70
- { onClick : function onClick ( ) {
71
- return _this2 . handleClick ( ) ;
72
- } , className : className } ,
73
- this . props . children
74
- ) ;
75
- }
76
- } ] ) ;
77
-
78
- return Component ;
79
- } ( _react2 . default . Component ) ;
66
+ return Component ;
67
+ } ( _react . default . Component ) ;
80
68
81
69
Component . displayName = 'PopupAction' ;
82
- Component . propTypes = propTypes ;
83
- Component . defaultProps = defaultProps ;
84
-
85
- exports . default = Component ;
70
+ Component . propTypes = {
71
+ onClick : _propTypes . default . func ,
72
+ className : _propTypes . default . string ,
73
+ children : _propTypes . default . node . isRequired ,
74
+ url : _propTypes . default . string
75
+ } ;
76
+ Component . defaultProps = {
77
+ onClick : function onClick ( ) { } ,
78
+ className : 'btn' ,
79
+ url : null
80
+ } ;
81
+ var _default = Component ;
82
+ exports . default = _default ;
0 commit comments