@@ -74,6 +74,8 @@ export const chatPropTypes: CombineProps<ChatProps> = {
74
74
mode : PropTypes . string as PropType < ChatProps [ 'mode' ] > ,
75
75
renderDivider : PropTypes . func as PropType < ChatProps [ 'renderDivider' ] > ,
76
76
markdownRenderProps : PropTypes . object as PropType < ChatProps [ 'markdownRenderProps' ] > ,
77
+
78
+ enableUpload : PropTypes . bool ,
77
79
} ;
78
80
const defaultProps = {
79
81
align : CHAT_ALIGN . LEFT_RIGHT ,
@@ -331,7 +333,7 @@ const index = defineComponent({
331
333
hintCls,
332
334
uploadProps,
333
335
uploadTipProps,
334
- sendHotKey, renderDivider, markdownRenderProps
336
+ sendHotKey, renderDivider, markdownRenderProps, enableUpload
335
337
} = props ;
336
338
const { backBottomVisible, chats, wheelScroll, uploadAreaVisible } = state ;
337
339
let showStopGenerateFlag = false ;
@@ -342,9 +344,19 @@ const index = defineComponent({
342
344
disableSend = lastChatOnGoing ;
343
345
showStopGenerate && ( showStopGenerateFlag = lastChatOnGoing ) ;
344
346
}
347
+ const { dragUpload, clickUpload, pasteUpload } = foundation . getUploadProps ( enableUpload ) ;
348
+ const dragEventHandlers = dragUpload ? {
349
+ onDragover : foundation . handleDragOver ,
350
+ onDragstart : foundation . handleDragStart ,
351
+ onDragend : foundation . handleDragEnd ,
352
+ } : { } ;
345
353
return (
346
- < div class = { cls ( `${ prefixCls } ` , className ) } style = { style } onDragover = { foundation . handleDragOver } >
347
- { uploadAreaVisible && (
354
+ < div
355
+ class = { cls ( `${ prefixCls } ` , className ) }
356
+ style = { style }
357
+ { ...dragEventHandlers }
358
+ >
359
+ { dragUpload && uploadAreaVisible && (
348
360
< div
349
361
ref = { dropAreaRef }
350
362
class = { `${ prefixCls } -dropArea` }
@@ -443,6 +455,8 @@ const index = defineComponent({
443
455
uploadProps = { uploadProps }
444
456
uploadTipProps = { uploadTipProps }
445
457
sendHotKey = { sendHotKey }
458
+ clickUpload = { clickUpload }
459
+ pasteUpload = { pasteUpload }
446
460
/>
447
461
{ bottomSlot }
448
462
</ div >
0 commit comments