kvision / pl.treksoft.kvision.form.upload / UploadInput

UploadInput

(js) open class UploadInput : Widget, FormInput

The file upload component.

Constructors

(js)

<init>

UploadInput(uploadUrl: String? = null, multiple: Boolean = false, classes: Set<String> = setOf())

Properties

(js)

allowedFileExtensions

Allowed file extensions.

var allowedFileExtensions: Set<String>?
(js)

allowedFileTypes

Allowed file types.

var allowedFileTypes: Set<String>?
(js)

browseOnZoneClick

Determines if the click on the preview zone opens file browse window.

var browseOnZoneClick: Boolean
(js)

disabled

Determines if the field is disabled.

open var disabled: Boolean
(js)

dropZoneEnabled

Determines if Drag&Drop zone is enabled.

var dropZoneEnabled: Boolean
(js)

explorerTheme

Determines if the explorer theme is used.

var explorerTheme: Boolean
(js)

multiple

Determines if multiple file upload is supported.

var multiple: Boolean
(js)

name

The name attribute of the generated HTML input element.

open var name: String?
(js)

placeholder

The placeholder for the upload control.

var placeholder: String?
(js)

preferIconicPreview

Determines if the iconic preview is prefered.

var preferIconicPreview: Boolean
(js)

required

Determines if the input selection is required.

var required: Boolean
(js)

showBrowse

Determines if the file browse button is shown.

var showBrowse: Boolean
(js)

showCancel

Determines if the cancel button is shown.

var showCancel: Boolean
(js)

showCaption

Determines if the caption is shown.

var showCaption: Boolean
(js)

showPreview

Determines if the preview is shown.

var showPreview: Boolean
(js)

showRemove

Determines if the remove button is shown.

var showRemove: Boolean
(js)

showUpload

Determines if the upload button is shown.

var showUpload: Boolean
(js)

size

The size of the input (currently not working)

open var size: InputSize?
(js)

uploadExtraData

The extra data that will be passed as data to the AJAX server call via POST.

var uploadExtraData: ((String, Int) -> dynamic)?
(js)

uploadUrl

The optional URL for the upload processing action. If not set the upload button action will default to form submission.

var uploadUrl: String?
(js)

validationStatus

The validation status of the input.

open var validationStatus: ValidationStatus?
(js)

value

File input value.

var value: List<KFile>?

Functions

(js)

afterDestroy

Method called after destroying Snabbdom vnode.

open fun afterDestroy(): Unit
(js)

afterInsert

Method called after inserting Snabbdom vnode into the DOM.

open fun afterInsert(node: VNode): Unit
(js)

blur

Makes the input element blur.

open fun blur(): Unit
(js)

cancel

Cancel an ongoing ajax upload (only for ajax mode).

open fun cancel(): Unit
(js)

clearInput

Clears the file input control (including the native input).

open fun clearInput(): Unit
(js)

focus

Makes the input element focused.

open fun focus(): Unit
(js)

getNativeFile

Returns the native JavaScript File object.

fun getNativeFile(kFile: KFile): File?
(js)

getSnAttrs

Returns list of element attributes in the form of a List.

open fun getSnAttrs(): List<StringPair>
(js)

getSnClass

Returns list of CSS class names for current widget in the form of a List.

open fun getSnClass(): List<StringBoolPair>
(js)

getValueAsString

Returns the value of the file input control as a String.

fun getValueAsString(): String?
(js)

lock

Locks the file input (disabling all buttons except a cancel button).

open fun lock(): Unit
(js)

render

Renders current component as a Snabbdom vnode.

open fun render(): VNode
(js)

resetInput

Resets the file input control.

open fun resetInput(): Unit
(js)

unlock

Unlocks the file input.

open fun unlock(): Unit
(js)

upload

Trigger ajax upload (only for ajax mode).

open fun upload(): Unit

Extension Properties

(js)

changeFlow

val <T : Widget> T.changeFlow: Flow<T>
(js)

clickFlow

val <T : Widget> T.clickFlow: Flow<T>
(js)

inputFlow

val <T : Widget> T.inputFlow: Flow<T>

Extension Functions

(js)

addBsBgColor

fun Component.addBsBgColor(bsBgColor: BsBgColor): Unit
(js)

addBsBorder

fun Component.addBsBorder(vararg bsBorder: BsBorder): Unit
(js)

addBsClearfix

fun Component.addBsClearfix(): Unit
(js)

addBsColor

fun Component.addBsColor(bsColor: BsColor): Unit
(js)

addBsRounded

fun Component.addBsRounded(vararg bsRounded: BsRounded): Unit
(js)

contextMenu

DSL builder extension function.

fun Widget.contextMenu(fixedPosition: Boolean = false, classes: Set<String> = setOf(), init: (ContextMenu.() -> Unit)? = null): ContextMenu
(js)

eventFlow

fun <T : Widget> T.eventFlow(event: String): Flow<Pair<T, Event>>
(js)

onEvent

fun <T : Widget> T.onEvent(block: SnOn<T>.() -> Unit): Int
(js)

removeBsBgColor

fun Component.removeBsBgColor(bsBgColor: BsBgColor): Unit
(js)

removeBsBorder

fun Component.removeBsBorder(vararg bsBorder: BsBorder): Unit
(js)

removeBsClearfix

fun Component.removeBsClearfix(): Unit
(js)

removeBsColor

fun Component.removeBsColor(bsColor: BsColor): Unit
(js)

removeBsRounded

fun Component.removeBsRounded(vararg bsRounded: BsRounded): Unit
(js)

setContextMenu

Sets context menu for the current widget.

fun Widget.setContextMenu(contextMenu: ContextMenu): Widget
(js)

style

DSL builder extension function.

fun Widget.style(className: String? = null, init: (Style.() -> Unit)? = null): Style