Options
All
  • Public
  • Public/Protected
  • All
Menu

Module domainLogic/dataExtractors

Index

Functions

  • checkboxFromDOM(guardEl: HTMLElement, guardName: string): HTMLInputElement
  • Get the guard's checkbox from the DOM

    Parameters

    • guardEl: HTMLElement

      The root of the guard's tree

    • guardName: string

      The guard's name

    Returns HTMLInputElement

  • descriptionFromDOM(guardEl: HTMLElement): undefined | null | string
  • Retrieve the guard's description from the DOM

    Parameters

    • guardEl: HTMLElement

      The root of the guard's state tree

    Returns undefined | null | string

  • guardIsRequiredInDOM(guardEl: HTMLElement, checkbox: HTMLInputElement): boolean
  • Check whether the guard is marked as required in the DOM

    Parameters

    • guardEl: HTMLElement

      The root of the guard's state tree

    • checkbox: HTMLInputElement

      The guard's checkbox

    Returns boolean

  • nameFromDOM(guardEl: HTMLElement, guardDataKey: string, nameDataKey?: string): string
  • Get the guard's name from the DOM

    throws

    {NoNameError} - If it can't find the guard's name

    Parameters

    • guardEl: HTMLElement

      The guard element to query

    • guardDataKey: string

      The key in the dataset of {@link guardEl} where the name could be

    • nameDataKey: string = "gdpr-guard-name"

      The name of the data attribute that can be found in child nodes to parse the name

    Returns string

  • parseManagerDetails(gdprEl: HTMLElement): { managerCheckbox: HTMLInputElement; managerEl: HTMLElement; managerName: string }
  • Extract the manager's own details from the DOM

    Parameters

    • gdprEl: HTMLElement

      The root of the GDPR state tree

    Returns { managerCheckbox: HTMLInputElement; managerEl: HTMLElement; managerName: string }

    • managerCheckbox: HTMLInputElement
    • managerEl: HTMLElement
    • managerName: string
  • storageFromDOM(guardEl: HTMLElement): null | GdprStorage
  • syncRequiredInDOM(guardEl: HTMLElement, checkbox: HTMLInputElement, isRequired?: boolean): void
  • Sync the required status across all attributes in the DOM

    Parameters

    • guardEl: HTMLElement

      The root of the guard's state tree

    • checkbox: HTMLInputElement

      The guard's checkbox

    • isRequired: boolean = false

      Whether the guard is already marked as required

    Returns void