@@ -3,6 +3,7 @@ import { default as AntdUpload } from "antd/es/upload";
33import { default as Dropdown } from "antd/es/dropdown" ;
44import { UploadFile , UploadProps , UploadChangeParam , UploadFileStatus , RcFile } from "antd/es/upload/interface" ;
55import { Buffer } from "buffer" ;
6+ import { v4 as uuidv4 } from "uuid" ;
67import { darkenColor } from "components/colorSelect/colorUtils" ;
78import { Section , sectionNames } from "components/Section" ;
89import { IconControl } from "comps/controls/iconControl" ;
@@ -448,6 +449,7 @@ const Upload = (
448449 text : string ;
449450 dispatch : ( action : CompAction ) => void ;
450451 forceCapture : boolean ;
452+ tabIndex ?: number ;
451453 } ,
452454) => {
453455 const { dispatch, files, style } = props ;
@@ -564,13 +566,17 @@ const Upload = (
564566 onChange = { handleOnChange }
565567
566568 >
567- < Button disabled = { props . disabled } onClick = { ( e ) => {
568- if ( props . forceCapture && ! isMobile ) {
569- e . preventDefault ( ) ;
570- e . stopPropagation ( ) ;
571- setShowModal ( true ) ;
572- }
573- } } >
569+ < Button
570+ disabled = { props . disabled }
571+ tabIndex = { typeof props . tabIndex === 'number' ? props . tabIndex : undefined }
572+ onClick = { ( e ) => {
573+ if ( props . forceCapture && ! isMobile ) {
574+ e . preventDefault ( ) ;
575+ e . stopPropagation ( ) ;
576+ setShowModal ( true ) ;
577+ }
578+ } }
579+ >
574580 { hasChildren && (
575581 < span >
576582 { hasIcon ( props . prefixIcon ) && < IconWrapper > { props . prefixIcon } </ IconWrapper > }
@@ -589,7 +595,7 @@ const Upload = (
589595 const res : Response = await fetch ( image ) ;
590596 const blob : Blob = await res . blob ( ) ;
591597 const file = new File ( [ blob ] , "image.jpg" , { type : 'image/jpeg' } ) ;
592- const fileUid = uuid . v4 ( ) ;
598+ const fileUid = uuidv4 ( ) ;
593599 const uploadFile = {
594600 uid : fileUid ,
595601 name : file . name ,
@@ -616,6 +622,7 @@ const UploadTypeOptions = [
616622const childrenMap = {
617623 text : withDefault ( StringControl , trans ( "file.upload" ) ) ,
618624 uploadType : dropdownControl ( UploadTypeOptions , "single" ) ,
625+ tabIndex : NumberControl ,
619626 ...commonChildren ,
620627 ...formDataChildren ,
621628} ;
@@ -645,6 +652,7 @@ let FileTmpComp = new UICompBuilder(childrenMap, (props, dispatch) => {
645652 { disabledPropertyView ( children ) }
646653 { hiddenPropertyView ( children ) }
647654 { showDataLoadingIndicatorsPropertyView ( children ) }
655+ { children . tabIndex . propertyView ( { label : trans ( "prop.tabIndex" ) } ) }
648656 </ Section >
649657 < Section name = { sectionNames . advanced } >
650658 { children . fileType . propertyView ( {
0 commit comments