@@ -68,6 +68,7 @@ export type PickerSharedProps<DateType> = {
6868 superNextIcon ?: React . ReactNode ;
6969 getPopupContainer ?: ( node : HTMLElement ) => HTMLElement ;
7070 panelRender ?: ( originPanel : React . ReactNode ) => React . ReactNode ;
71+ inputRender ?: ( props : React . InputHTMLAttributes < HTMLInputElement > ) => React . ReactNode ;
7172
7273 // Events
7374 onChange ?: ( value : DateType | null , dateString : string ) => void ;
@@ -175,6 +176,7 @@ function InnerPicker<DateType>(props: PickerProps<DateType>) {
175176 onSelect,
176177 direction,
177178 autoComplete = 'off' ,
179+ inputRender,
178180 } = props as MergedPickerProps < DateType > ;
179181
180182 const inputRef = React . useRef < HTMLInputElement > ( null ) ;
@@ -457,6 +459,31 @@ function InnerPicker<DateType>(props: PickerProps<DateType>) {
457459 ) ;
458460 }
459461
462+ const mergedInputProps : React . InputHTMLAttributes < HTMLInputElement > = {
463+ id,
464+ tabIndex,
465+ disabled,
466+ readOnly : inputReadOnly || typeof formatList [ 0 ] === 'function' || ! typing ,
467+ value : hoverValue || text ,
468+ onChange : ( e ) => {
469+ triggerTextChange ( e . target . value ) ;
470+ } ,
471+ autoFocus,
472+ placeholder,
473+ ref : inputRef ,
474+ title : text ,
475+ ...inputProps ,
476+ size : getInputSize ( picker , formatList [ 0 ] , generateConfig ) ,
477+ ...getDataOrAriaProps ( props ) ,
478+ autoComplete,
479+ } ;
480+
481+ const inputNode : React . ReactNode = inputRender ? (
482+ inputRender ( mergedInputProps )
483+ ) : (
484+ < input { ...mergedInputProps } />
485+ ) ;
486+
460487 // ============================ Warning ============================
461488 if ( process . env . NODE_ENV !== 'production' ) {
462489 warning (
@@ -521,24 +548,7 @@ function InnerPicker<DateType>(props: PickerProps<DateType>) {
521548 } ) }
522549 ref = { inputDivRef }
523550 >
524- < input
525- id = { id }
526- tabIndex = { tabIndex }
527- disabled = { disabled }
528- readOnly = { inputReadOnly || typeof formatList [ 0 ] === 'function' || ! typing }
529- value = { hoverValue || text }
530- onChange = { ( e ) => {
531- triggerTextChange ( e . target . value ) ;
532- } }
533- autoFocus = { autoFocus }
534- placeholder = { placeholder }
535- ref = { inputRef }
536- title = { text }
537- { ...inputProps }
538- size = { getInputSize ( picker , formatList [ 0 ] , generateConfig ) }
539- { ...getDataOrAriaProps ( props ) }
540- autoComplete = { autoComplete }
541- />
551+ { inputNode }
542552 { suffixNode }
543553 { clearNode }
544554 </ div >
0 commit comments