UNPKG

siesta-lite

Version:

Stress-free JavaScript unit testing and functional testing tool, works in NodeJS and browsers

141 lines (105 loc) 4.41 kB
<!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>The source code</title> <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" /> <script type="text/javascript" src="../resources/prettify/prettify.js"></script> <style type="text/css"> .highlight { display: block; background-color: #ddd; } </style> <script type="text/javascript"> function highlight() { document.getElementById(location.hash.replace(/#/, "")).className = "highlight"; } </script> </head> <body onload="prettyPrint(); highlight();"> <pre class="prettyprint lang-js">/* Siesta 5.6.1 Copyright(c) 2009-2022 Bryntum AB https://bryntum.com/contact https://bryntum.com/products/siesta/license */ <span id='global-property-'>/** </span> */ Class(&#39;Ariadne.ExtJSComponentQueryFinder&#39;, { isa : Ariadne.QueryFinder, does : [ Siesta.Util.Role.CanInstallCQRootPseudo, Ariadne.ExtJSComponentQueryFinder.TreeWalker, Ariadne.ExtJSDomQueryFinder.Role.ExtJSHelper ], has : { Ext : null, uniqueComponentProperty : null }, methods : { setExtByDomElement : function (dom) { this.Ext = this.getExtByDomElement(dom) }, setExt : function (Ext) { this.Ext = Ext }, initRecognizers : function () { }, initIdentifiers : function () { this.addIdentifier(new Ariadne.ExtJSComponentQueryFinder.Identifier.Id({ finder : this, priority : 10000 })) this.addIdentifier(new Ariadne.ExtJSComponentQueryFinder.Identifier.ItemId({ finder : this, priority : 10000 })) this.addIdentifier(new Ariadne.ExtJSComponentQueryFinder.Identifier.PropertyValue({ properties : this.uniqueComponentProperty, finder : this, priority : 1000 })) this.addIdentifier(new Ariadne.ExtJSComponentQueryFinder.Identifier.XType({ finder : this, priority : 100 })) this.addIdentifier(new Ariadne.ExtJSComponentQueryFinder.Identifier.NthChild({ finder : this, priority : 10 })) this.directChildIdentifier = new Ariadne.ExtJSComponentQueryFinder.Identifier.DirectChild({ finder : this }) }, doQuery : function (query, root) { var CQ = this.Ext.ComponentQuery if (root == CQ) root = null return CQ.query(query, root) }, findQueries : function (target, root, options) { if (!target) throw new Error(&quot;No target&quot;) var Ext = this.Ext if (!Ext || !Ext.ComponentQuery) return [] var CQ = Ext.ComponentQuery this.installRootPseudoCQ(Ext) if (!root) root = CQ var parent = this.getParent(target) // special case, for boundlists within comboboxes - we want to identify // combobox first, and then - boundlist within it if (parent != root &amp;&amp; !parent.items) { var parentQueries = this.SUPER(parent, root, options) var childQueries = this.SUPER(target, parent, options) if (parentQueries.length &amp;&amp; childQueries.length) { var result = [] parentQueries.forEach(function (parentQuery) { childQueries.forEach(function (childQuery) { result.push(parentQuery + &#39; &#39; + childQuery) }) }) return result } } return this.SUPER(target, root, options) } } }); </pre> </body> </html>