StaticabsentStaticglobalreference to the environmental global object
various environments handle the global variable different we have to deal with this.
transform this node collection to an array
The child nodes of this node collection as readonly attribute
disabled flag
settable flag for disabled
the underlying form elements as DomQuery object
reference to the systems global object (globalThis, window, global, depending on the environment)
returns the id of the first element
same here, getter for allowing innerHtml directly
since the dom allows both innerHTML and innerHtml we also have to implement both
see above
getter abbreviation to use innerHTML directly
abbreviation property to use innerHTML directly like on the dom tree
the new inner html which should be attached to "this" domQuery
convenience property for value
returns null in case of no type existing otherwise the value of the first element
lazy stream representation for this DomQuery
length of the entire query set
convenience property for name
returns null in case of no type existing otherwise the name of the first element
convenience for dq.id.value to make the code a little tighter
convenience for dq.id.value to make the code a little tighter
convenience method for nodeName
nonce value if our first root element
accumulated top element offsetHeight
accumulated top element offsetLeft
accumulated top element offsetTop
accumulated top element offsetWidth
returns the embedded shadow elements
an early stream representation for this DomQuery
convenience method for tagName
convenience property for type
returns null in case of no type existing otherwise the type of the first element
abbreviation for inputValue.value to make the code terser
abbreviation for inputValue.value to make the code terser
returns the first element
All elements as array
Implementation of an iterator to allow loops over dom query collections
appends a class string if not already in the element(s)
the style class to append
returns the value array< of all elements
find all parents in the hierarchy for which the selector matches
attach shadow elements 1:1 mapping from attach shadow
attr accessor, usage myQuery.attr("class").value = "bla" or let value myQuery.attr("class").value
the attribute to set
the default value in case nothing is presented (defaults to null)
core byId method
the id to search for
OptionalincludeRoot: booleanalso match the root element?
OptionalincludeRoot: booleansame as byId just for the tag name
the tag-name to search for
OptionalincludeRoot: booleanshall the root element be part of this search
Optionaldeep: booleando we also want to go into shadow dom areas
fires a click event on the underlying dom elements
returns the current element, returns the same element as the previous next call if there is no next before current called then we will call next as initial element
remove all affected nodes from this query object from the dom tree
detaches a set of nodes from their parent elements in a browser independent manner
an array of nodes with the detached dom nodes
iterate over each element and perform something on the element (Dom element is passed instead of 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
optional config which can be merged in
a copy pf
returns the files from a given element
filters the current dom query elements upon a given selector
fires an event
perform an operation on the first element returns a DomQuery on the first element only
finds the first parent in the hierarchy for which the selector matches
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
the nth index
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
global eval head appendix method no other methods are supported anymore
the code to be evaluated
Optionalnonce: stringoptional nonce key for higher security
global eval head appendix method no other methods are supported anymore
the code to be evaluated
Optionalnonce: stringoptional nonce key for higher security
Checks for an existing class in the class attributes
the class to search for
true if additional data is present false if not
absent no values reached?
checks whether we have a multipart element in our children or are one
should make the code clearer note if you pass a function this refers to the active DomQuery object
OptionalpresentRunnable: (elem?: DomQuery) => voidreturns true if the elements have the tag tagName as tag embedded ( highest level )
perform an operation on the first element returns a DomQuery on the first element only
loads and evaluates a script from a source uri
the source to be loaded and evaluated
in milliseconds execution default (0 == no delay)
Optionalnonce: stringoptional nonce value to allow increased security via nonce crypto token
loads and evaluates a script from a source uri
the source to be loaded and evaluated
in milliseconds execution default (0 == no delay)
Optionalnonce: stringoptional nonce parameter for increased security via nonce crypto token
looks ahead cnt without changing the internal data "pointers" of the data source (this is mostly needed by possibly infinite constructs like lazy streams, because they do not know by definition their boundaries)
the elements to look ahead
either the element or ITERATION_STATUS.EO_STRM if we hit the end of the stream before finding the "cnt" element
checks whether any item in this domQuery level matches the selector if there is one element only attached, as root the match is only performed on this element.
returns the next element in the stream
in case the DomQuery is pointing to nothing the else value is taken into consideration als alternative
the else value
the same with lazy evaluation for cases where getting the else value is a heavy operation
the else provider function
outerHTML convenience method browsers only support innerHTML but for instance for your jsf.js we have a full replace pattern which needs outerHTML processing
the markup which should replace the root element
OptionalrunEmbeddedScripts: booleanif true the embedded scripts are executed
OptionalrunEmbeddedCss: booleanif true the embedded css are executed
should this also work for shadow dom (run scripts etc...)
the parent of the elements
fetches all parents as long as the filter criterium matches
query selector all on the existing dom query object
the standard selector
a DomQuery with the results
a deep search which treats the single isolated shadow dom areas separately and runs the query on each shadow dom
resets the position to the beginning
runs the embedded css
Run through the given nodes in the DomQuery execute the inline scripts
if set to true the evaluated elements will stick to the head, default false
style accessor
the default value in case nothing is presented (defaults to null)
helper to fix a common dom problem we have to wait until a certain condition is met, in most of the cases we just want to know whether an element is present in the sub dom-tree before being able to proceed
StaticbyStaticbyStaticfrombuilds the ie nodes properly in a placeholder and bypasses a non script insert bug that way
the markup code to be executed from
StaticgetStaticglobalOptionalnonce: stringStaticglobalOptionalnonce: stringStaticqueryeasy query selector all producer
the selector
a results dom query object
StaticqueryStaticsetsets the caret position
the control to set the caret position to
the position to set
note if the control does not have any selectable and focusable behavior calling this method does nothing (silent fail)
Monadic DomNode representation, ala jquery This is a thin wrapper over querySelectorAll to get slim monadic support to reduce implementation code on the users side. This is vital for frameworks which want to rely on plain dom but still do not want to lose the reduced code footprint of querying dom trees and traversing by using functional patterns.
Also, a few convenience methods are added to reduce the code footprint of standard dom processing operations like eval
in most older systems Note parts of this code still stem from the Dom.js I have written 10 years ago, those parts look a bit ancient and will be replaced over time.