|
@@ -141,7 +141,8 @@ nothing else. All modules are ES5, dependency-free, guarded IIFEs.
|
|
|
|
|
|
|
|
`stm-*` attribute values are JavaScript expressions evaluated against a scope
|
|
`stm-*` attribute values are JavaScript expressions evaluated against a scope
|
|
|
built from state: `{ typeName: public }` for every held slot type, plus loop
|
|
built from state: `{ typeName: public }` for every held slot type, plus loop
|
|
|
-variables and `stm-local-*` locals in nested scopes. `statum.read('counter')`
|
|
|
|
|
|
|
+variables (statum-binding.js: `stm-local-*` locals; loop variables from the
|
|
|
|
|
+walk) in nested scopes. `statum.read('counter')`
|
|
|
is the programmatic equivalent. Expression compilation is cached. An
|
|
is the programmatic equivalent. Expression compilation is cached. An
|
|
|
expression evaluating to `undefined` means "not resolved yet" and LEAVES THE
|
|
expression evaluating to `undefined` means "not resolved yet" and LEAVES THE
|
|
|
ELEMENT UNTOUCHED (the server-rendered original DOM is preserved — this is
|
|
ELEMENT UNTOUCHED (the server-rendered original DOM is preserved — this is
|
|
@@ -243,14 +244,10 @@ Walk bindings:
|
|
|
expression over the item, usually a field) REUSE DOM nodes for unchanged
|
|
expression over the item, usually a field) REUSE DOM nodes for unchanged
|
|
|
keys, preserving focus/selection/input state; unkeyed loops rebuild
|
|
keys, preserving focus/selection/input state; unkeyed loops rebuild
|
|
|
wholesale. `data-stm-active="1"` + `hidden` mark an active holder.
|
|
wholesale. `data-stm-active="1"` + `hidden` mark an active holder.
|
|
|
-- **`stm-local-{name}="expr"`**: local variable (statum-binding.js). The
|
|
|
|
|
- expression is evaluated LAZILY (at most once per render pass, only when
|
|
|
|
|
- read) against the parent scope; the variable is visible to this element
|
|
|
|
|
- and its descendants (a child scope) and shadows slot types/outer
|
|
|
|
|
- variables. Multiple locals per element; same-element locals cannot
|
|
|
|
|
- reference each other. The legacy `stm-def-{name}-as` spelling is an exact
|
|
|
|
|
- obsolescent alias (one console.warn per element); mkpstm emits the modern
|
|
|
|
|
- form for `pstm-input` fragment parameters.
|
|
|
|
|
|
|
+- **`stm-local-{name}="expr"`** and the other variable bindings
|
|
|
|
|
+ (`stm-global-*`, `stm-declare-*`, `-from-*` forms) belong to the BINDING
|
|
|
|
|
+ module — see its section; they are listed here only because they extend
|
|
|
|
|
+ the scope the walk builds.
|
|
|
- **`stm-text`** / **`stm-html`**: set text content / inner HTML from an
|
|
- **`stm-text`** / **`stm-html`**: set text content / inner HTML from an
|
|
|
expression. `undefined` leaves content untouched; otherwise stringified
|
|
expression. `undefined` leaves content untouched; otherwise stringified
|
|
|
(`null` → `''`). Note (known issue C1): on editable controls `stm-text`
|
|
(`null` → `''`). Note (known issue C1): on editable controls `stm-text`
|