# Class UploadButtonComponent

#### Implements

- ControlValueAccessor
- MatFormFieldControl<File>
- OnDestroy

- Defined in upload-button/upload-button.component.ts:70

#####
Index

### Constructors

constructor

### Properties

accept
acceptAttribute
allowDownload
autofilled?
controlType?
disabled
errorState
focused
isImageUploaded
ngControl
positions
required
shouldLabelFloat
snackBar
stateChanges
touched
uploaded
userAriaDescribedBy?
value
nextId

### Accessors

empty
id
isImage
placeholder

### Methods

clear
download
ngOnDestroy
onContainerClick
onFileInputChange
onFocusIn
onFocusOut
openOverlay
registerOnChange
registerOnTouched
setDescribedByIds
setDisabledState
writeValue

##
Constructors

### constructor

- new UploadButtonComponent(): UploadButtonComponent

  #### Returns UploadButtonComponent

  - Defined in upload-button/upload-button.component.ts:137

##
Properties

### accept

accept: InputSignal<string | string[]> = ...

- Defined in upload-button/upload-button.component.ts:74

### `Readonly` acceptAttribute

acceptAttribute: Signal<string | InputSignal<string | string[]>> = ...

- Defined in upload-button/upload-button.component.ts:76

### allowDownload

allowDownload: InputSignal<boolean> = ...

- Defined in upload-button/upload-button.component.ts:78

### `Optional` autofilled

autofilled?: boolean

Whether the input is currently in an autofilled state. If property is not present on the control it is assumed to be false.

Implementation of MatFormFieldControl.autofilled

- Defined in upload-button/upload-button.component.ts:97

### `Optional` controlType

controlType?: string = 'rxap-upload-button'

An optional name for the control type that can be used to distinguish `mat-form-field` elements based on their control type. The form field will add a class, `mat-form-field-type-{{controlType}}` to its root element.

Implementation of MatFormFieldControl.controlType

- Defined in upload-button/upload-button.component.ts:98

### disabled

disabled: boolean = false

Whether the control is disabled.

Implementation of MatFormFieldControl.disabled

- Defined in upload-button/upload-button.component.ts:96

### errorState

errorState: boolean = false

Whether the control is in an error state.

Implementation of MatFormFieldControl.errorState

- Defined in upload-button/upload-button.component.ts:99

### focused

focused: boolean = false

Whether the control is focused.

Implementation of MatFormFieldControl.focused

- Defined in upload-button/upload-button.component.ts:100

### isImageUploaded

isImageUploaded: WritableSignal<boolean> = ...

- Defined in upload-button/upload-button.component.ts:82

### `Readonly` ngControl

ngControl: null | NgControl = ...

Gets the AbstractControlDirective for this control.

Implementation of MatFormFieldControl.ngControl

- Defined in upload-button/upload-button.component.ts:107

### positions

positions: ConnectedPosition[] = ...

- Defined in upload-button/upload-button.component.ts:83

### required

required: boolean = false

Whether the control is required.

Implementation of MatFormFieldControl.required

- Defined in upload-button/upload-button.component.ts:102

### shouldLabelFloat

shouldLabelFloat: boolean = true

Whether the `MatFormField` label should try to float.

Implementation of MatFormFieldControl.shouldLabelFloat

- Defined in upload-button/upload-button.component.ts:103

### `Readonly` snackBar

snackBar: MatSnackBar = ...

- Defined in upload-button/upload-button.component.ts:131

### stateChanges

stateChanges: Subject<void> = ...

Stream that emits whenever the state of the control changes such that the parent `MatFormField` needs to run change detection.

Implementation of MatFormFieldControl.stateChanges

- Defined in upload-button/upload-button.component.ts:104

### touched

touched: boolean = false

- Defined in upload-button/upload-button.component.ts:92

### uploaded

uploaded: OutputEmitterRef<File> = ...

- Defined in upload-button/upload-button.component.ts:80

### `Optional` userAriaDescribedBy

userAriaDescribedBy?: string

Value of `aria-describedby` that should be merged with the described-by ids which are set by the form-field.

Implementation of MatFormFieldControl.userAriaDescribedBy

- Defined in upload-button/upload-button.component.ts:105

### value

value: null | File = null

The value of the control.

Implementation of MatFormFieldControl.value

- Defined in upload-button/upload-button.component.ts:106

### `Static` nextId

nextId: number = 0

- Defined in upload-button/upload-button.component.ts:72

##
Accessors

### empty

- get empty(): boolean

  Whether the control is empty.

  #### Returns boolean

  Implementation of MatFormFieldControl.empty

  - Defined in upload-button/upload-button.component.ts:120

### id

- get id(): string

  The element ID for this control.

  #### Returns string

  Implementation of MatFormFieldControl.id

  - Defined in upload-button/upload-button.component.ts:123

### isImage

- get isImage(): boolean

  #### Returns boolean

  - Defined in upload-button/upload-button.component.ts:143

### placeholder

- get placeholder(): string

  The placeholder for this control.

  #### Returns string

  Implementation of MatFormFieldControl.placeholder

  - Defined in upload-button/upload-button.component.ts:112
- set placeholder(plh: string): void

  The placeholder for this control.

  #### Parameters

  - plh: string

  #### Returns void

  Implementation of MatFormFieldControl.placeholder

  - Defined in upload-button/upload-button.component.ts:116

##
Methods

### clear

- clear(): void

  #### Returns void

  - Defined in upload-button/upload-button.component.ts:234

### download

- download(): void

  #### Returns void

  - Defined in upload-button/upload-button.component.ts:208

### ngOnDestroy

- ngOnDestroy(): void

  A callback method that performs custom clean-up, invoked immediately before a directive, pipe, or service instance is destroyed.

  #### Returns void

  Implementation of OnDestroy.ngOnDestroy

  - Defined in upload-button/upload-button.component.ts:160

### onContainerClick

- onContainerClick(event: MouseEvent): void

  Handles a click on the control's container.

  #### Parameters

  - event: MouseEvent

  #### Returns void

  Implementation of MatFormFieldControl.onContainerClick

  - Defined in upload-button/upload-button.component.ts:149

### onFileInputChange

- onFileInputChange($event: any): void

  #### Parameters

  - $event: any

  #### Returns void

  - Defined in upload-button/upload-button.component.ts:219

### onFocusIn

- onFocusIn(event: FocusEvent): void

  #### Parameters

  - event: FocusEvent

  #### Returns void

  - Defined in upload-button/upload-button.component.ts:189

### onFocusOut

- onFocusOut(event: FocusEvent): void

  #### Parameters

  - event: FocusEvent

  #### Returns void

  - Defined in upload-button/upload-button.component.ts:197

### openOverlay

- openOverlay(): void

  #### Returns void

  - Defined in upload-button/upload-button.component.ts:182

### registerOnChange

- registerOnChange(fn: any): void

  #### Parameters

  - fn: any

    The callback function to register

  #### Returns void

  #### Description

  Registers a callback function that is called when the control's value changes in the UI.

  This method is called by the forms API on initialization to update the form model when values propagate from the view to the model.

  When implementing the `registerOnChange` method in your own value accessor, save the given function so your class calls it at the appropriate time.

  #### Usage Notes

  ### Store the change function

  The following example stores the provided function as an internal method.

      registerOnChange(fn: (_: any) => void): void {
        this._onChange = fn;
      }

  When the value changes in the UI, call the registered function to allow the forms API to update itself:

      host: {
         '(change)': '_onChange($event.target.value)'
      }

  Implementation of ControlValueAccessor.registerOnChange

  - Defined in upload-button/upload-button.component.ts:164

### registerOnTouched

- registerOnTouched(fn: any): void

  #### Parameters

  - fn: any

    The callback function to register

  #### Returns void

  #### Description

  Registers a callback function that is called by the forms API on initialization to update the form model on blur.

  When implementing `registerOnTouched` in your own value accessor, save the given function so your class calls it when the control should be considered blurred or "touched".

  #### Usage Notes

  ### Store the callback function

  The following example stores the provided function as an internal method.

      registerOnTouched(fn: any): void {
        this._onTouched = fn;
      }

  On blur (or equivalent), your class should call the registered function to allow the forms API to update itself:

      host: {
         '(blur)': '_onTouched()'
      }

  Implementation of ControlValueAccessor.registerOnTouched

  - Defined in upload-button/upload-button.component.ts:168

### setDescribedByIds

- setDescribedByIds(ids: string[]): void

  Sets the list of element IDs that currently describe this control.

  #### Parameters

  - ids: string[]

  #### Returns void

  Implementation of MatFormFieldControl.setDescribedByIds

  - Defined in upload-button/upload-button.component.ts:153

### setDisabledState

- setDisabledState(isDisabled: boolean): void

  #### Parameters

  - isDisabled: boolean

    The disabled status to set on the element

  #### Returns void

  #### Description

  Function that is called by the forms API when the control status changes to or from 'DISABLED'. Depending on the status, it enables or disables the appropriate DOM element.

  #### Usage Notes

  The following is an example of writing the disabled property to a native DOM element:

      setDisabledState(isDisabled: boolean): void {
        this._renderer.setProperty(this._elementRef.nativeElement, 'disabled', isDisabled);
      }

  Implementation of ControlValueAccessor.setDisabledState

  - Defined in upload-button/upload-button.component.ts:172

### writeValue

- writeValue(file: File): void

  #### Parameters

  - file: File

  #### Returns void

  #### Description

  Writes a new value to the element.

  This method is called by the forms API to write to the view when programmatic changes from model to view are requested.

  #### Usage Notes

  ### Write a value to the element

  The following example writes a value to the native DOM element.

      writeValue(value: any): void {
        this._renderer.setProperty(this._elementRef.nativeElement, 'value', value);
      }

  Implementation of ControlValueAccessor.writeValue

  - Defined in upload-button/upload-button.component.ts:177