ObjectRule
@thotnr-aws-accl/custom-app-api / Exports / ObjectRule
Class: ObjectRule
Html element which holds rules or metrics
Hierarchy
LitElement↳
ObjectRule
Table of contents
attributes Accessors
updates Accessors
Other Methods
attributes Methods
controllers Methods
lifecycle Methods
properties Methods
rendering Methods
styles Methods
updates Methods
Other Properties
dev-mode Properties
properties Properties
rendering Properties
styles Properties
updates Properties
attributes Accessors
observedAttributes
• Static get observedAttributes(): string[]
Returns a list of attributes corresponding to the registered properties.
Returns
string[]
Nocollapse
Inherited from
LitElement.observedAttributes
updates Accessors
updateComplete
• get updateComplete(): Promise<boolean>
Returns a Promise that resolves when the element has completed updating. The Promise value is a boolean that is true if the element completed the update without triggering another update. The Promise result is false if a property was set inside updated(). If the Promise is rejected, an exception was thrown during the update.
To await additional asynchronous work, override the getUpdateComplete method. For example, it is sometimes useful to await a rendered element before fulfilling this Promise. To do this, first await super.getUpdateComplete(), then any subsequent state.
Returns
Promise<boolean>
A promise of a boolean that resolves to true if the update completed without triggering another update.
Inherited from
LitElement.updateComplete
Other Methods
after
▸ after(...nodes): void
Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes.
Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated.
Parameters
...nodes
(string | Node)[]
Returns
void
Inherited from
LitElement.after
append
▸ append(...nodes): void
Inserts nodes after the last child of node, while replacing strings in nodes with equivalent Text nodes.
Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated.
Parameters
...nodes
(string | Node)[]
Returns
void
Inherited from
LitElement.append
attachShadow
▸ attachShadow(init): ShadowRoot
Creates a shadow root for element and returns it.
Parameters
init
ShadowRootInit
Returns
ShadowRoot
Inherited from
LitElement.attachShadow
before
▸ before(...nodes): void
Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes.
Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated.
Parameters
...nodes
(string | Node)[]
Returns
void
Inherited from
LitElement.before
cloneNode
▸ cloneNode(deep?): Node
Returns a copy of node. If deep is true, the copy also includes the node's descendants.
Parameters
deep?
boolean
Returns
Node
Inherited from
LitElement.cloneNode
closest
▸ closest<K>(selector): HTMLElementTagNameMap[K]
Returns the first (starting at element) inclusive ancestor that matches selectors, and null otherwise.
Type parameters
K
extends keyof HTMLElementTagNameMap
Parameters
selector
K
Returns
HTMLElementTagNameMap[K]
Inherited from
LitElement.closest
compareDocumentPosition
▸ compareDocumentPosition(other): number
Returns a bitmask indicating the position of other relative to node.
Parameters
other
Node
Returns
number
Inherited from
LitElement.compareDocumentPosition
contains
▸ contains(other): boolean
Returns true if other is an inclusive descendant of node, and false otherwise.
Parameters
other
Node
Returns
boolean
Inherited from
LitElement.contains
dispatchEvent
▸ dispatchEvent(event): boolean
Dispatches a synthetic event event to target and returns true if either event's cancelable attribute value is false or its preventDefault() method was not invoked, and false otherwise.
Parameters
event
Event
Returns
boolean
Inherited from
LitElement.dispatchEvent
getAttribute
▸ getAttribute(qualifiedName): string
Returns element's first attribute whose qualified name is qualifiedName, and null if there is no such attribute otherwise.
Parameters
qualifiedName
string
Returns
string
Inherited from
LitElement.getAttribute
getAttributeNS
▸ getAttributeNS(namespace, localName): string
Returns element's attribute whose namespace is namespace and local name is localName, and null if there is no such attribute otherwise.
Parameters
namespace
string
localName
string
Returns
string
Inherited from
LitElement.getAttributeNS
getAttributeNames
▸ getAttributeNames(): string[]
Returns the qualified names of all element's attributes. Can contain duplicates.
Returns
string[]
Inherited from
LitElement.getAttributeNames
getElementsByClassName
▸ getElementsByClassName(classNames): HTMLCollectionOf<Element>
Returns a HTMLCollection of the elements in the object on which the method was invoked (a document or an element) that have all the classes given by classNames. The classNames argument is interpreted as a space-separated list of classes.
Parameters
classNames
string
Returns
HTMLCollectionOf<Element>
Inherited from
LitElement.getElementsByClassName
getRootNode
▸ getRootNode(options?): Node
Returns node's root.
Parameters
options?
GetRootNodeOptions
Returns
Node
Inherited from
LitElement.getRootNode
hasAttribute
▸ hasAttribute(qualifiedName): boolean
Returns true if element has an attribute whose qualified name is qualifiedName, and false otherwise.
Parameters
qualifiedName
string
Returns
boolean
Inherited from
LitElement.hasAttribute
hasAttributeNS
▸ hasAttributeNS(namespace, localName): boolean
Returns true if element has an attribute whose namespace is namespace and local name is localName.
Parameters
namespace
string
localName
string
Returns
boolean
Inherited from
LitElement.hasAttributeNS
hasAttributes
▸ hasAttributes(): boolean
Returns true if element has attributes, and false otherwise.
Returns
boolean
Inherited from
LitElement.hasAttributes
hasChildNodes
▸ hasChildNodes(): boolean
Returns whether node has children.
Returns
boolean
Inherited from
LitElement.hasChildNodes
isEqualNode
▸ isEqualNode(otherNode): boolean
Returns whether node and otherNode have the same properties.
Parameters
otherNode
Node
Returns
boolean
Inherited from
LitElement.isEqualNode
matches
▸ matches(selectors): boolean
Returns true if matching selectors against element's root yields element, and false otherwise.
Parameters
selectors
string
Returns
boolean
Inherited from
LitElement.matches
normalize
▸ normalize(): void
Removes empty exclusive Text nodes and concatenates the data of remaining contiguous exclusive Text nodes into the first of their nodes.
Returns
void
Inherited from
LitElement.normalize
prepend
▸ prepend(...nodes): void
Inserts nodes before the first child of node, while replacing strings in nodes with equivalent Text nodes.
Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated.
Parameters
...nodes
(string | Node)[]
Returns
void
Inherited from
LitElement.prepend
querySelector
▸ querySelector<K>(selectors): HTMLElementTagNameMap[K]
Returns the first element that is a descendant of node that matches selectors.
Type parameters
K
extends keyof HTMLElementTagNameMap
Parameters
selectors
K
Returns
HTMLElementTagNameMap[K]
Inherited from
LitElement.querySelector
querySelectorAll
▸ querySelectorAll<K>(selectors): NodeListOf<HTMLElementTagNameMap[K]>
Returns all element descendants of node that match selectors.
Type parameters
K
extends keyof HTMLElementTagNameMap
Parameters
selectors
K
Returns
NodeListOf<HTMLElementTagNameMap[K]>
Inherited from
LitElement.querySelectorAll
remove
▸ remove(): void
Removes node.
Returns
void
Inherited from
LitElement.remove
removeAttribute
▸ removeAttribute(qualifiedName): void
Removes element's first attribute whose qualified name is qualifiedName.
Parameters
qualifiedName
string
Returns
void
Inherited from
LitElement.removeAttribute
removeAttributeNS
▸ removeAttributeNS(namespace, localName): void
Removes element's attribute whose namespace is namespace and local name is localName.
Parameters
namespace
string
localName
string
Returns
void
Inherited from
LitElement.removeAttributeNS
replaceChildren
▸ replaceChildren(...nodes): void
Replace all children of node with nodes, while replacing strings in nodes with equivalent Text nodes.
Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated.
Parameters
...nodes
(string | Node)[]
Returns
void
Inherited from
LitElement.replaceChildren
replaceWith
▸ replaceWith(...nodes): void
Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes.
Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated.
Parameters
...nodes
(string | Node)[]
Returns
void
Inherited from
LitElement.replaceWith
requestFullscreen
▸ requestFullscreen(options?): Promise<void>
Displays element fullscreen and resolves promise when done.
When supplied, options's navigationUI member indicates whether showing navigation UI while in fullscreen is preferred or not. If set to "show", navigation simplicity is preferred over screen space, and if set to "hide", more screen space is preferred. User agents are always free to honor user preference over the application's. The default value "auto" indicates no application preference.
Parameters
options?
FullscreenOptions
Returns
Promise<void>
Inherited from
LitElement.requestFullscreen
setAttribute
▸ setAttribute(qualifiedName, value): void
Sets the value of element's first attribute whose qualified name is qualifiedName to value.
Parameters
qualifiedName
string
value
string
Returns
void
Inherited from
LitElement.setAttribute
setAttributeNS
▸ setAttributeNS(namespace, qualifiedName, value): void
Sets the value of element's attribute whose namespace is namespace and local name is localName to value.
Parameters
namespace
string
qualifiedName
string
value
string
Returns
void
Inherited from
LitElement.setAttributeNS
toggleAttribute
▸ toggleAttribute(qualifiedName, force?): boolean
If force is not given, "toggles" qualifiedName, removing it if it is present and adding it if it is not present. If force is true, adds qualifiedName. If force is false, removes qualifiedName.
Returns true if qualifiedName is now present, and false otherwise.
Parameters
qualifiedName
string
force?
boolean
Returns
boolean
Inherited from
LitElement.toggleAttribute
webkitMatchesSelector
▸ webkitMatchesSelector(selectors): boolean
Parameters
selectors
string
Returns
boolean
Deprecated
This is a legacy alias of matches.
Inherited from
LitElement.webkitMatchesSelector
addInitializer
▸ Static addInitializer(initializer): void
Adds an initializer function to the class that is called during instance construction.
This is useful for code that runs against a ReactiveElement subclass, such as a decorator, that needs to do work for each instance, such as setting up a ReactiveController.
Decorating a field will then cause each instance to run an initializer that adds a controller:
Initializers are stored per-constructor. Adding an initializer to a subclass does not add it to a superclass. Since initializers are run in constructors, initializers will run in order of the class hierarchy, starting with superclasses and progressing to the instance's class.
Parameters
initializer
Initializer
Returns
void
Nocollapse
Inherited from
LitElement.addInitializer
finalize
▸ Static Protected finalize(): boolean
Creates property accessors for registered properties, sets up element styling, and ensures any superclasses are also finalized. Returns true if the element was finalized.
Returns
boolean
Nocollapse
Inherited from
LitElement.finalize
attributes Methods
attributeChangedCallback
▸ attributeChangedCallback(name, _old, value): void
Synchronizes property values when attributes change.
Specifically, when an attribute is set, the corresponding property is set. You should rarely need to implement this callback. If this method is overridden, super.attributeChangedCallback(name, _old, value) must be called.
See using the lifecycle callbacks on MDN for more information about the attributeChangedCallback.
Parameters
name
string
_old
string
value
string
Returns
void
Inherited from
LitElement.attributeChangedCallback
controllers Methods
addController
▸ addController(controller): void
Registers a ReactiveController to participate in the element's reactive update cycle. The element automatically calls into any registered controllers during its lifecycle callbacks.
If the element is connected when addController() is called, the controller's hostConnected() callback will be immediately called.
Parameters
controller
ReactiveController
Returns
void
Inherited from
LitElement.addController
removeController
▸ removeController(controller): void
Removes a ReactiveController from the element.
Parameters
controller
ReactiveController
Returns
void
Inherited from
LitElement.removeController
lifecycle Methods
connectedCallback
▸ connectedCallback(): void
Invoked when the component is added to the document's DOM.
In connectedCallback() you should setup tasks that should only occur when the element is connected to the document. The most common of these is adding event listeners to nodes external to the element, like a keydown event handler added to the window.
Typically, anything done in connectedCallback() should be undone when the element is disconnected, in disconnectedCallback().
Returns
void
Inherited from
LitElement.connectedCallback
disconnectedCallback
▸ disconnectedCallback(): void
Invoked when the component is removed from the document's DOM.
This callback is the main signal to the element that it may no longer be used. disconnectedCallback() should ensure that nothing is holding a reference to the element (such as event listeners added to nodes external to the element), so that it is free to be garbage collected.
An element may be re-connected after being disconnected.
Returns
void
Inherited from
LitElement.disconnectedCallback
properties Methods
createProperty
▸ Static createProperty(name, options?): void
Creates a property accessor on the element prototype if one does not exist and stores a PropertyDeclaration for the property with the given options. The property setter calls the property's hasChanged property option or uses a strict identity check to determine whether or not to request an update.
This method may be overridden to customize properties; however, when doing so, it's important to call super.createProperty to ensure the property is setup correctly. This method calls getPropertyDescriptor internally to get a descriptor to install. To customize what properties do when they are get or set, override getPropertyDescriptor. To customize the options for a property, implement createProperty like this:
Parameters
name
PropertyKey
options?
PropertyDeclaration<unknown, unknown>
Returns
void
Nocollapse
Inherited from
LitElement.createProperty
getPropertyDescriptor
▸ Static Protected getPropertyDescriptor(name, key, options): PropertyDescriptor
Returns a property descriptor to be defined on the given named property. If no descriptor is returned, the property will not become an accessor. For example,
Parameters
name
PropertyKey
key
string | symbol
options
PropertyDeclaration<unknown, unknown>
Returns
PropertyDescriptor
Nocollapse
Inherited from
LitElement.getPropertyDescriptor
getPropertyOptions
▸ Static getPropertyOptions(name): PropertyDeclaration<unknown, unknown>
Returns the property options associated with the given property. These options are defined with a PropertyDeclaration via the properties object or the @property decorator and are registered in createProperty(...).
Note, this method should be considered "final" and not overridden. To customize the options for a given property, override createProperty.
Parameters
name
PropertyKey
Returns
PropertyDeclaration<unknown, unknown>
Nocollapse
Final
Inherited from
LitElement.getPropertyOptions
rendering Methods
createRenderRoot
▸ Protected createRenderRoot(): Element | ShadowRoot
Returns
Element | ShadowRoot
Inherited from
LitElement.createRenderRoot
styles Methods
finalizeStyles
▸ Static Protected finalizeStyles(styles?): CSSResultOrNative[]
Takes the styles the user supplied via the static styles property and returns the array of styles to apply to the element. Override this method to integrate into a style management system.
Styles are deduplicated preserving the last instance in the list. This is a performance optimization to avoid duplicated styles that can occur especially when composing via subclassing. The last item is kept to try to preserve the cascade order with the assumption that it's most important that last added styles override previous styles.
Parameters
styles?
CSSResultGroup
Returns
CSSResultOrNative[]
Nocollapse
Inherited from
LitElement.finalizeStyles
updates Methods
enableUpdating
▸ Protected enableUpdating(_requestedUpdate): void
Note, this method should be considered final and not overridden. It is overridden on the element instance with a function that triggers the first update.
Parameters
_requestedUpdate
boolean
Returns
void
Inherited from
LitElement.enableUpdating
getUpdateComplete
▸ Protected getUpdateComplete(): Promise<boolean>
Override point for the updateComplete promise.
It is not safe to override the updateComplete getter directly due to a limitation in TypeScript which means it is not possible to call a superclass getter (e.g. super.updateComplete.then(...)) when the target language is ES5 (https://github.com/microsoft/TypeScript/issues/338). This method should be overridden instead. For example:
Returns
Promise<boolean>
A promise of a boolean that resolves to true if the update completed without triggering another update.
Inherited from
LitElement.getUpdateComplete
performUpdate
▸ Protected performUpdate(): void | Promise<unknown>
Performs an element update. Note, if an exception is thrown during the update, firstUpdated and updated will not be called.
Call performUpdate() to immediately process a pending update. This should generally not be needed, but it can be done in rare cases when you need to update synchronously.
Note: To ensure performUpdate() synchronously completes a pending update, it should not be overridden. In LitElement 2.x it was suggested to override performUpdate() to also customizing update scheduling. Instead, you should now override scheduleUpdate(). For backwards compatibility with LitElement 2.x, scheduling updates via performUpdate() continues to work, but will make also calling performUpdate() to synchronously process updates difficult.
Returns
void | Promise<unknown>
Inherited from
LitElement.performUpdate
requestUpdate
▸ requestUpdate(name?, oldValue?, options?): void
Requests an update which is processed asynchronously. This should be called when an element should update based on some state not triggered by setting a reactive property. In this case, pass no arguments. It should also be called when manually implementing a property setter. In this case, pass the property name and oldValue to ensure that any configured property options are honored.
Parameters
name?
PropertyKey
name of requesting property
oldValue?
unknown
old value of requesting property
options?
PropertyDeclaration<unknown, unknown>
property options to use instead of the previously configured options
Returns
void
Inherited from
LitElement.requestUpdate
scheduleUpdate
▸ Protected scheduleUpdate(): void | Promise<unknown>
Schedules an element update. You can override this method to change the timing of updates by returning a Promise. The update will await the returned Promise, and you should resolve the Promise to allow the update to proceed. If this method is overridden, super.scheduleUpdate() must be called.
For instance, to schedule updates to occur just before the next frame:
Returns
void | Promise<unknown>
Inherited from
LitElement.scheduleUpdate
shouldUpdate
▸ Protected shouldUpdate(_changedProperties): boolean
Controls whether or not update() should be called when the element requests an update. By default, this method always returns true, but this can be customized to control when to update.
Parameters
_changedProperties
PropertyValueMap<any> | Map<PropertyKey, unknown>
Map of changed properties with old values
Returns
boolean
Inherited from
LitElement.shouldUpdate
update
▸ Protected update(changedProperties): void
Updates the element. This method reflects property values to attributes and calls render to render DOM via lit-html. Setting properties inside this method will not trigger another update.
Parameters
changedProperties
PropertyValueMap<any> | Map<PropertyKey, unknown>
Map of changed properties with old values
Returns
void
Inherited from
LitElement.update
updated
▸ Protected updated(_changedProperties): void
Invoked whenever the element is updated. Implement to perform post-updating tasks via DOM APIs, for example, focusing an element.
Setting properties inside this method will trigger the element to update again after this update cycle completes.
Parameters
_changedProperties
PropertyValueMap<any> | Map<PropertyKey, unknown>
Map of changed properties with old values
Returns
void
Inherited from
LitElement.updated
willUpdate
▸ Protected willUpdate(_changedProperties): void
Invoked before update() to compute values needed during the update.
Implement willUpdate to compute property values that depend on other properties and are used in the rest of the update process.
Parameters
_changedProperties
PropertyValueMap<any> | Map<PropertyKey, unknown>
Returns
void
Inherited from
LitElement.willUpdate
Other Properties
CDATA_SECTION_NODE
• Readonly CDATA_SECTION_NODE: number
node is a CDATASection node.
Inherited from
LitElement.CDATA_SECTION_NODE
COMMENT_NODE
• Readonly COMMENT_NODE: number
node is a Comment node.
Inherited from
LitElement.COMMENT_NODE
DOCUMENT_FRAGMENT_NODE
• Readonly DOCUMENT_FRAGMENT_NODE: number
node is a DocumentFragment node.
Inherited from
LitElement.DOCUMENT_FRAGMENT_NODE
DOCUMENT_NODE
• Readonly DOCUMENT_NODE: number
node is a document.
Inherited from
LitElement.DOCUMENT_NODE
DOCUMENT_POSITION_CONTAINED_BY
• Readonly DOCUMENT_POSITION_CONTAINED_BY: number
Set when other is a descendant of node.
Inherited from
LitElement.DOCUMENT_POSITION_CONTAINED_BY
DOCUMENT_POSITION_CONTAINS
• Readonly DOCUMENT_POSITION_CONTAINS: number
Set when other is an ancestor of node.
Inherited from
LitElement.DOCUMENT_POSITION_CONTAINS
DOCUMENT_POSITION_DISCONNECTED
• Readonly DOCUMENT_POSITION_DISCONNECTED: number
Set when node and other are not in the same tree.
Inherited from
LitElement.DOCUMENT_POSITION_DISCONNECTED
DOCUMENT_POSITION_FOLLOWING
• Readonly DOCUMENT_POSITION_FOLLOWING: number
Set when other is following node.
Inherited from
LitElement.DOCUMENT_POSITION_FOLLOWING
DOCUMENT_POSITION_PRECEDING
• Readonly DOCUMENT_POSITION_PRECEDING: number
Set when other is preceding node.
Inherited from
LitElement.DOCUMENT_POSITION_PRECEDING
DOCUMENT_TYPE_NODE
• Readonly DOCUMENT_TYPE_NODE: number
node is a doctype.
Inherited from
LitElement.DOCUMENT_TYPE_NODE
ELEMENT_NODE
• Readonly ELEMENT_NODE: number
node is an element.
Inherited from
LitElement.ELEMENT_NODE
PROCESSING_INSTRUCTION_NODE
• Readonly PROCESSING_INSTRUCTION_NODE: number
node is a ProcessingInstruction node.
Inherited from
LitElement.PROCESSING_INSTRUCTION_NODE
TEXT_NODE
• Readonly TEXT_NODE: number
node is a Text node.
Inherited from
LitElement.TEXT_NODE
baseURI
• Readonly baseURI: string
Returns node's node document's document base URL.
Inherited from
LitElement.baseURI
childNodes
• Readonly childNodes: NodeListOf<ChildNode>
Returns the children.
Inherited from
LitElement.childNodes
children
• Readonly children: HTMLCollection
Returns the child elements.
Inherited from
LitElement.children
classList
• Readonly classList: DOMTokenList
Allows for manipulation of element's class content attribute as a set of whitespace-separated tokens through a DOMTokenList object.
Inherited from
LitElement.classList
className
• className: string
Returns the value of element's class content attribute. Can be set to change it.
Inherited from
LitElement.className
firstChild
• Readonly firstChild: ChildNode
Returns the first child.
Inherited from
LitElement.firstChild
firstElementChild
• Readonly firstElementChild: Element
Returns the first child that is an element, and null otherwise.
Inherited from
LitElement.firstElementChild
id
• id: string
Returns the value of element's id content attribute. Can be set to change it.
Inherited from
LitElement.id
isConnected
• Readonly isConnected: boolean
Returns true if node is connected and false otherwise.
Inherited from
LitElement.isConnected
lastChild
• Readonly lastChild: ChildNode
Returns the last child.
Inherited from
LitElement.lastChild
lastElementChild
• Readonly lastElementChild: Element
Returns the last child that is an element, and null otherwise.
Inherited from
LitElement.lastElementChild
localName
• Readonly localName: string
Returns the local name.
Inherited from
LitElement.localName
namespaceURI
• Readonly namespaceURI: string
Returns the namespace.
Inherited from
LitElement.namespaceURI
nextElementSibling
• Readonly nextElementSibling: Element
Returns the first following sibling that is an element, and null otherwise.
Inherited from
LitElement.nextElementSibling
nextSibling
• Readonly nextSibling: ChildNode
Returns the next sibling.
Inherited from
LitElement.nextSibling
nodeName
• Readonly nodeName: string
Returns a string appropriate for the type of node.
Inherited from
LitElement.nodeName
nodeType
• Readonly nodeType: number
Returns the type of node.
Inherited from
LitElement.nodeType
onabort
• onabort: (this: GlobalEventHandlers, ev: UIEvent) => any
Type declaration
▸ (this, ev): any
Fires when the user aborts the download.
Parameters
this
GlobalEventHandlers
-
ev
UIEvent
The event.
Returns
any
Inherited from
LitElement.onabort
onblur
• onblur: (this: GlobalEventHandlers, ev: FocusEvent) => any
Type declaration
▸ (this, ev): any
Fires when the object loses the input focus.
Parameters
this
GlobalEventHandlers
-
ev
FocusEvent
The focus event.
Returns
any
Inherited from
LitElement.onblur
oncanplay
• oncanplay: (this: GlobalEventHandlers, ev: Event) => any
Type declaration
▸ (this, ev): any
Occurs when playback is possible, but would require further buffering.
Parameters
this
GlobalEventHandlers
-
ev
Event
The event.
Returns
any
Inherited from
LitElement.oncanplay
onchange
• onchange: (this: GlobalEventHandlers, ev: Event) => any
Type declaration
▸ (this, ev): any
Fires when the contents of the object or selection have changed.
Parameters
this
GlobalEventHandlers
-
ev
Event
The event.
Returns
any
Inherited from
LitElement.onchange
onclick
• onclick: (this: GlobalEventHandlers, ev: MouseEvent) => any
Type declaration
▸ (this, ev): any
Fires when the user clicks the left mouse button on the object
Parameters
this
GlobalEventHandlers
-
ev
MouseEvent
The mouse event.
Returns
any
Inherited from
LitElement.onclick
oncontextmenu
• oncontextmenu: (this: GlobalEventHandlers, ev: MouseEvent) => any
Type declaration
▸ (this, ev): any
Fires when the user clicks the right mouse button in the client area, opening the context menu.
Parameters
this
GlobalEventHandlers
-
ev
MouseEvent
The mouse event.
Returns
any
Inherited from
LitElement.oncontextmenu
ondblclick
• ondblclick: (this: GlobalEventHandlers, ev: MouseEvent) => any
Type declaration
▸ (this, ev): any
Fires when the user double-clicks the object.
Parameters
this
GlobalEventHandlers
-
ev
MouseEvent
The mouse event.
Returns
any
Inherited from
LitElement.ondblclick
ondrag
• ondrag: (this: GlobalEventHandlers, ev: DragEvent) => any
Type declaration
▸ (this, ev): any
Fires on the source object continuously during a drag operation.
Parameters
this
GlobalEventHandlers
-
ev
DragEvent
The event.
Returns
any
Inherited from
LitElement.ondrag
ondragend
• ondragend: (this: GlobalEventHandlers, ev: DragEvent) => any
Type declaration
▸ (this, ev): any
Fires on the source object when the user releases the mouse at the close of a drag operation.
Parameters
this
GlobalEventHandlers
-
ev
DragEvent
The event.
Returns
any
Inherited from
LitElement.ondragend
ondragenter
• ondragenter: (this: GlobalEventHandlers, ev: DragEvent) => any
Type declaration
▸ (this, ev): any
Fires on the target element when the user drags the object to a valid drop target.
Parameters
this
GlobalEventHandlers
-
ev
DragEvent
The drag event.
Returns
any
Inherited from
LitElement.ondragenter
ondragleave
• ondragleave: (this: GlobalEventHandlers, ev: DragEvent) => any
Type declaration
▸ (this, ev): any
Fires on the target object when the user moves the mouse out of a valid drop target during a drag operation.
Parameters
this
GlobalEventHandlers
-
ev
DragEvent
The drag event.
Returns
any
Inherited from
LitElement.ondragleave
ondragover
• ondragover: (this: GlobalEventHandlers, ev: DragEvent) => any
Type declaration
▸ (this, ev): any
Fires on the target element continuously while the user drags the object over a valid drop target.
Parameters
this
GlobalEventHandlers
-
ev
DragEvent
The event.
Returns
any
Inherited from
LitElement.ondragover
ondragstart
• ondragstart: (this: GlobalEventHandlers, ev: DragEvent) => any
Type declaration
▸ (this, ev): any
Fires on the source object when the user starts to drag a text selection or selected object.
Parameters
this
GlobalEventHandlers
-
ev
DragEvent
The event.
Returns
any
Inherited from
LitElement.ondragstart
ondurationchange
• ondurationchange: (this: GlobalEventHandlers, ev: Event) => any
Type declaration
▸ (this, ev): any
Occurs when the duration attribute is updated.
Parameters
this
GlobalEventHandlers
-
ev
Event
The event.
Returns
any
Inherited from
LitElement.ondurationchange
onemptied
• onemptied: (this: GlobalEventHandlers, ev: Event) => any
Type declaration
▸ (this, ev): any
Occurs when the media element is reset to its initial state.
Parameters
this
GlobalEventHandlers
-
ev
Event
The event.
Returns
any
Inherited from
LitElement.onemptied
onended
• onended: (this: GlobalEventHandlers, ev: Event) => any
Type declaration
▸ (this, ev): any
Occurs when the end of playback is reached.
Parameters
this
GlobalEventHandlers
-
ev
Event
The event
Returns
any
Inherited from
LitElement.onended
onerror
• onerror: OnErrorEventHandlerNonNull
Fires when an error occurs during object loading.
Param
The event.
Inherited from
LitElement.onerror
onfocus
• onfocus: (this: GlobalEventHandlers, ev: FocusEvent) => any
Type declaration
▸ (this, ev): any
Fires when the object receives focus.
Parameters
this
GlobalEventHandlers
-
ev
FocusEvent
The event.
Returns
any
Inherited from
LitElement.onfocus
onkeydown
• onkeydown: (this: GlobalEventHandlers, ev: KeyboardEvent) => any
Type declaration
▸ (this, ev): any
Fires when the user presses a key.
Parameters
this
GlobalEventHandlers
-
ev
KeyboardEvent
The keyboard event
Returns
any
Inherited from
LitElement.onkeydown
onkeypress
• onkeypress: (this: GlobalEventHandlers, ev: KeyboardEvent) => any
Type declaration
▸ (this, ev): any
Fires when the user presses an alphanumeric key.
Parameters
this
GlobalEventHandlers
-
ev
KeyboardEvent
The event.
Returns
any
Deprecated
Inherited from
LitElement.onkeypress
onkeyup
• onkeyup: (this: GlobalEventHandlers, ev: KeyboardEvent) => any
Type declaration
▸ (this, ev): any
Fires when the user releases a key.
Parameters
this
GlobalEventHandlers
-
ev
KeyboardEvent
The keyboard event
Returns
any
Inherited from
LitElement.onkeyup
onload
• onload: (this: GlobalEventHandlers, ev: Event) => any
Type declaration
▸ (this, ev): any
Fires immediately after the browser loads the object.
Parameters
this
GlobalEventHandlers
-
ev
Event
The event.
Returns
any
Inherited from
LitElement.onload
onloadeddata
• onloadeddata: (this: GlobalEventHandlers, ev: Event) => any
Type declaration
▸ (this, ev): any
Occurs when media data is loaded at the current playback position.
Parameters
this
GlobalEventHandlers
-
ev
Event
The event.
Returns
any
Inherited from
LitElement.onloadeddata
onloadedmetadata
• onloadedmetadata: (this: GlobalEventHandlers, ev: Event) => any
Type declaration
▸ (this, ev): any
Occurs when the duration and dimensions of the media have been determined.
Parameters
this
GlobalEventHandlers
-
ev
Event
The event.
Returns
any
Inherited from
LitElement.onloadedmetadata
onloadstart
• onloadstart: (this: GlobalEventHandlers, ev: Event) => any
Type declaration
▸ (this, ev): any
Occurs when Internet Explorer begins looking for media data.
Parameters
this
GlobalEventHandlers
-
ev
Event
The event.
Returns
any
Inherited from
LitElement.onloadstart
onmousedown
• onmousedown: (this: GlobalEventHandlers, ev: MouseEvent) => any
Type declaration
▸ (this, ev): any
Fires when the user clicks the object with either mouse button.
Parameters
this
GlobalEventHandlers
-
ev
MouseEvent
The mouse event.
Returns
any
Inherited from
LitElement.onmousedown
onmousemove
• onmousemove: (this: GlobalEventHandlers, ev: MouseEvent) => any
Type declaration
▸ (this, ev): any
Fires when the user moves the mouse over the object.
Parameters
this
GlobalEventHandlers
-
ev
MouseEvent
The mouse event.
Returns
any
Inherited from
LitElement.onmousemove
onmouseout
• onmouseout: (this: GlobalEventHandlers, ev: MouseEvent) => any
Type declaration
▸ (this, ev): any
Fires when the user moves the mouse pointer outside the boundaries of the object.
Parameters
this
GlobalEventHandlers
-
ev
MouseEvent
The mouse event.
Returns
any
Inherited from
LitElement.onmouseout
onmouseover
• onmouseover: (this: GlobalEventHandlers, ev: MouseEvent) => any
Type declaration
▸ (this, ev): any
Fires when the user moves the mouse pointer into the object.
Parameters
this
GlobalEventHandlers
-
ev
MouseEvent
The mouse event.
Returns
any
Inherited from
LitElement.onmouseover
onmouseup
• onmouseup: (this: GlobalEventHandlers, ev: MouseEvent) => any
Type declaration
▸ (this, ev): any
Fires when the user releases a mouse button while the mouse is over the object.
Parameters
this
GlobalEventHandlers
-
ev
MouseEvent
The mouse event.
Returns
any
Inherited from
LitElement.onmouseup
onpause
• onpause: (this: GlobalEventHandlers, ev: Event) => any
Type declaration
▸ (this, ev): any
Occurs when playback is paused.
Parameters
this
GlobalEventHandlers
-
ev
Event
The event.
Returns
any
Inherited from
LitElement.onpause
onplay
• onplay: (this: GlobalEventHandlers, ev: Event) => any
Type declaration
▸ (this, ev): any
Occurs when the play method is requested.
Parameters
this
GlobalEventHandlers
-
ev
Event
The event.
Returns
any
Inherited from
LitElement.onplay
onplaying
• onplaying: (this: GlobalEventHandlers, ev: Event) => any
Type declaration
▸ (this, ev): any
Occurs when the audio or video has started playing.
Parameters
this
GlobalEventHandlers
-
ev
Event
The event.
Returns
any
Inherited from
LitElement.onplaying
onprogress
• onprogress: (this: GlobalEventHandlers, ev: ProgressEvent<EventTarget>) => any
Type declaration
▸ (this, ev): any
Occurs to indicate progress while downloading media data.
Parameters
this
GlobalEventHandlers
-
ev
ProgressEvent<EventTarget>
The event.
Returns
any
Inherited from
LitElement.onprogress
onratechange
• onratechange: (this: GlobalEventHandlers, ev: Event) => any
Type declaration
▸ (this, ev): any
Occurs when the playback rate is increased or decreased.
Parameters
this
GlobalEventHandlers
-
ev
Event
The event.
Returns
any
Inherited from
LitElement.onratechange
onreset
• onreset: (this: GlobalEventHandlers, ev: Event) => any
Type declaration
▸ (this, ev): any
Fires when the user resets a form.
Parameters
this
GlobalEventHandlers
-
ev
Event
The event.
Returns
any
Inherited from
LitElement.onreset
onscroll
• onscroll: (this: GlobalEventHandlers, ev: Event) => any
Type declaration
▸ (this, ev): any
Fires when the user repositions the scroll box in the scroll bar on the object.
Parameters
this
GlobalEventHandlers
-
ev
Event
The event.
Returns
any
Inherited from
LitElement.onscroll
onseeked
• onseeked: (this: GlobalEventHandlers, ev: Event) => any
Type declaration
▸ (this, ev): any
Occurs when the seek operation ends.
Parameters
this
GlobalEventHandlers
-
ev
Event
The event.
Returns
any
Inherited from
LitElement.onseeked
onseeking
• onseeking: (this: GlobalEventHandlers, ev: Event) => any
Type declaration
▸ (this, ev): any
Occurs when the current playback position is moved.
Parameters
this
GlobalEventHandlers
-
ev
Event
The event.
Returns
any
Inherited from
LitElement.onseeking
onselect
• onselect: (this: GlobalEventHandlers, ev: Event) => any
Type declaration
▸ (this, ev): any
Fires when the current selection changes.
Parameters
this
GlobalEventHandlers
-
ev
Event
The event.
Returns
any
Inherited from
LitElement.onselect
onstalled
• onstalled: (this: GlobalEventHandlers, ev: Event) => any
Type declaration
▸ (this, ev): any
Occurs when the download has stopped.
Parameters
this
GlobalEventHandlers
-
ev
Event
The event.
Returns
any
Inherited from
LitElement.onstalled
onsuspend
• onsuspend: (this: GlobalEventHandlers, ev: Event) => any
Type declaration
▸ (this, ev): any
Occurs if the load operation has been intentionally halted.
Parameters
this
GlobalEventHandlers
-
ev
Event
The event.
Returns
any
Inherited from
LitElement.onsuspend
ontimeupdate
• ontimeupdate: (this: GlobalEventHandlers, ev: Event) => any
Type declaration
▸ (this, ev): any
Occurs to indicate the current playback position.
Parameters
this
GlobalEventHandlers
-
ev
Event
The event.
Returns
any
Inherited from
LitElement.ontimeupdate
onvolumechange
• onvolumechange: (this: GlobalEventHandlers, ev: Event) => any
Type declaration
▸ (this, ev): any
Occurs when the volume is changed, or playback is muted or unmuted.
Parameters
this
GlobalEventHandlers
-
ev
Event
The event.
Returns
any
Inherited from
LitElement.onvolumechange
onwaiting
• onwaiting: (this: GlobalEventHandlers, ev: Event) => any
Type declaration
▸ (this, ev): any
Occurs when playback stops because the next frame of a video resource is not available.
Parameters
this
GlobalEventHandlers
-
ev
Event
The event.
Returns
any
Inherited from
LitElement.onwaiting
onwebkitanimationend
• onwebkitanimationend: (this: GlobalEventHandlers, ev: Event) => any
Type declaration
▸ (this, ev): any
Parameters
this
GlobalEventHandlers
ev
Event
Returns
any
Deprecated
This is a legacy alias of onanimationend.
Inherited from
LitElement.onwebkitanimationend
onwebkitanimationiteration
• onwebkitanimationiteration: (this: GlobalEventHandlers, ev: Event) => any
Type declaration
▸ (this, ev): any
Parameters
this
GlobalEventHandlers
ev
Event
Returns
any
Deprecated
This is a legacy alias of onanimationiteration.
Inherited from
LitElement.onwebkitanimationiteration
onwebkitanimationstart
• onwebkitanimationstart: (this: GlobalEventHandlers, ev: Event) => any
Type declaration
▸ (this, ev): any
Parameters
this
GlobalEventHandlers
ev
Event
Returns
any
Deprecated
This is a legacy alias of onanimationstart.
Inherited from
LitElement.onwebkitanimationstart
onwebkittransitionend
• onwebkittransitionend: (this: GlobalEventHandlers, ev: Event) => any
Type declaration
▸ (this, ev): any
Parameters
this
GlobalEventHandlers
ev
Event
Returns
any
Deprecated
This is a legacy alias of ontransitionend.
Inherited from
LitElement.onwebkittransitionend
parentElement
• Readonly parentElement: HTMLElement
Returns the parent element.
Inherited from
LitElement.parentElement
parentNode
• Readonly parentNode: ParentNode
Returns the parent.
Inherited from
LitElement.parentNode
prefix
• Readonly prefix: string
Returns the namespace prefix.
Inherited from
LitElement.prefix
previousElementSibling
• Readonly previousElementSibling: Element
Returns the first preceding sibling that is an element, and null otherwise.
Inherited from
LitElement.previousElementSibling
previousSibling
• Readonly previousSibling: ChildNode
Returns the previous sibling.
Inherited from
LitElement.previousSibling
shadowRoot
• Readonly shadowRoot: ShadowRoot
Returns element's shadow root, if any, and if shadow root's mode is "open", and null otherwise.
Inherited from
LitElement.shadowRoot
slot
• slot: string
Returns the value of element's slot content attribute. Can be set to change it.
Inherited from
LitElement.slot
tagName
• Readonly tagName: string
Returns the HTML-uppercased qualified name.
Inherited from
LitElement.tagName
finalized
▪ Static Protected finalized: boolean
Ensure this class is marked as finalized as an optimization ensuring it will not needlessly try to finalize.
Note this property name is a string to prevent breaking Closure JS Compiler optimizations. See @lit/reactive-element for more information.
Inherited from
LitElement.finalized
dev-mode Properties
disableWarning
▪ Static Optional disableWarning: (warningKind: WarningKind) => void
Type declaration
▸ (warningKind): void
Disable the given warning category for this class.
This method only exists in development builds, so it should be accessed with a guard like:
Parameters
warningKind
WarningKind
Returns
void
Nocollapse
Inherited from
LitElement.disableWarning
enableWarning
▪ Static Optional enableWarning: (warningKind: WarningKind) => void
Type declaration
▸ (warningKind): void
Enable the given warning category for this class.
This method only exists in development builds, so it should be accessed with a guard like:
Parameters
warningKind
WarningKind
Returns
void
Nocollapse
Inherited from
LitElement.enableWarning
enabledWarnings
▪ Static Optional enabledWarnings: WarningKind[]
Read or set all the enabled warning categories for this class.
This property is only used in development builds.
Nocollapse
Inherited from
LitElement.enabledWarnings
properties Properties
elementProperties
▪ Static elementProperties: PropertyDeclarationMap
Memoized list of all element properties, including any superclass properties. Created lazily on user subclasses when finalizing the class.
Nocollapse
Inherited from
LitElement.elementProperties
properties
▪ Static properties: PropertyDeclarations
User-supplied object that maps property names to PropertyDeclaration objects containing options for configuring reactive properties. When a reactive property is set the element will update and render.
By default properties are public fields, and as such, they should be considered as primarily settable by element users, either via attribute or the property itself.
Generally, properties that are changed by the element should be private or protected fields and should use the state: true option. Properties marked as state do not reflect from the corresponding attribute
However, sometimes element code does need to set a public property. This should typically only be done in response to user interaction, and an event should be fired informing the user; for example, a checkbox sets its checked property when clicked and fires a changed event. Mutating public properties should typically not be done for non-primitive (object or array) properties. In other cases when an element needs to manage state, a private property set with the state: true option should be used. When needed, state properties can be initialized via public properties to facilitate complex interactions.
Nocollapse
Inherited from
LitElement.properties
rendering Properties
renderOptions
• Readonly renderOptions: RenderOptions
Inherited from
LitElement.renderOptions
renderRoot
• Readonly renderRoot: HTMLElement | ShadowRoot
Node or ShadowRoot into which element DOM should be rendered. Defaults to an open shadowRoot.
Inherited from
LitElement.renderRoot
shadowRootOptions
▪ Static shadowRootOptions: ShadowRootInit
Options used when calling attachShadow. Set this property to customize the options for the shadowRoot; for example, to create a closed shadowRoot: {mode: 'closed'}.
Note, these options are used in createRenderRoot. If this method is customized, options should be respected if possible.
Nocollapse
Inherited from
LitElement.shadowRootOptions
styles Properties
elementStyles
▪ Static elementStyles: CSSResultOrNative[]
Memoized list of all element styles. Created lazily on user subclasses when finalizing the class.
Nocollapse
Inherited from
LitElement.elementStyles
styles
▪ Static Optional styles: CSSResultGroup
Array of styles to apply to the element. The styles should be defined using the css tag function, via constructible stylesheets, or imported from native CSS module scripts.
Note on Content Security Policy:
Element styles are implemented with <style> tags when the browser doesn't support adopted StyleSheets. To use such <style> tags with the style-src CSP directive, the style-src value must either include 'unsafe-inline' or nonce-<base64-value> with <base64-value> replaced be a server-generated nonce.
To provide a nonce to use on generated <style> elements, set window.litNonce to a server-generated nonce in your page's HTML, before loading application code:
Nocollapse
Inherited from
LitElement.styles
updates Properties
hasUpdated
• hasUpdated: boolean
Is set to true after the first update. The element code cannot assume that renderRoot exists before the element hasUpdated.
Inherited from
LitElement.hasUpdated
isUpdatePending
• isUpdatePending: boolean
True if there is a pending update as a result of calling requestUpdate(). Should only be read.
Inherited from
LitElement.isUpdatePending
Last updated