1- import { warning } from 'rc-util' ;
2- import pickAttrs from 'rc-util/lib/pickAttrs' ;
1+ import { warning } from '@ rc-component/ util' ;
2+ import pickAttrs from '@ rc-component/ util/lib/pickAttrs' ;
33import * as React from 'react' ;
44import type { SelectorProps } from '../../../interface' ;
55import { formatValue } from '../../../utils/dateUtil' ;
@@ -86,12 +86,7 @@ export default function useInputProps<DateType extends object = any>(
8686 const firstFormat = format [ 0 ] ;
8787
8888 const getText = React . useCallback (
89- ( date : DateType ) =>
90- formatValue ( date , {
91- locale,
92- format : firstFormat ,
93- generateConfig,
94- } ) ,
89+ ( date : DateType ) => formatValue ( date , { locale, format : firstFormat , generateConfig } ) ,
9590 [ locale , generateConfig , firstFormat ] ,
9691 ) ;
9792
@@ -131,10 +126,7 @@ export default function useInputProps<DateType extends object = any>(
131126 return index !== undefined ? propValue [ index ] : propValue ;
132127 }
133128
134- const pickedAttrs = pickAttrs ( props , {
135- aria : true ,
136- data : true ,
137- } ) ;
129+ const pickedAttrs = pickAttrs ( props , { aria : true , data : true } ) ;
138130
139131 const inputProps = {
140132 ...pickedAttrs ,
@@ -198,9 +190,7 @@ export default function useInputProps<DateType extends object = any>(
198190 onInvalid ( ! ! text , index ) ;
199191 } ,
200192 onHelp : ( ) => {
201- onOpenChange ( true , {
202- index,
203- } ) ;
193+ onOpenChange ( true , { index } ) ;
204194 } ,
205195 onKeyDown : ( event : React . KeyboardEvent < HTMLDivElement > ) => {
206196 let prevented = false ;
@@ -218,9 +208,7 @@ export default function useInputProps<DateType extends object = any>(
218208 if ( ! event . defaultPrevented && ! prevented ) {
219209 switch ( event . key ) {
220210 case 'Escape' :
221- onOpenChange ( false , {
222- index,
223- } ) ;
211+ onOpenChange ( false , { index } ) ;
224212 break ;
225213 case 'Enter' :
226214 if ( ! open ) {
@@ -232,9 +220,7 @@ export default function useInputProps<DateType extends object = any>(
232220 } ,
233221
234222 // ============ Post Props ============
235- ...postProps ?.( {
236- valueTexts,
237- } ) ,
223+ ...postProps ?.( { valueTexts } ) ,
238224 } ;
239225
240226 // ============== Clean Up ==============
0 commit comments