govuk-frontend
    Preparing search index...

    Class FileUpload

    File upload component

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    _$root: HTMLElement
    _config: FileUploadConfig
    $announcements: HTMLSpanElement
    $button: HTMLButtonElement
    $input: HTMLFileInputElement
    $status: HTMLSpanElement
    enteredAnotherElement: boolean
    i18n: I18n
    id: string
    defaults: FileUploadConfig = ...

    File upload default config

    FileUploadConfig

    elementType: new () => Element = HTMLElement
    moduleName: string = 'govuk-file-upload'

    Name for the component used when initialising using data-module attributes.

    schema: Readonly<{ properties: { i18n: { type: "object" } } }> = ...

    File upload config schema

    Accessors

    Methods

    • Internal Virtual

      configOverride

      Function which defines configuration overrides to prioritize properties from the root element's dataset.

      It should take a subset of configuration as input and return a new configuration object with properties that should be overridden based on the root element's dataset. A Symbol is used for indexing to prevent conflicts.

      Parameters

      • Optionalparam: Partial<FileUploadConfig>

        Configuration object

      Returns Partial<FileUploadConfig>

      return - Configuration object

    • Private

      Looks up the <label> element associated to the field

      Returns HTMLElement

      The <label> element associated to the field

      If the <label> cannot be found

    • Private

      Updates the visibility of the dropzone as users enters the various elements on the page

      Parameters

      • event: DragEvent

        The dragenter event

      Returns void