file
little.jsLitComponent
An interface extending LitElement with reactive render() and updated() methods.
Methods:
- render()
- A this-bound Wrapper around LitElement.render() with JS Signal tracking.
- updated (changedProps)
- A this-bound Wrapper around LitElement.updated() with JS Signal tracking.
- request_update()
- A this-bound wrapper around LitElement.requestUpdate().
- weak_this()
- A new WeakRef to this.
- createRenderRoot()
- In addition to calling LitElement.createRenderRoot() this will call adopt_component_styles().
LitComponent class
- class LitComponent
-
…
mkstate
(
str_olist)
- Install reactive Signal.State for all props
Constants
JsExtract
-
API to mark template strings for extraction and fetch extracted assets.
JsExtract.css`body { font-weight:bold; }`
Mark CSS text inside a Javascript file for extration by jsextract.js.node jsextract.js inputfile.js
ExtractJsExtract.css``
strings intoinputfile.jscss
.await JsExtract.fetch_css ('/path/to/inputfile.js');
Use the browserfetch()
API to retrieve the extracted string astext/css
from '/path/to/inputfile.css'.JsExtract.fetch_css (import.meta);
Variant of the above that utilizesimport.meta.url
.JsExtract.css_url (import.meta);
Variant of the above that just provides the stylesheet URL.
Functions
lit_update_all
(
root)
-
Call requestUpdate() on all
LitElement
s css_url
(
base_url)
-
Construct the stylesheet URL from a base URL (enforcing
.css
extension). fetch_css
(
base_url)
-
Fetch (extracted) asset from a base URL (enforcing
.css
extension) as "text/css" adopt_component_styles
(
element)
- Ensure that element has all stylesheets with [data-4litcomponent] applied to it