11/*
2- react-datetime v2.10.3
2+ react-datetime v2.11.0
33https://github.com/YouCanBookMe/react-datetime
44MIT: https://github.com/YouCanBookMe/react-datetime/raw/master/LICENSE
55*/
@@ -412,10 +412,10 @@ return /******/ (function(modules) { // webpackBootstrap
412412 this . props . onChange ( date ) ;
413413 } ,
414414
415- openCalendar : function ( ) {
416- if ( ! this . state . open ) {
415+ openCalendar : function ( e ) {
416+ if ( ! this . state . open ) {
417417 this . setState ( { open : true } , function ( ) {
418- this . props . onFocus ( ) ;
418+ this . props . onFocus ( e ) ;
419419 } ) ;
420420 }
421421 } ,
@@ -477,26 +477,31 @@ return /******/ (function(modules) { // webpackBootstrap
477477 children = [ ] ;
478478
479479 if ( this . props . input ) {
480- children = [ React . createElement ( 'input' , assign ( {
481- key : 'i' ,
480+ var finalInputProps = assign ( {
482481 type : 'text' ,
483482 className : 'form-control' ,
483+ onClick : this . openCalendar ,
484484 onFocus : this . openCalendar ,
485485 onChange : this . onInputChange ,
486486 onKeyDown : this . onInputKey ,
487- value : this . state . inputValue
488- } , this . props . inputProps ) ) ] ;
487+ value : this . state . inputValue ,
488+ } , this . props . inputProps ) ;
489+ if ( this . props . renderInput ) {
490+ children = [ React . createElement ( 'div' , { key : 'i' } , this . props . renderInput ( finalInputProps , this . openCalendar ) ) ] ;
491+ } else {
492+ children = [ React . createElement ( 'input' , assign ( { key : 'i' } , finalInputProps ) ) ] ;
493+ }
489494 } else {
490495 className += ' rdtStatic' ;
491496 }
492497
493498 if ( this . state . open )
494499 className += ' rdtOpen' ;
495500
496- return React . createElement ( 'div' , { className : className } , children . concat (
497- React . createElement ( 'div' ,
501+ return React . createElement ( 'div' , { className : className } , children . concat (
502+ React . createElement ( 'div' ,
498503 { key : 'dt' , className : 'rdtPicker' } ,
499- React . createElement ( CalendarContainer , { view : this . state . currentView , viewProps : this . getComponentProps ( ) , onClickOutside : this . handleClickOutside } )
504+ React . createElement ( CalendarContainer , { view : this . state . currentView , viewProps : this . getComponentProps ( ) , onClickOutside : this . handleClickOutside } )
500505 )
501506 ) ) ;
502507 }
@@ -3455,17 +3460,19 @@ return /******/ (function(modules) { // webpackBootstrap
34553460 }
34563461 }
34573462
3463+ var hours = date . format ( 'H' ) ;
3464+
34583465 var daypart = false ;
34593466 if ( this . state !== null && this . props . timeFormat . toLowerCase ( ) . indexOf ( ' a' ) !== - 1 ) {
34603467 if ( this . props . timeFormat . indexOf ( ' A' ) !== - 1 ) {
3461- daypart = ( this . state . hours >= 12 ) ? 'PM' : 'AM' ;
3468+ daypart = ( hours >= 12 ) ? 'PM' : 'AM' ;
34623469 } else {
3463- daypart = ( this . state . hours >= 12 ) ? 'pm' : 'am' ;
3470+ daypart = ( hours >= 12 ) ? 'pm' : 'am' ;
34643471 }
34653472 }
34663473
34673474 return {
3468- hours : date . format ( 'H' ) ,
3475+ hours : hours ,
34693476 minutes : date . format ( 'mm' ) ,
34703477 seconds : date . format ( 'ss' ) ,
34713478 milliseconds : date . format ( 'SSS' ) ,
@@ -3485,19 +3492,19 @@ return /******/ (function(modules) { // webpackBootstrap
34853492 }
34863493 }
34873494 return React . createElement ( 'div' , { key : type , className : 'rdtCounter' } , [
3488- React . createElement ( 'span' , { key : 'up' , className : 'rdtBtn' , onMouseDown : this . onStartClicking ( 'increase' , type ) } , '▲' ) ,
3495+ React . createElement ( 'span' , { key : 'up' , className : 'rdtBtn' , onMouseDown : this . onStartClicking ( 'increase' , type ) , onContextMenu : this . disableContextMenu } , '▲' ) ,
34893496 React . createElement ( 'div' , { key : 'c' , className : 'rdtCount' } , value ) ,
3490- React . createElement ( 'span' , { key : 'do' , className : 'rdtBtn' , onMouseDown : this . onStartClicking ( 'decrease' , type ) } , '▼' )
3497+ React . createElement ( 'span' , { key : 'do' , className : 'rdtBtn' , onMouseDown : this . onStartClicking ( 'decrease' , type ) , onContextMenu : this . disableContextMenu } , '▼' )
34913498 ] ) ;
34923499 }
34933500 return '' ;
34943501 } ,
34953502
34963503 renderDayPart : function ( ) {
34973504 return React . createElement ( 'div' , { key : 'dayPart' , className : 'rdtCounter' } , [
3498- React . createElement ( 'span' , { key : 'up' , className : 'rdtBtn' , onMouseDown : this . onStartClicking ( 'toggleDayPart' , 'hours' ) } , '▲' ) ,
3505+ React . createElement ( 'span' , { key : 'up' , className : 'rdtBtn' , onMouseDown : this . onStartClicking ( 'toggleDayPart' , 'hours' ) , onContextMenu : this . disableContextMenu } , '▲' ) ,
34993506 React . createElement ( 'div' , { key : this . state . daypart , className : 'rdtCount' } , this . state . daypart ) ,
3500- React . createElement ( 'span' , { key : 'do' , className : 'rdtBtn' , onMouseDown : this . onStartClicking ( 'toggleDayPart' , 'hours' ) } , '▼' )
3507+ React . createElement ( 'span' , { key : 'do' , className : 'rdtBtn' , onMouseDown : this . onStartClicking ( 'toggleDayPart' , 'hours' ) , onContextMenu : this . disableContextMenu } , '▼' )
35013508 ] ) ;
35023509 } ,
35033510
@@ -3613,6 +3620,11 @@ return /******/ (function(modules) { // webpackBootstrap
36133620 } ;
36143621 } ,
36153622
3623+ disableContextMenu : function ( event ) {
3624+ event . preventDefault ( ) ;
3625+ return false ;
3626+ } ,
3627+
36163628 padValues : {
36173629 hours : 1 ,
36183630 minutes : 2 ,
0 commit comments