std.dom.find

dom-find

added in 3.0

(dom-find dom key match)

find dom element

(-> (dom/dom-compile [:mock/pane {:children [:mock/pane {:tag “A”} :mock/pane {:tag “B”}]}]) (dom-find :tag identity) str read-string) => :- :mock/pane {:tag “A”}

dom-find-all

added in 3.0

(dom-find-all dom key match)(dom-find-all dom key match state)

finds all matching dom elements

(-> (dom/dom-compile [:mock/pane {:children [:mock/pane {:tag “A”} :mock/pane {:tag “B”}]}]) (dom-find-all :tag string?) str read-string) => [:- :mock/pane {:tag “A”} :- :mock/pane {:tag “B”}]

dom-find-all-props

added in 3.0

(dom-find-all-props props key match state)

finds all dom elements within props

(-> (dom/dom-compile [:mock/pane {:children [:mock/pane {:tag “A”} :mock/pane {:tag “B”}]}]) :props (dom-find-all-props :tag string? (atom [])) str read-string) => [:- :mock/pane {:tag “A”} :- :mock/pane {:tag “B”}]

dom-find-props

added in 3.0

(dom-find-props props key match)

find dom element within props

(-> (dom/dom-compile [:mock/pane {:child :mock/pane {:tag “A”}}]) :props (dom-find-props :tag “A”) str read-string) => :- :mock/pane {:tag “A”}

dom-match?

added in 3.0

(dom-match? dom key match)

tests dom to match on either function or value

(dom-match? (dom/dom-compile :mock/pane {:hello “world”}) :hello string?) => true