1
1
import {
2
2
ChangeEvent ,
3
3
ChangeEventHandler ,
4
+ ClipboardEventHandler ,
4
5
FocusEventHandler ,
5
6
ForwardedRef ,
6
7
KeyboardEventHandler ,
@@ -58,6 +59,7 @@ type ParamsType = {
58
59
hasInputInSearchList ?: boolean ;
59
60
name ?: string ;
60
61
internalErrorExecution ?: INTERNAL_ERROR_EXECUTION ;
62
+ disabledCopyAndPaste ?: boolean ;
61
63
onClick ?: (
62
64
event : React . KeyboardEvent < HTMLInputElement > | React . MouseEvent < HTMLInputElement , MouseEvent >
63
65
) => void ;
@@ -69,6 +71,7 @@ type ParamsType = {
69
71
onFocus ?: FocusEventHandler < HTMLInputElement > ;
70
72
onOpenCloseOptions ?: ( open : boolean ) => void ;
71
73
onInternalErrors ?: ( errors : string [ ] ) => void ;
74
+ onPaste ?: ClipboardEventHandler < HTMLInputElement > ;
72
75
} ;
73
76
74
77
type ReturnHookType = {
@@ -91,6 +94,7 @@ type ReturnHookType = {
91
94
state : InputState ;
92
95
handleFocusInternal : FocusEventHandler < HTMLInputElement > ;
93
96
handleInputPopoverChange : ChangeEventHandler < HTMLInputElement > ;
97
+ handlePasteInternal ?: ClipboardEventHandler < HTMLInputElement > ;
94
98
} ;
95
99
96
100
export const useInputDropdown = ( props : ParamsType ) : ReturnHookType => {
@@ -146,16 +150,18 @@ export const useInputDropdown = (props: ParamsType): ReturnHookType => {
146
150
} ;
147
151
148
152
// Input Basic hook
149
- const { state, inputRef, handleFocusInternal } = useInput ( {
153
+ const { state, inputRef, handleFocusInternal, handlePasteInternal } = useInput ( {
150
154
internalErrorExecution : props . internalErrorExecution ,
151
155
disabled : props . disabled ,
152
156
error : props . error || internalErrors . length > 0 ,
153
157
// need for update the state
154
158
currentValue : searchText ,
155
159
informationAssociated : props . informationAssociated ,
160
+ disabledCopyAndPaste : props . disabledCopyAndPaste ,
156
161
onFocus : props . onFocus ,
157
162
onBlur : handleInputBlur ,
158
163
onInternalErrors : props . onInternalErrors ,
164
+ onPaste : props . onPaste ,
159
165
} ) ;
160
166
161
167
const useActionBottomSheet = useMemo (
@@ -388,5 +394,6 @@ export const useInputDropdown = (props: ParamsType): ReturnHookType => {
388
394
listOptionsHeight,
389
395
handleFocusInternal,
390
396
handleInputPopoverChange,
397
+ handlePasteInternal,
391
398
} ;
392
399
} ;
0 commit comments