@@ -11,21 +11,30 @@ var __extends = (this && this.__extends) || (function () {
1111} ) ( ) ;
1212Object . defineProperty ( exports , "__esModule" , { value : true } ) ;
1313var React = require ( "react" ) ;
14- var HandleBar = ( function ( _super ) {
14+ var ReactDOM = require ( "react-dom" ) ;
15+ var HandleBar = /** @class */ ( function ( _super ) {
1516 __extends ( HandleBar , _super ) ;
1617 function HandleBar ( ) {
17- return _super !== null && _super . apply ( this , arguments ) || this ;
18+ var _this = _super !== null && _super . apply ( this , arguments ) || this ;
19+ _this . getDivInstance = function ( ) {
20+ return ReactDOM . findDOMNode ( _this . div ) ;
21+ } ;
22+ return _this ;
1823 }
1924 HandleBar . prototype . render = function ( ) {
25+ var _this = this ;
2026 var _a = this . props , position = _a . position , handleMouseDown = _a . handleMouseDown , allowResize = _a . allowResize ;
21- var allowResizeClass = allowResize ? '' : 'resize-not-allowed' ;
22- return ( React . createElement ( "div" , { className : "handle-bar " + position + " " + allowResizeClass , onMouseDown : function ( e ) { return handleMouseDown ( e ) ; } , onTouchStart : function ( e ) { return handleMouseDown ( e ) ; } } ,
27+ var classNames = [
28+ 'handle-bar' ,
29+ position ,
30+ ! allowResize && 'resize-not-allowed' ,
31+ ] . filter ( function ( cls ) { return cls ; } ) . join ( ' ' ) ;
32+ return ( React . createElement ( "div" , { className : classNames , ref : function ( node ) { return _this . div = node ; } , onMouseDown : function ( e ) { return handleMouseDown ( e ) ; } , onTouchStart : function ( e ) { return handleMouseDown ( e ) ; } } ,
2333 React . createElement ( "span" , { className : "handle-bar_drag" } ) ) ) ;
2434 } ;
25- ;
35+ HandleBar . defaultProps = {
36+ allowResize : true
37+ } ;
2638 return HandleBar ;
2739} ( React . Component ) ) ;
28- HandleBar . defaultProps = {
29- allowResize : true
30- } ;
3140exports . default = HandleBar ;
0 commit comments