Liking cljdoc? Tell your friends :D

baredom.components.x-floating-panel.model


arrow-deltacljs

(arrow-delta key-name)

Unit direction map {:dx :dy} for an arrow key, or nil for any other key.

Unit direction map `{:dx :dy}` for an arrow key, or nil for any other key.
sourceraw docstring

attr-closablecljs

source

attr-focus-on-opencljs

source

attr-labelcljs

source

attr-opencljs

source

attr-resizablecljs

source

attr-stepcljs

source

attr-xcljs

source

attr-ycljs

source

clamp-positioncljs

(clamp-position {:keys [x y w handle-h vw vh]})

Constrain a panel top-left so its handle bar stays reachable.

Clamping the whole panel inside the viewport makes a tall panel unusable on a short viewport, so the policy is weaker: at least min-visible pixels of the panel remain on screen horizontally, and the handle bar (height handle-h) remains fully on screen vertically.

All measurements are supplied by the caller — this function never touches the DOM.

Constrain a panel top-left so its handle bar stays reachable.

Clamping the whole panel inside the viewport makes a tall panel unusable on
a short viewport, so the policy is weaker: at least `min-visible` pixels of
the panel remain on screen horizontally, and the handle bar (height
`handle-h`) remains fully on screen vertically.

All measurements are supplied by the caller — this function never touches
the DOM.
sourceraw docstring

default-labelcljs

source

default-stepcljs

source

dismiss-event-detailcljs

(dismiss-event-detail reason)

Build the x-floating-panel-dismiss-request CustomEvent detail.

Build the x-floating-panel-dismiss-request CustomEvent detail.
sourceraw docstring

drag-moved?cljs

(drag-moved? {:keys [start-x start-y] :as drag})

True when the pointer has travelled since the grab.

A press that never moved is a click on the handle, not a drag. Committing it would announce a move that did not happen and would pin an unpositioned panel to viewport coordinates, silently taking it out of the CSS default placement.

True when the pointer has travelled since the grab.

A press that never moved is a click on the handle, not a drag. Committing it
would announce a move that did not happen and would pin an unpositioned panel
to viewport coordinates, silently taking it out of the CSS default placement.
sourceraw docstring

drag-positioncljs

(drag-position {:keys [pointer-x pointer-y offset-x offset-y]})

Panel top-left for a pointer at {:pointer-x :pointer-y}, given the grab offset captured at pointerdown. Returns {:x :y} in viewport coordinates.

Panel top-left for a pointer at `{:pointer-x :pointer-y}`, given the grab
offset captured at pointerdown. Returns `{:x :y}` in viewport coordinates.
sourceraw docstring

event-dismiss-requestcljs

source

event-movecljs

source

event-schemacljs

source

event-togglecljs

source

fine-stepcljs

source

method-apicljs

source

min-visiblecljs

source

move-event-detailcljs

(move-event-detail x y source)

Build the x-floating-panel-move CustomEvent detail.

Build the x-floating-panel-move CustomEvent detail.
sourceraw docstring

normalizecljs

(normalize {:keys [open-present? x-raw y-raw closable-present? label-raw
                   focus-on-open-present? step-raw header-slotted?]})

Normalise raw attribute inputs into a stable view-model map.

resizable is deliberately absent: no effect reads it, so carrying it here would only add a field to compare on every attribute change.

Input keys: :open-present? boolean :x-raw string | nil :y-raw string | nil :closable-present? boolean :label-raw string | nil :focus-on-open-present? boolean :step-raw string | nil :header-slotted? boolean

Output keys: :open? boolean :x number | nil (nil → CSS default placement governs) :y number | nil :closable? boolean :label string :focus-on-open? boolean :step number :header-slotted? boolean

Normalise raw attribute inputs into a stable view-model map.

`resizable` is deliberately absent: no effect reads it, so carrying it here
would only add a field to compare on every attribute change.

Input keys:
  :open-present?          boolean
  :x-raw                  string | nil
  :y-raw                  string | nil
  :closable-present?      boolean
  :label-raw              string | nil
  :focus-on-open-present? boolean
  :step-raw               string | nil
  :header-slotted?        boolean

Output keys:
  :open?           boolean
  :x               number | nil  (nil → CSS default placement governs)
  :y               number | nil
  :closable?       boolean
  :label           string
  :focus-on-open?  boolean
  :step            number
  :header-slotted? boolean
sourceraw docstring

normalize-labelcljs

(normalize-label raw)

Normalize raw label attribute value. Falls back to default-label.

Normalize raw label attribute value. Falls back to default-label.
sourceraw docstring

nudge-positioncljs

(nudge-position {:keys [x y dx dy step]})

Move {:x :y} by one keyboard step in the direction {:dx :dy}.

Move `{:x :y}` by one keyboard `step` in the direction `{:dx :dy}`.
sourceraw docstring

observed-attributescljs

source

parse-coordinatecljs

(parse-coordinate raw)

Parse a raw x / y attribute value into a finite number.

Returns nil for absent, blank, or non-numeric input. Absent and invalid are deliberately the same state: coercing garbage to 0 would teleport the panel to the viewport corner, whereas nil falls through to the CSS default placement and leaves the panel where the author last saw it.

Parse a raw `x` / `y` attribute value into a finite number.

Returns nil for absent, blank, or non-numeric input. Absent and invalid
are deliberately the same state: coercing garbage to 0 would teleport the
panel to the viewport corner, whereas nil falls through to the CSS default
placement and leaves the panel where the author last saw it.
sourceraw docstring

parse-stepcljs

(parse-step raw)

Parse the step attribute into a positive number of pixels. Absent, non-numeric, and non-positive values all fall back to default-step.

Parse the `step` attribute into a positive number of pixels. Absent,
non-numeric, and non-positive values all fall back to default-step.
sourceraw docstring

part-bodycljs

source

part-closecljs

source

part-handlecljs

source

part-panelcljs

source

property-apicljs

source

reason-close-buttoncljs

source

reason-escapecljs

source

source-keyboardcljs

source

source-pointercljs

source

tag-namecljs

source

toggle-event-detailcljs

(toggle-event-detail open)

Build the x-floating-panel-toggle CustomEvent detail.

Build the x-floating-panel-toggle CustomEvent detail.
sourceraw 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