1
1
'use strict' ;
2
2
3
+ Object . defineProperty ( exports , '__esModule' , { value : true } ) ;
4
+
3
5
function _interopDefault ( ex ) { return ( ex && ( typeof ex === 'object' ) && 'default' in ex ) ? ex [ 'default' ] : ex ; }
4
6
7
+ var _pt = _interopDefault ( require ( 'prop-types' ) ) ;
5
8
var React = _interopDefault ( require ( 'react' ) ) ;
6
- var PropTypes = _interopDefault ( require ( 'prop-types' ) ) ;
7
9
var Modal = _interopDefault ( require ( 'react-modal' ) ) ;
8
10
9
11
var CLOSE_TIMEOUT = 500 ;
@@ -18,26 +20,28 @@ function ReactSlidingPane(_ref) {
18
20
overlayClassName = _ref . overlayClassName ,
19
21
closeIcon = _ref . closeIcon ,
20
22
_ref$from = _ref . from ,
21
- from = _ref$from === void 0 ? ' right' : _ref$from ,
23
+ from = _ref$from === void 0 ? " right" : _ref$from ,
22
24
width = _ref . width ,
23
- shouldCloseOnEsc = _ref . shouldCloseOnEsc ;
25
+ shouldCloseOnEsc = _ref . shouldCloseOnEsc ,
26
+ _ref$hideHeader = _ref . hideHeader ,
27
+ hideHeader = _ref$hideHeader === void 0 ? false : _ref$hideHeader ;
24
28
var directionClass = "slide-pane_from_" . concat ( from ) ;
25
29
return /*#__PURE__*/ React . createElement ( Modal , {
26
30
ariaHideApp : false ,
27
- className : "slide-pane " . concat ( directionClass , " " ) . concat ( className || '' ) ,
31
+ className : "slide-pane " . concat ( directionClass , " " ) . concat ( className || "" ) ,
28
32
style : {
29
33
content : {
30
- width : width || ' 80%'
34
+ width : width || " 80%"
31
35
}
32
36
} ,
33
- overlayClassName : "slide-pane__overlay " . concat ( overlayClassName || '' ) ,
37
+ overlayClassName : "slide-pane__overlay " . concat ( overlayClassName || "" ) ,
34
38
closeTimeoutMS : CLOSE_TIMEOUT ,
35
39
isOpen : isOpen ,
36
40
shouldCloseOnEsc : shouldCloseOnEsc ,
37
41
onAfterOpen : onAfterOpen ,
38
42
onRequestClose : onRequestClose ,
39
- contentLabel : "Modal \"" . concat ( title || '' , "\"" )
40
- } , /*#__PURE__*/ React . createElement ( "div" , {
43
+ contentLabel : "Modal \"" . concat ( title || "" , "\"" )
44
+ } , ! hideHeader && /*#__PURE__*/ React . createElement ( "div" , {
41
45
className : "slide-pane__header"
42
46
} , /*#__PURE__*/ React . createElement ( "div" , {
43
47
className : "slide-pane__close" ,
@@ -53,18 +57,19 @@ function ReactSlidingPane(_ref) {
53
57
} , children ) ) ;
54
58
}
55
59
ReactSlidingPane . propTypes = {
56
- isOpen : PropTypes . bool . isRequired ,
57
- title : PropTypes . any ,
58
- subtitle : PropTypes . any ,
59
- onRequestClose : PropTypes . func ,
60
- onAfterOpen : PropTypes . func ,
61
- children : PropTypes . any . isRequired ,
62
- className : PropTypes . string ,
63
- overlayClassName : PropTypes . string ,
64
- from : PropTypes . oneOf ( [ 'left' , 'right' , 'bottom' ] ) ,
65
- width : PropTypes . string ,
66
- closeIcon : PropTypes . any ,
67
- shouldCloseOnEsc : PropTypes . bool
60
+ isOpen : _pt . bool . isRequired ,
61
+ title : _pt . string . isRequired ,
62
+ subtitle : _pt . string ,
63
+ from : _pt . oneOf ( [ "left" , "right" , "bottom" ] ) ,
64
+ children : _pt . node . isRequired ,
65
+ className : _pt . string ,
66
+ overlayClassName : _pt . string ,
67
+ width : _pt . string ,
68
+ closeIcon : _pt . node ,
69
+ shouldCloseOnEsc : _pt . bool ,
70
+ hideHeader : _pt . bool ,
71
+ onRequestClose : _pt . func ,
72
+ onAfterOpen : _pt . func
68
73
} ;
69
74
70
75
function IconClose ( ) {
@@ -78,4 +83,5 @@ function IconClose() {
78
83
} ) ) ;
79
84
}
80
85
81
- module . exports = ReactSlidingPane ;
86
+ exports . ReactSlidingPane = ReactSlidingPane ;
87
+ exports . default = ReactSlidingPane ;
0 commit comments