The name of the widget. Should be in kebab-case.
Called for every element matching the widget selector.
OptionalconfigValidator: null | WidgetConfigValidator<Config>A validator object, or a function that returns such an
object, for all options supported by the widget. If
given, then the newWidget function will also be
passed a configuration object constructed from the
element's data attribute.
Optionaloptions: { selector?: string; supportsMultiple?: boolean }Optionalselector?: stringThe selector to match elements for. If not given, then
uses a default value of [data-lisn-<name>], .lisn-<name>
OptionalsupportsMultiple?: booleanIf true, and if configValidator is given, then the
value of the element's widget specific data attribute
will be split on ; and each one parsed individually
as a configuration. Then the newWidget function will
be called once for each configuration.
Enables automatic setting up of a widget from an elements matching the given selector.
If settings.autoWidgets is true, nothing is done. Otherwise, when an element matching the selector is added to the DOM,
newWidgetwill be called and it's expected to setup the widget.IMPORTANT: The widget that is returned by
newWidgetwill be automatically destroyed when the element that created them is removed from the DOM.IMPORTANT: If a widget by that name is already registered, the current call does nothing, even if the remaining arguments differ.