Mobile.FlexberryFileComponent Class
addon/components/mobile/flexberry-file.js:8
Mobile version of flexberry-file component (with mobile-specific defaults).
Item Index
Methods
- _dataURLtoFile
- _isValidTypeFile
- _onRelatedModelPreSave
- _previewOptionsDidChange
- _subscribeOnRelatedModelPreSaveEvent
- _unsubscribeFromRelatedModelPresaveEvent
- _uploadDataDidChange
- _valueDidChange
- actions.addButtonClick
- actions.downloadButtonClick
- actions.onMenuItemClick
- actions.removeButtonClick
- actions.uploadButtonClick
- actions.viewLoadedImage
- downloadFile
- getTargetObjectByCondition.
- initProperty
- removeFile
- showDownloadErrorModalDialog
- showErrorModalDialog
- showFileExtensionErrorModalDialog
- showUploadErrorModalDialog
- uploadFile
Properties
- _addButtonIsEnabled
- _addButtonIsVisible
- _canLoadPreview
- _downloadButtonIsEnabled
- _downloadButtonIsVisible
- _errorModalDialog
- _errorModalDialogCaption
- _errorModalDialogContent
- _errorPreviewCaption
- _fileInputId
- _fileName
- _fileSizeUnits
- _hasFile
- _initialValue
- _isMobile
- _jsonInitialValue
- _jsonValue
- _menuItems
- _previewDownloadIsInProgress
- _previewImageAsBase64String
- _removeButtonIsEnabled
- _removeButtonIsVisible
- _selectedFile
- _uploadButtonIsEnabled
- _uploadButtonIsVisible
- _uploadData
- _uploadDataCopy
- _uploadIsInProgress
- accept
- appConfig
- appConfigSettings
- appConfigSettingsPath
- base64FileExtension
- base64FileName
- base64Value
- buttonClass
- classNameBindings
- classNames
- componentName
- currentController
- dynamicProperties
- headers
- inputClass
- isDrag
- isValidTypeFileCustom
- maxUploadFileSize
- maxUploadFileSizeUnit
- openInNewWindowInsteadOfLoading
- placeholder
- previewSettings
- readonly
- readonlyAttr
- relatedModel
- required
- showDownloadButton
- showModalDialogOnUploadError
- showPreview
- showUploadButton
- uploadOnModelPreSave
- uploadUrl
- value
- viewImageAction
Methods
_dataURLtoFile
-
dataUrl
-
fileName
_isValidTypeFile
-
fileType
-
accept
_onRelatedModelPreSave
-
e
_previewOptionsDidChange
()
private
_subscribeOnRelatedModelPreSaveEvent
()
private
_unsubscribeFromRelatedModelPresaveEvent
()
private
_uploadDataDidChange
()
private
_valueDidChange
()
private
actions.addButtonClick
()
public
actions.downloadButtonClick
()
public
actions.onMenuItemClick
-
e
Handles click on menu item of selected file.
actions.removeButtonClick
()
public
actions.uploadButtonClick
()
public
actions.viewLoadedImage
()
public
downloadFile
()
getTargetObjectByCondition.
-
condition
`
javascript
let controller = this.getTargetObjectByCondition((targetObject) => {
return targetObject instanceof Controller;
});
`
Parameters:
-
condition
FunctionCallback-function, which will be called for each 'targetObject' in 'targetObject's hierarchy, until callback return true for one of them.
Returns:
initProperty
-
options
`
javascript
// ./config/environment.js.
module.exports = function(environment) {
var ENV = {
APP: {
components: {
myComponent: {
myComponentProperty: 'myComponentProperty config-defined default value',
}
}
}
};
return ENV;
};
`
`
javascript
// /components/my-component.js
import FlexberryBaseComponent from 'ember-flexberry/flexberry-base-component';
export default FlexberryBaseComponent.extend({
appConfigSettingsPath: 'APP.components.myComponent',
myComponentProperty: undefined,
init() {
this._super.apply(this, arguments);
this.initProperty({ propertyName: 'myComponentProperty', defaultValue: 'myComponentProperty default value' });
}
});
`
removeFile
()
showDownloadErrorModalDialog
-
fileName
-
errorMessage
showErrorModalDialog
-
errorCaption
-
errorContent
Parameters:
Returns:
showFileExtensionErrorModalDialog
-
fileName
Parameters:
-
fileName
StringAdded file name.
Returns:
showUploadErrorModalDialog
-
fileName
-
actualFileSize
-
maxFileSize
-
sizeUnit
Parameters:
Returns:
uploadFile
()
Properties
_errorModalDialog
JQueryObject
private
Default: null
_errorModalDialogCaption
String
private
Default: t('components.flexberry-file.error-dialog-caption')
_errorModalDialogContent
String
private
Default: t('components.flexberry-file.error-dialog-content')
_errorPreviewCaption
String
private
Default: t('components.flexberry-file.error-preview-caption')
_fileName
String
private
_initialValue
String
private
_isMobile
Boolean
private
Flag: whether component is mobile or not. Used in base class for class names bindings.
Default: true
_jsonInitialValue
Object
private
_previewDownloadIsInProgress
Boolean
private
Default: false
_previewImageAsBase64String
String
private
Default: null
_uploadData
Object
private
Default: null
_uploadDataCopy
Object
private
Default: null
_uploadIsInProgress
Boolean
private
Default: false
accept
String
Default: undefined
appConfigSettings
Object
Default: null
appConfigSettingsPath
String
Default: 'APP.components.flexberryFile'
base64FileExtension
String
Default: null
classNames
String[]
Default: ['flexberry-file']
currentController
Controller
Default: null
dynamicProperties
Object
Default: null
inputClass
String
Default: ''
Example:
`
handlebars
`
maxUploadFileSize
Number
openInNewWindowInsteadOfLoading
Boolean
Default: false
placeholder
String
Default: t('components.flexberry-file.placeholder')
readonlyAttr
String | Undefined
readonly
query param. According to the W3C standard, returns 'readonly' if readonly
is true
and undefined
otherwise.
showModalDialogOnUploadError
Boolean
Default: false
showPreview
Boolean
Flag: indicates whether to show preview element for images or not.
Default: true
uploadOnModelPreSave
Boolean
Default: true
uploadUrl
String
value
String
viewImageAction
String
Default: 'flexberryFileViewImageAction'