Implementation of the 'upload' markup element. Multiple HTML elements are used to create an upload drop area. For CSS manipulations the following classes are added: lto-upload-error-label: text for error messages lto-upload-file-label: upload file text lto-upload-file-extension-label: file extension text label lto-upload-size-label: file size text label lto-upload-text-label: upload file text label lto-upload: general CSS upload class

see

  IRenderable

### Hierarchy

- Upload

### Implements

- IRenderable

## Index

### Constructors

- constructor

### Properties

- dropArea
- errorSpan
- fileSpan
- spec

### Methods

- compressImage
- doValidateAndGetBase64
- doValidateCompressAndGetBase64
- removeSuccessClass
- render
- setDataToValue
- setErrorSpanTo
- setFileNameToSpan
- setSuccessClass
- validateFile

## Constructors

### constructor

- new Upload(spec: ISpecification): Upload

- - Defined in lib/renderable/upload/index.ts:24

  #### Parameters

  - ##### spec: ISpecification

  #### Returns Upload

## Properties

### Private dropArea

dropArea: HTMLDivElement = document.createElement("div")

- Defined in lib/renderable/upload/index.ts:24

### Private errorSpan

errorSpan: HTMLSpanElement = document.createElement("span")

- Defined in lib/renderable/upload/index.ts:22

### Private fileSpan

fileSpan: HTMLSpanElement = document.createElement("span")

- Defined in lib/renderable/upload/index.ts:23

### Private spec

spec: ISpecification

- Defined in lib/renderable/upload/index.ts:21

## Methods

### Private compressImage

- compressImage(file: File): Promise<File>

- - Defined in lib/renderable/upload/index.ts:159

  #### Parameters

  - ##### file: File

  #### Returns Promise<File>

### doValidateAndGetBase64

- doValidateAndGetBase64(file: File): void

- - Defined in lib/renderable/upload/index.ts:118

  #### Parameters

  - ##### file: File

  #### Returns void

### doValidateCompressAndGetBase64

- doValidateCompressAndGetBase64(file: File): void

- - Defined in lib/renderable/upload/index.ts:128

  #### Parameters

  - ##### file: File

  #### Returns void

### removeSuccessClass

- removeSuccessClass(): void

- - Defined in lib/renderable/upload/index.ts:146

  #### Returns void

### render

- render(renderer: IRenderer, isNested: boolean): HTMLElement

- Implementation of IRenderable.render

  - Defined in lib/renderable/upload/index.ts:33

  Renders an element

  #### Parameters

  - ##### renderer: IRenderer

  - ##### isNested: boolean

  #### Returns HTMLElement

  the element which was rendered

### setDataToValue

- setDataToValue(data: string, file: File): void

- - Defined in lib/renderable/upload/index.ts:150

  #### Parameters

  - ##### data: string

  - ##### file: File

  #### Returns void

### setErrorSpanTo

- setErrorSpanTo(text: string): this

- - Defined in lib/renderable/upload/index.ts:180

  #### Parameters

  - ##### text: string

  #### Returns this

### setFileNameToSpan

- setFileNameToSpan(name: string): this

- - Defined in lib/renderable/upload/index.ts:175

  #### Parameters

  - ##### name: string

  #### Returns this

### setSuccessClass

- setSuccessClass(): void

- - Defined in lib/renderable/upload/index.ts:140

  #### Returns void

### validateFile

- validateFile(size: number, extension?: undefined | string): boolean

- - Defined in lib/renderable/upload/index.ts:185

  #### Parameters

  - ##### size: number

  - ##### Optional extension: undefined | string

  #### Returns boolean

Generated using TypeDoc