@tempots/dom
Tempo DOM is a lightweight UI Framework for building web applications. It has no dependencies and it is built with TypeScript.
To install use:
# npm
npm install @tempots/dom
# yarn
yarn add @tempots/dom
For more information, see the Tempo documentation.
dom package
Classes
Class |
Description |
---|---|
Represents a computed signal that derives its value from a function. It extends the | |
A reference in a DOMContext is to mark a position within a set of sibblings. It is used to insert new elements before the reference. | |
Represents the position of an element in a collection. | |
Represents a memory store that stores key-value pairs. | |
Represents a property signal that holds a value of type T. It extends the | |
Error thrown when a provider is not found. | |
Represents an error that occurs during rendering. | |
Represents a signal that holds a value and notifies its listeners when the value changes. |
Functions
Function |
Description |
---|---|
Animates a signal by creating a new signal that transitions from an initial value to the current value of the input signal. | |
Animates signals based on the provided options. | |
Creates a renderable asynchronous task that wraps a promise. | |
Binds a | |
Binds a | |
Binds a | |
Binds a | |
Binds a | |
Creates a Renderable that returns the appropriate separator based on the element position. | |
Creates a renderable DOM node. | |
Creates a Renderable that represents an HTML element. | |
Creates a renderable function that represents an element in the DOM with a specified namespace. | |
Calls the provided function with the checked value of the event target. | |
Wraps a function to prevent the default behavior of an event before invoking it. | |
Creates an event handler that stops immediate propagation of the event and invokes the provided function. | |
Creates a new event handler that stops event propagation and invokes the provided function. | |
Creates an event handler that emits the value of an HTMLInputElement. | |
Converts the value of an HTML input element to a Date object and emits it using the provided callback function. | |
Emits the value of an HTMLInputElement as a Date object. | |
Calls the provided function with the value of an HTMLInputElement as a number. | |
A fake interpolate function that always returns the end value. | |
Represents a function that ensures a signal has a value before rendering a TNode. | |
Renders a list of items based on a signal of arrays. | |
Creates a fragment renderable that represents a collection of child renderables. The Fragment itself does not render any DOM elements. Instead, it renders the child renderables in the given DOM context. It can be used any time a single Renderable/TNode is expected, but multiple renderables are needed. | |
Returns an interpolation function based on the type of the value. | |
Checks if the code is running on the server-side (SSR - Server-Side Rendering). The flag is set by running the | |
Lazily renders content when a condition is false. | |
Lazily renders content based on a boolean condition. | |
Creates a prop that is backed by the localStorage or a MemoryStore. | |
Creates a computed signal that depends on other signals and updates when any of the dependencies change. | |
Creates a computed signal that depends on other signals or literal values and updates when any of the dependencies change. | |
Computes a value based on a record of signals and literals. | |
Executes the provided function | |
Creates an effect that depends on other signals or literal values and updates when any of the dependencies change. | |
Creates a new Prop object with the specified value and equality function. | |
Creates a unique symbol that can be used as a provider mark for a specific type | |
Creates a signal with the specified initial value and equality function. | |
Maps the values emitted by a signal to a renderable function and returns a new renderable function. While it is tempting to use MapSignal for its simplicity, it is important to remember that the renderable function returned by MapSignal will be re-rendered every time the signal emits a new value. In other contexts link | |
Returns a renderable component that displays the given | |
(ALPHA) Attaches an event handler to the 'click' event that triggers when a checkbox is checked or unchecked. | |
Returns a renderable function that executes the given function with the current DOMContext as argument. | |
Creates a renderable function that renders different components based on the value of a signal. The signal value should be an object with a single key that matches one of the keys in the | |
Creates a renderable that renders different components based on the value of the specified field. | |
Creates a renderable field that matches the value of the It uses the | |
Creates a tuple-based one-of component that matches a signal value with a set of cases. The signal value should be a tuple with the first element being the key to match against. | |
Creates a field that renders one of the provided cases based on the value of the It uses the | |
Creates a renderable value that represents one of the provided cases based on the given match signal. The match signal should emit a value that matches one of the keys in the | |
Executes a callback function when the parent element is mounted in the DOM. | |
Creates a renderable function that will be called when the component is unmounted. | |
Renders the given | |
Prepares for server-side rendering (SSR) by setting a timeout. The returned promise resolves when all the | |
Higher-order function that composes multiple provider functions into a single provider function. | |
Renders a | |
Converts a TNode into a Renderable. | |
Renders the given | |
Creates a renderable function that repeats a given element a specified number of times. | |
Creates a prop that stores its value in the session storage. | |
storedProp({ key, defaultValue, store, serialize, deserialize, equals, onLoad, }) |
Creates a stored property that persists its value in a storage mechanism. |
Represents a renderable task that can be executed asynchronously. | |
Creates a renderable text node. | |
Renders content when a condition is false. | |
Creates a renderable function that consumes data from multiple consumers and renders the result. | |
Creates a renderable function that consumes a provider value and renders a | |
Creates a renderable function that consumes providers and renders a TNode. | |
Provides a way to signal that a renderable has been rendered on the server. Multiple ussSSRDone calls can be made in parallel, and the promise returned by | |
Renders content conditionally based on a boolean value. | |
Creates a renderable with a provider mark and value. The value will be available to any consumers that request the provider mark. | |
Renders the given child with the specified providers. |
Variables
Variable |
Description |
---|---|
An object that provides a convenient way to create mountable attributes for ARIA properties. The type of the value is inferred from the attribute name. | |
The | |
The | |
Represents an empty renderable function. | |
A convenience object to create Renderables for HTML elements. | |
A convenience object to create Renderables for HTMLInput elements. It automatically creates an attribute with the specified type | |
Interpolates between two dates based on a delta value. | |
Interpolates a number between a start and end value based on a delta. | |
Interpolates between two strings based on a delta value. | |
A convenience object to create Renderables for MATH elements. | |
An object that provides attribute functions for MathML tags. | |
Represents a collection of HTML event handlers that can be attached to an element. | |
A collection of functions to create style renderables. | |
A convenience object to create Renderables for SVG elements. | |
An object that provides a convenient way to create mountable attributes for SVG elements. | |
Type Aliases
Type Alias |
Description |
---|---|
Represents the configuration options for animating a signal. | |
Options for animating signals. | |
Represents any type of signal. It can be a Signal, Prop, or Computed. | |
Represents a collection of ARIA attributes and their corresponding types. | |
Options for the | |
Represents a type that maps each property of | |
Represents a function that clears a resource. | |
Options for configuring a conjunction. | |
Represents a consumer function that takes a callback function and returns a renderable object. The callback function takes a value of type T and returns a TNode. | |
Represents a subset of CSS styles. It is a type that excludes certain properties from the | |
Represents a set of properties or values that are excluded from the CSSStyleDeclaration interface. | |
Gets the value type of a given Value type. If the type is a | |
Gets the value types of a given array of Value types. | |
Represents the HTML attributes that can be used in an HTML element. | |
Represents a mapping of HTML event names to their corresponding event types. | |
Represents a mapping of HTML tag names to their corresponding element types. | |
Represents the possible input types for HTML input elements. | |
Represents a function that interpolates between two values. | |
Represents the attributes used in MathML elements. | |
Represents a collection of MathML tags. | |
Represents a nullable value or a signal of a nullable value. | |
Represents the options for a one-of field. | |
The options for a one-of kind field. | |
Represents a set of options for a one-of type. | |
Represents a mapping of keys to functions that accept a value of type | |
Represents a mapping of types to rendering functions. | |
Represents a set of options for a one-of value. | |
Represents a provider function that takes a | |
Represents a provider mark. | |
Represents a collection of providers. The keys of the record are ProviderMark types, and the values are of unknown type. | |
Represents a function that defines a reducer effect. A reducer effect is a function that takes in the previous state, current state, action, and a dispatch function, and performs some side effects based on the state and action. | |
Represents the data passed to a reducer effect. | |
Removes signals from a given object type and returns a new object type with only the non-signal properties. | |
Represents a function that can be rendered in the DOM. | |
Options for rendering. | |
Represents the size of an object with width and height. | |
Represents the properties required for storing and retrieving a value of type | |
Represents the properties required for storing and retrieving a value of type | |
Represents the attributes that can be used in SVG elements. | |
Represents a mapping of SVG tag names to their corresponding SVG element types. | |
Represents the options for a task. | |
Represents a node in the rendering tree. It can be a renderable element, a string value, undefined, null, or an array of renderable elements. | |
Converts a tuple type | |
Represents a type that transforms a tuple of values into an object where each value is associated with a provider mark. | |
Represents a type that extracts the value types from a record of | |
Represents a value that can either be a |