The name of the event.
Unregister an event handler.
The name of the event.
The function that handles the event.
Register an event handler.
The name of the event.
The function to handle the event.
Register an event handler so that it will run only once, and then unregister itself.
The name of the event.
The function to handle the event.
Trigger an event.
The name of the event.
Arguments to pass to event handlers.
An event handler factory that makes it simpler to implement data binding for component event listeners.
The handler created by this factory passes the DOM element's attribute identified by the first argument to the callback (usually a bidirectional Mithril stream: https://mithril.js.org/stream.html#bidirectional-bindings).
Replaces m.withAttr for Mithril 2.0.
The abbreviateNumber
utility converts a number to a shorter localized form.
The anchorScroll
utility saves the scroll position relative to an element,
and then restores it after a callback has been run.
This is useful if a redraw will change the page's content above the viewport. Normally doing this will result in the content in the viewport being pushed down or pulled up. By wrapping the redraw with this utility, the scroll position can be anchor to an element that is in or below the viewport, so the content in the viewport will stay the same.
The element to anchor the scroll position to.
The callback to run that will change page content.
This util exposes clsx
to core and extensions as a re-usable utility.
For full documentation, see clsx
on GitHub.
The computed
utility creates a function that will cache its output until
any of the dependent values are dirty.
The computed
utility creates a function that will cache its output until
any of the dependent values are dirty.
Creates a focus trap for the given element with the given options.
This function applies some default options that are different to the library. Your own options still override these custom defaults:
{
escapeDeactivates: false,
}
Escapes the RegExp
special characters in input
.
The extract
utility deletes a property from an object and returns its
value.
The object that owns the property
The name of the property to extract
The value of the property
Extract the text nodes from a virtual element.
The formatNumber
utility localizes a number into a string with the
appropriate punctuation based on the provided locale otherwise will default to the users locale.
Strip HTML tags and quotes out of the given string, replacing them with meaningful punctuation.
The humanTime
utility converts a date to a localized, human-readable time-
ago string.
Returns if the passed value is an object.
In this context, "object" refers to any non-primitive value, including arrays, function, maps, dates, and more.
The liveHumanTimes
initializer sets up a loop every 1 second to update
timestamps rendered with the humanTime
helper.
The mapRoutes
utility converts a map of named application routes into a
format that can be understood by Mithril, and wraps them in route resolvers
to provide each route with the current route name.
The mixin
utility assigns the properties of a set of 'mixin' objects to
the prototype of a parent object.
The class to extend the new class from.
The objects to mix in.
A new class that extends Parent and contains the mixins.
Mithril 2 does not completely rerender the page if a route change leads to the same route (or the same component handling a different route). This util calls m.route.set, forcing a reonit.
Create a slug out of the given string. Non-alphanumeric characters are converted to hyphens.
NOTE: This method does not use the comparably sophisticated transliteration mechanism that is employed in the backend. Therefore, it should only be used to suggest slugs that can be overridden by the user.
Convert the given string to a unique color.
Check if class A is the same as or a subclass of class B.
Truncate a string to the given length, appending ellipses if necessary.
Make a string's first character uppercase.
Get all of the registered handlers for an event.
The name of the event.
Unregister an event handler.
The name of the event.
The function that handles the event.
Register an event handler.
The name of the event.
The function to handle the event.
Register an event handler so that it will run only once, and then unregister itself.
The name of the event.
The function to handle the event.
Trigger an event.
The name of the event.
Arguments to pass to event handlers.
An event handler factory that makes it simpler to implement data binding for component event listeners.
The handler created by this factory passes the DOM element's attribute identified by the first argument to the callback (usually a bidirectional Mithril stream: https://mithril.js.org/stream.html#bidirectional-bindings).
Replaces m.withAttr for Mithril 2.0.
Generated using TypeDoc version 0.22.10
Get all of the registered handlers for an event.