diff --git a/scss/components/form/_file.scss b/scss/components/form/_file.scss index 2354f180..da817f3a 100644 --- a/scss/components/form/_file.scss +++ b/scss/components/form/_file.scss @@ -78,6 +78,15 @@ } } + &-itemInfoText { + white-space: nowrap; + max-width: 180px; + overflow: hidden; + text-overflow: ellipsis; + display: inline-block; + line-height: 1; + } + &-clear { float: right; color: #999; @@ -100,6 +109,8 @@ transform: translateY(-3px); width: 100%; align-items: center; + white-space: nowrap; + text-overflow: ellipsis; >span { display: inline-block; @@ -116,6 +127,8 @@ } } + + &-progress { height: 5px; flex: 1; diff --git a/src/renderers/Form/File.tsx b/src/renderers/Form/File.tsx index 09be485d..c9772d57 100644 --- a/src/renderers/Form/File.tsx +++ b/src/renderers/Form/File.tsx @@ -705,7 +705,7 @@ export default class FileControl extends React.Component { fd.append(config.fieldName || 'file', blob, file.name); return self - ._send(reciever, fd, {}, progress => updateProgress(task.partNumber, progress)) + ._send(api, fd, {}, progress => updateProgress(task.partNumber, progress)) .then(ret => { state.loaded++; callback(null, { @@ -854,7 +854,9 @@ export default class FileControl extends React.Component { })} > - {file.name || (file as FileValue).filename} + + {file.name || (file as FileValue).filename} + {file.state === 'invalid' || file.state === 'error' ? ( ) : null} @@ -876,7 +878,7 @@ export default class FileControl extends React.Component { width: `${ file.state === 'uploaded' ? 100 - : file.progress * 100 + : (file.progress || 0) * 100 }%` }} /> diff --git a/src/renderers/Form/Image.tsx b/src/renderers/Form/Image.tsx index 3893f768..9bc390f8 100644 --- a/src/renderers/Form/Image.tsx +++ b/src/renderers/Form/Image.tsx @@ -11,6 +11,7 @@ import {buildApi} from '../../utils/api'; import {createObject, qsstringify} from '../../utils/helper'; import {Icon} from '../../components/icons'; import Button from '../../components/Button'; +// @ts-ignore import accepts from 'attr-accept'; let id = 1; @@ -137,7 +138,7 @@ export default class ImageControl extends React.Component(); - dropzone = React.createRef(); + dropzone = React.createRef(); current: FileValue | FileX | null = null; resolve?: (value?: any) => void;