Interface IDomQuery

Hierarchy

  • IDomQuery

Implemented by

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

inner html property setter and getter which works directly on strings

innerHtml: string

same as innerHTML will be removed once my code is transitioned

Deprecated

do not use anymore, user innerHTML instead

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)
        • (evt: Event): void
        • Parameters

          • evt: Event

          Returns void

    • Optional options: 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;
      }
      • [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

    • Optional includeRoot: boolean

      also match the root element?

    Returns DomQuery

  • same as byId just for the tag name

    Parameters

    • tagName: string
    • Optional includeRoot: 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 of nodes with the detached dom nodes

    Returns DomQuery

  • 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)
        • (item: Element, cnt?: number): any
        • Parameters

          • item: Element
          • Optional cnt: number

          Returns 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

    Returns

    a copy pf

    Parameters

    • toMerge: any

      optional config which can be merged in

    Returns {
        [key: string]: any;
    }

    • [key: string]: any
  • 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

        • (item: DomQuery, cnt?: number): any
        • Parameters

          Returns any

    Returns DomQuery

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

    Parameters

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

          • item: Element
          • Optional cnt: number

          Returns 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

    • Rest ...nodeSelector: string[]

    Returns DomQuery

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

    Parameters

    • code: string

      the code to be evaluated

    • Optional nonce: 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

    • Optional nonce: 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

    • Optional newInnerHTML: string

    Returns DomQuery | Optional<string>

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

    Parameters

    Returns DomQuery

  • Parameters

    • Optional joinString: 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

    • Optional presentRunnable: ((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

        • (item: DomQuery, cnt?: number): any
        • Parameters

          Returns any

    Returns DomQuery

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

    Parameters

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

          • item: Element
          • Optional cnt: number

          Returns 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

    • Rest ...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

        • (): any
        • Returns any

    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
    • Optional runEmbeddedScripts: boolean
    • Optional runEmbeddedCss: boolean

    Returns DomQuery

  • all parents until the selector match stops

    Parameters

    • selector: string

    Returns DomQuery

  • query selector all on the existing dom query object

    Returns

    a DomQuery with the results

    Parameters

    • selector: any

      the standard selector

    Returns DomQuery

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

    Returns

    a DomQuery with the results

    Parameters

    • selector: any

      the standard selector

    Returns DomQuery

  • removes an event listener

    Parameters

    • type: string
    • listener: ((evt: Event) => void)
        • (evt: Event): void
        • Parameters

          • evt: Event

          Returns void

    • Optional options: boolean | EventListenerOptions

    Returns DomQuery

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

    Returns

    a reference on the replacement elements

    Parameters

    • toReplace: DomQuery

      the replacement elements

    Returns DomQuery

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

    Parameters

    • Optional sticky: boolean

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

    • Optional whiteListed: ((val: string) => boolean)
        • (val: string): boolean
        • Parameters

          • val: string

          Returns 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
    • Optional to: number

    Returns DomQuery

  • Parameters

    • Optional joinString: string

    Returns string

  • wait until a condition on the dom is reached

    Returns

    a promise on the affected elements where the condition

    Throws

    an error in case of a timeout

    Parameters

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

    Returns Promise<DomQuery>

Generated using TypeDoc