mona-dish
    Preparing search index...

    Interface IDomQuery

    interface IDomQuery {
        asArray: DomQuery[];
        childNodes: DomQuery;
        disabled: boolean;
        elements: DomQuery;
        global: any;
        id: ValueEmbedder<string>;
        innerHtml: string;
        innerHTML: string;
        inputValue: ValueEmbedder<string | boolean>;
        lazyStream: any;
        length: number;
        name: ValueEmbedder<string>;
        nodeId: string;
        nodeName: Optional<string>;
        nonce: ValueEmbedder<string>;
        offsetHeight: number;
        offsetLeft: number;
        offsetTop: number;
        offsetWidth: number;
        stream: any;
        tagName: Optional<string>;
        type: Optional<string>;
        val: string | boolean;
        value: Optional<Element>;
        values: Element[];
        addClass(clazz: string): DomQuery;
        addEventListener(
            type: string,
            listener: (evt: Event) => void,
            options?: boolean | EventListenerOptions,
        ): DomQuery;
        allElems(): Element[];
        allParents(selector: string): DomQuery;
        append(elem: DomQuery): DomQuery;
        appendTo(elem: string | DomQuery): DomQuery;
        attachShadow(modeParams: { [key: string]: string }): DomQuery;
        attr(attr: string, defaultValue: string): ElementAttribute;
        byId(id: string, includeRoot?: boolean): DomQuery;
        byTagName(tagName: string, includeRoot?: boolean): DomQuery;
        click(): DomQuery;
        copyAttrs(sourceItem: XMLQuery | DomQuery): DomQuery;
        delete(): void;
        detach(): DomQuery;
        dispatchEvent(evt: Event): DomQuery;
        each(func: (item: DomQuery, cnt?: number) => any): DomQuery;
        eachElem(func: (item: Element, cnt?: number) => any): DomQuery;
        encodeFormElement(toMerge?: any): { [key: string]: any };
        filter(func: (item: DomQuery) => boolean): DomQuery;
        fireEvent(eventName: string): void;
        first(func: (item: DomQuery, cnt?: number) => any): DomQuery;
        firstElem(func: (item: Element, cnt?: number) => any): DomQuery;
        firstParent(selector: string): DomQuery;
        get(index: number): DomQuery;
        getAsElem(index: number, defaults: Optional<any>): Optional<Element>;
        getIf(...nodeSelector: string[]): DomQuery;
        globalEval(code: string, nonce?: string): DomQuery;
        globalEvalSticky(code: string, nonce?: string): DomQuery;
        hasClass(clazz: string): boolean;
        html(newInnerHTML?: string): DomQuery | Optional<string>;
        ifPresentLazy(presentRunnable: (elem?: DomQuery) => void): DomQuery;
        innerText(joinString?: string): string;
        insertAfter(...toInsert: DomQuery[]): DomQuery;
        insertBefore(...toInsert: DomQuery[]): DomQuery;
        isAbsent(): boolean;
        isMultipartCandidate(): boolean;
        isPresent(presentRunnable?: (elem?: DomQuery) => void): boolean;
        isTag(tagName: string): boolean;
        last(func: (item: DomQuery, cnt?: number) => any): DomQuery;
        lastElem(func: (item: Element, cnt?: number) => any): DomQuery;
        loadScriptEval(src: string, delay: number, charSet: string): void;
        orElse(...elseValue: any): DomQuery;
        orElseLazy(func: () => any): DomQuery;
        outerHTML(
            markup: string,
            runEmbeddedScripts?: boolean,
            runEmbeddedCss?: boolean,
        ): DomQuery;
        parent(): DomQuery;
        parentsWhileMatch(selector: string): DomQuery;
        prepend(elem: DomQuery): DomQuery;
        prependTo(elem: DomQuery): DomQuery;
        querySelectorAll(selector: string): DomQuery;
        querySelectorAll(selector: string): DomQuery;
        removeClass(clazz: string): DomQuery;
        removeEventListener(
            type: string,
            listener: (evt: Event) => void,
            options?: boolean | EventListenerOptions,
        ): DomQuery;
        replace(toReplace: DomQuery): DomQuery;
        runCss(): DomQuery;
        runScripts(
            sticky?: boolean,
            whiteListed?: (val: string) => boolean,
        ): DomQuery;
        style(cssProperty: string, defaultValue: string): Style;
        subNodes(from: number, to?: number): DomQuery;
        textContent(joinString?: string): string;
        waitUntilDom(
            condition: (element: DomQuery) => boolean,
            options: WAIT_OPTS,
        ): Promise<DomQuery>;
    }

    Implemented by

    Index

    Properties

    asArray: DomQuery[]

    transform this node collection to an array

    childNodes: DomQuery

    The child nodes of this node collection as readonly attribute

    disabled: boolean

    settable flag for disabled

    elements: DomQuery

    the underlying form elements as DomQuery object

    global: any

    reference to the systems global object (globalThis, window, global, depending on the environment)

    id: ValueEmbedder<string>

    returns the id as settable value (See also ValueEmbedder)

    innerHtml: string

    same as innerHTML will be removed once my code is transitioned

    do not use anymore, user innerHTML instead

    innerHTML: string

    inner html property setter and getter which works directly on strings

    inputValue: ValueEmbedder<string | boolean>

    The value in case of inputs as changeable value

    lazyStream: any

    lazy stream representation for this DomQuery

    length: number

    returns the length of embedded nodes (top level)

    name: ValueEmbedder<string>

    The name as changeable value

    nodeId: string

    convenience for dq.id.value to make the code a little tighter

    nodeName: Optional<string>

    the node name of the first element

    nonce: ValueEmbedder<string>

    nonce value if our first root element

    offsetHeight: number

    accumulated top element offsetHeight

    offsetLeft: number

    accumulated top element offsetLeft

    offsetTop: number

    accumulated top element offsetTop

    offsetWidth: number

    accumulated top element offsetWidth

    stream: any

    an early stream representation for this DomQuery

    tagName: Optional<string>

    the tag name of the first element

    type: Optional<string>

    the type of the first element

    val: string | boolean

    abbreviation for inputValue.value to make the code terser

    value: Optional<Element>

    reads the first element if it exists and returns an optional

    values: Element[]

    All elements as array

    Methods

    • appends a class string if not already in the element(s)

      Parameters

      • clazz: string

        the style class to append

      Returns DomQuery

    • adds an event listener

      Parameters

      • type: string
      • listener: (evt: Event) => void
      • Optionaloptions: boolean | EventListenerOptions

      Returns DomQuery

    • returns the value array< of all elements

      Returns Element[]

    • find all parents in the hierarchy for which the selector matches

      Parameters

      • selector: string

      Returns DomQuery

    • attach shadow elements 1:1 mapping from attach shadow

      Parameters

      • modeParams: { [key: string]: string }

      Returns DomQuery

    • attr accessor, usage myQuery.attr("class").value = "bla" or let value myQuery.attr("class").value

      Parameters

      • attr: string

        the attribute to set

      • defaultValue: string

        the default value in case nothing is presented (defaults to null)

      Returns ElementAttribute

    • core byId method

      Parameters

      • id: string

        the id to search for

      • OptionalincludeRoot: boolean

        also match the root element?

      Returns DomQuery

    • same as byId just for the tag name

      Parameters

      • tagName: string
      • OptionalincludeRoot: boolean

      Returns DomQuery

    • remove all affected nodes from this query object from the dom tree

      Returns void

    • detaches a set of nodes from their parent elements in a browser independent manner

      Returns DomQuery

      DomQuery of nodes with the detached dom nodes

    • dispatch event on all children just a delegated dispatchEvent from the standard dom working on all queried elements in the monad level

      Parameters

      • evt: Event

        the event to be dispatched

      Returns DomQuery

    • iterate over each element and perform something on the element (Dom element is passed instead of DomQuery)

      Parameters

      • func: (item: Element, cnt?: number) => any

      Returns DomQuery

    • encodes all input elements properly into respective config entries, this can be used for legacy systems, for newer use-cases, use the HTML5 Form class which all newer browsers provide

      Parameters

      • OptionaltoMerge: any

        optional config which can be merged in

      Returns { [key: string]: any }

      a copy pf

    • fires an event

      Parameters

      • eventName: string

      Returns void

    • returns a new dom query containing only the first element max

      Parameters

      • func: (item: DomQuery, cnt?: number) => any

        a an optional callback function to perform an operation on the first element

      Returns DomQuery

    • perform an operation on the first element returns a DomQuery on the first element only

      Parameters

      • func: (item: Element, cnt?: number) => any

      Returns DomQuery

    • returns the nth element as DomQuery from the internal elements note if you try to reach a non-existing element position you will get back an absent entry

      Parameters

      • index: number

        the nth index

      Returns DomQuery

    • returns the nth element as optional of an Element object

      Parameters

      • index: number

        the number from the index

      • defaults: Optional<any>

        the default value if the index is overrun default Optional.absent

      Returns Optional<Element>

    • easy node traversal, you can pass a set of node selectors which are joined as direct children

      Note! The root nodes are not in the getIf, those are always the child nodes

      Parameters

      • ...nodeSelector: string[]

      Returns DomQuery

    • global eval head appendix method no other methods are supported anymore

      Parameters

      • code: string

        the code to be evaluated

      • Optionalnonce: string

        optional nonce key for higher security

      Returns DomQuery

    • Runs an eval and keeps the evaluated code in the head This is a corner condition, where we want to update the head with custom code and leave the code in (instead of deleting ig)

      Parameters

      • code: string

        the code to be evaluated

      • Optionalnonce: string

        optional nonce key for higher security

      Returns DomQuery

    • Checks for an existing class in the class attributes

      Parameters

      • clazz: string

        the class to search for

      Returns boolean

    • innerHtml equivalent to jQueries html as setter the html is set and the DomQuery is given back as getter the html string is returned

      Parameters

      • OptionalnewInnerHTML: string

      Returns DomQuery | Optional<string>

    • should make the code clearer note if you pass a function this refers to the active DomQuery object

      Parameters

      • presentRunnable: (elem?: DomQuery) => void

      Returns DomQuery

    • Parameters

      • OptionaljoinString: string

      Returns string

    • absent no values reached?

      Returns boolean

    • checks whether we have a multipart element in our children

      Returns boolean

    • should make the code clearer note if you pass a function this refers to the active DomQuery object

      Parameters

      • OptionalpresentRunnable: (elem?: DomQuery) => void

      Returns boolean

    • returns true if the elements have the tag tagName as tag embedded ( highest level )

      Parameters

      • tagName: string

      Returns boolean

    • returns a new dom query containing only the first element max

      Parameters

      • func: (item: DomQuery, cnt?: number) => any

        a an optional callback function to perform an operation on the first element

      Returns DomQuery

    • perform an operation on the first element returns a DomQuery on the first element only

      Parameters

      • func: (item: Element, cnt?: number) => any

      Returns DomQuery

    • loads and evaluates a script from a source uri

      Parameters

      • src: string

        the source to be loaded and evaluated

      • delay: number

        in milliseconds execution default (0 == no delay)

      • charSet: string

      Returns void

    • in case the DomQuery is pointing to nothing the else value is taken into consideration als alternative

      Parameters

      • ...elseValue: any

        the else value

      Returns DomQuery

    • the same with lazy evaluation for cases where getting the else value is a heavy operation

      Parameters

      • func: () => any

        the else provider function

      Returns DomQuery

    • outerHTML convenience method browsers only support innerHTML but for instance for your jsf.js we have a full replace pattern which needs outerHTML processing

      Parameters

      • markup: string
      • OptionalrunEmbeddedScripts: boolean
      • OptionalrunEmbeddedCss: boolean

      Returns DomQuery

    • query selector all on the existing dom query object

      Parameters

      • selector: string

        the standard selector

      Returns DomQuery

      a DomQuery with the results

    • closest, walks up the dom tree to fid the closest element to match

      Parameters

      • selector: string

        the standard selector

      Returns DomQuery

      a DomQuery with the results

    • removes an event listener

      Parameters

      • type: string
      • listener: (evt: Event) => void
      • Optionaloptions: boolean | EventListenerOptions

      Returns DomQuery

    • replace convenience function replaces the domquery elements with the elements passed as parameter

      Parameters

      • toReplace: DomQuery

        the replacement elements

      Returns DomQuery

      a reference on the replacement elements

    • Run through the given nodes in the DomQuery execute the inline scripts

      Parameters

      • Optionalsticky: boolean

        if set to true the element must be left in the head after eval default === false

      • OptionalwhiteListed: (val: string) => boolean

      Returns DomQuery

    • style accessor

      Parameters

      • cssProperty: string
      • defaultValue: string

        the default value in case nothing is presented (defaults to null)

      Returns Style

    • fetches the sub-nodes from ... to..

      Parameters

      • from: number
      • Optionalto: number

      Returns DomQuery

    • Parameters

      • OptionaljoinString: string

      Returns string

    • wait until a condition on the dom is reached

      Parameters

      • condition: (element: DomQuery) => boolean
      • options: WAIT_OPTS

      Returns Promise<DomQuery>

      a promise on the affected elements where the condition

      an error in case of a timeout