Liking cljdoc? Tell your friends :D

web.primitives.sdk.values

Read the current state of any primitive by el-id, and scan a whole page into a nested map keyed by el-id segments.

reading-of detects the primitive type from the rendered DOM and returns a reading map: text / number / percent field -> {:type :input :value ".." :label ".."} checkbox -> {:type :checkbox :value true :label ".."} switch -> {:type :switch :value true :label ".."} select -> {:type :select :value "selected label"} radio group -> {:type :radio :value "selected value"} slider -> {:type :slider :value 30.0} autocomplete -> {:type :autocomplete :value ".." or ["chip" ..]} anything else -> {:type :text :text "visible text"}

scan returns the same reading maps as its leaves. The detection and nesting logic lives in web.primitives.testing.scan, shared with the gallery's in-browser snapshot button.

Read the current state of any primitive by el-id, and scan a whole page
into a nested map keyed by el-id segments.

`reading-of` detects the primitive type from the rendered DOM and returns a
reading map:
  text / number / percent field -> {:type :input        :value ".." :label ".."}
  checkbox                       -> {:type :checkbox     :value true  :label ".."}
  switch                         -> {:type :switch       :value true  :label ".."}
  select                         -> {:type :select       :value "selected label"}
  radio group                    -> {:type :radio        :value "selected value"}
  slider                         -> {:type :slider       :value 30.0}
  autocomplete                   -> {:type :autocomplete :value ".." or ["chip" ..]}
  anything else                  -> {:type :text         :text "visible text"}

`scan` returns the same reading maps as its leaves. The detection and
nesting logic lives in web.primitives.testing.scan, shared with the
gallery's in-browser snapshot button.
raw docstring

->pathclj


reading-ofclj

(reading-of el-id)

Reading map for the element carrying el-id, or nil when it is not present.

Reading map for the element carrying `el-id`, or nil when it is not present.
raw docstring

scanclj

(scan)
(scan {:keys [scope ignore] :or {ignore scan/default-ignore?}})

Read every el-id under :scope (CSS, default whole page) and build a nested map keyed by the el-id path (split on "--"), with reading maps as leaves.

Options: :scope CSS to scope the scan (default: whole page) :ignore predicate on the raw id string; default skips gallery chrome, MUI-generated ids and icon ids

Read every el-id under `:scope` (CSS, default whole page) and build a
nested map keyed by the el-id path (split on "--"), with reading maps as
leaves.

Options:
  :scope    CSS to scope the scan (default: whole page)
  :ignore   predicate on the raw id string; default skips gallery chrome,
            MUI-generated ids and icon ids
raw docstring

typed-value-ofclj

(typed-value-of el-id)

{:type <detected-type> :value <value>} for the element carrying el-id. For non-controls :value is the visible text. Nil when not present.

{:type <detected-type> :value <value>} for the element carrying `el-id`.
For non-controls :value is the visible text. Nil when not present.
raw docstring

value-ofclj

(value-of el-id)

Current value of a control, or visible text of anything else, for the element carrying el-id. Nil when not present.

Current value of a control, or visible text of anything else, for the
element carrying `el-id`. Nil when not present.
raw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
←Move to previous article
→Move to next article
Ctrl+/Jump to the search field
× close