Class ConvenienceDomService

Hierarchy

  • ConvenienceDomService

Constructors

Properties

domService: DomServiceIf
focusBorderWidthInPx: number = 2

Width of the focus frame of a cell in px (WCAG 2.4.7: visible focus, not only a color).

Since

1.1.91

Methods

  • Draws the focus frame of a cell: four divs with the class ge-table-focus-border (2 px, color --ge-table-focus-outline-color resp. --ge-table-focus-border). Hidden from screen readers – they get the focus through aria-activedescendant.

    Parameters

    Returns HTMLDivElement

  • Parameters

    • parent: HTMLDivElement
    • text: string = ""
    • firstTreeColumn: boolean = false
    • rowIndex: number = -1
    • columnIndex: number = -1
    • areaIdent: AreaIdent = "body"

    Returns HTMLDivElement

  • The position of an element from the inline start in px, as written by this service (style.left, right-to-left style.right); 0 if it has none.

    Parameters

    • ele: HTMLElement

      an element positioned by this service

    Returns number

    px

    Since

    1.1.98

  • Hides a purely decorative element (border, hover, icon …) from screen readers: aria-hidden="true".

    Type Parameters

    • T extends HTMLElement

    Parameters

    • ele: T

    Returns T

    Since

    1.1.91

  • Sets the writing direction of the table. All positions of the table are computed from the start of a row (x = 0 is the first column); in right-to-left this service writes them as right instead of left – in setStyle, applyStyle, applyStyleInPx and all add… methods – so that the whole table is mirrored. Called once by the table before anything is positioned.

    Parameters

    Returns void

    Example

    const dom = new ConvenienceDomService(new SimpleDomService());
    dom.setDirection("rtl");
    const div = document.createElement("div");
    dom.setStyle(div, "left", "20px"); // div.style.right = "20px"

    Since

    1.1.98

  • The physical CSS property for a logical position key: in right-to-left left ↔ right, everything else as is.

    Parameters

    • key: string

      a CSS property

    Returns string

    the property to write

    Since

    1.1.98