The mixin class for Polymer elements. It provides convenience features on top of the custom elements web standard.
If this class is used as a mixin,
you must call polymerCreated()
from the body of your constructor.
Regular expression that matches data-bindings.
Future indicating that the Polymer library has been loaded and is ready for use.
Returns a list of elements that have had polymer-elements created but are not yet ready to register. The list is an array of element definitions.
Forces polymer to register any pending elements. Can be used to abort waiting for elements that are partially defined.
Loads an HTMLImport for each url specified in the urls
array. Notifies
when all the imports have loaded by calling the callback
function
argument. This method can be used to lazily load imports. For example,
For example,…
Loads the set of HTMLImports contained in node
. Returns a future that
resolves when all the imports have been loaded. This method can be used to
lazily load imports. For example, given a template:…
Deprecated: Use import
instead.
Like document.register
but for Polymer elements.…
Register a custom element that has no associated <polymer-element>
.
Unlike register this will always perform synchronous registration and
by the time this method returns the element will be available using
document.createElement
or by modifying the HTML to include the element.
Map of items in the shadow root(s) by their Element.id
.
All attributes on this element.…
The underlying JS DOM object.
Access the dimensions and position of this element's content + padding + border box.…
The stream of change records to this object. Records will be delivered asynchronously.…
A list of this node's children.…
List of the direct children of this element.…
The set of CSS classes applied to this element.…
Gets the position of this element relative to the client area of the page.
Access this element's content position.…
Allows access to all custom data attributes (data-*) set on this element.…
Deprecated: use element
instead.
Provides the coordinates of the element relative to the top of the document.…
The most derived <polymer-element>
declaration for this element.
Returns the object that should be used as the event controller for event bindings in this element's template. If set, this will override the normal controller lookup.
The first child of this node.…
Get a hash code for this object.…
True if this object has any observers, and should call
notifyChange
for changes.
Parses the HTML fragment and sets it as the contents of this element.…
The last child of this node.…
Access the dimensions and position of this element's content + padding + border + margin box.…
A URI that identifies the XML namespace of this element.…
The next sibling node.…
The name of this node.…
A modifiable list of this node's children.
The type of node.…
The value of this node.…
Gets the offset of this element relative to its offsetParent.
This is an ease-of-use accessor for event streams which should only be used when an explicit accessor is not available.
Stream of abort
events handled by this Element
.
Stream of beforecopy
events handled by this Element
.
Stream of beforecut
events handled by this Element
.
Stream of beforepaste
events handled by this Element
.
Stream of blur
events handled by this Element
.
Stream of change
events handled by this Element
.
Stream of click
events handled by this Element
.
Stream of contextmenu
events handled by this Element
.
Stream of copy
events handled by this Element
.
Stream of cut
events handled by this Element
.
Stream of doubleclick
events handled by this Element
.
A stream of drag
events fired when this element currently being dragged.…
A stream of dragend
events fired when this element completes a drag
operation.…
A stream of dragenter
events fired when a dragged object is first dragged
over this element.…
A stream of dragleave
events fired when an object being dragged over this
element leaves this element's target area.…
A stream of dragover
events fired when a dragged object is currently
being dragged over this element.…
A stream of dragstart
events fired when this element starts being
dragged.…
A stream of drop
events fired when a dragged object is dropped on this
element.…
Stream of error
events handled by this Element
.
Stream of focus
events handled by this Element
.
Stream of fullscreenchange
events handled by this Element
.
Stream of fullscreenerror
events handled by this Element
.
Stream of input
events handled by this Element
.
Stream of invalid
events handled by this Element
.
Stream of keydown
events handled by this Element
.
Stream of keypress
events handled by this Element
.
Stream of keyup
events handled by this Element
.
Stream of load
events handled by this Element
.
Stream of mousedown
events handled by this Element
.
Stream of mouseenter
events handled by this Element
.
Stream of mouseleave
events handled by this Element
.
Stream of mousemove
events handled by this Element
.
Stream of mouseout
events handled by this Element
.
Stream of mouseover
events handled by this Element
.
Stream of mouseup
events handled by this Element
.
Stream of mousewheel
events handled by this Element
.
Stream of paste
events handled by this Element
.
Stream of reset
events handled by this Element
.
Stream of scroll
events handled by this Element
.
Stream of search
events handled by this Element
.
Stream of select
events handled by this Element
.
Stream of selectstart
events handled by this Element
.
Stream of submit
events handled by this Element
.
Stream of touchcancel
events handled by this Element
.
Stream of touchend
events handled by this Element
.
Stream of touchenter
events handled by this Element
.
Stream of touchleave
events handled by this Element
.
Stream of touchmove
events handled by this Element
.
Stream of touchstart
events handled by this Element
.
Stream of transitionend
events handled by this Element
.
The document this node belongs to.…
Access the dimensions and position of this element's content + padding box.…
The parent element of this node.…
The parent node of this node.…
By default the data bindings will be cleaned up when this custom element
is detached from the document. Overriding this to return true
will
prevent that from happening.
The previous sibling node.…
A representation of the runtime type of the object.
Gets the shadow root associated with the corresponding custom element.…
Use to override the default syntax for polymer-elements.
By default this will be null, which causes instanceTemplate
to use
the template's bindingDelegate or the element.syntax
, in that order.
All text within this node and its decendents.…
Experimental support for web components. This field stores a
reference to the component implementation. It was inspired by Mozilla's
x-tags project. Please note: in the future it may be possible to
extend Element
from your class, in which case this field will be
deprecated.…
The equality operator.…
Attach event listeners on the host (this) element.
Creates a new AnimationEffect object whose target element is the object on which the method is called, and calls the play() method of the AnimationTimeline object of the document timeline of the node document of the element, passing the newly created AnimationEffect as the argument to the method. Returns an AnimationPlayer for the effect.…
Adds a node to the end of the child nodes
list of this node.…
Parses the specified text as HTML and adds the resulting node after the last child of this element.
Adds the specified text after the last child of this element.
Invokes a function asynchronously. The context of the callback function is function is bound to 'this' automatically. Returns a handle which may be passed to cancelAsync to cancel the asynchronous call.…
Invokes a function asynchronously.
This will call Polymer.flush()
and then return a new Timer
with the provided method
and timeout
.…
Called at detached time to signal that an element's bindings should be
cleaned up. This is done asynchronously so that users have the chance to
call cancelUnbindAll
to prevent unbinding.
Called by the DOM when this element has been inserted into the live document.…
Called by the DOM whenever an attribute on this has been changed.
If attribute name
is mapped to a property, deserialize
value
into that property.
Called by TemplateBinding/NodeBind to setup a binding to the given property. It's overridden here to support property bindings in addition to attribute bindings that are supported by default.
Called by TemplateBinding when all bindings on an element have been executed. This signals that all element inputs have been gathered and it's safe to ready the element, create shadow-root and start data-observation.
Bind the name
property in this element to bindable
. Note in Dart it
is necessary to also define the field:…
Cancel an operation scheduled by async.
/ Call in detached
to prevent the element from unbinding when it is
/ detached from the dom. The element is unbound as a cleanup step that
/ allows its memory to be reclaimed. If cancelUnbindAll
is used, consider
calling unbindAll
when the element is no longer needed. This will allow
its memory to be reclaimed.
Remove className
from old
, add class to anew
, if they exist.
Returns a copy of this node.…
Returns true if this node contains the specified node.…
Create a DocumentFragment from the HTML fragment and ensure that it follows the sanitization rules specified by the validator or treeSanitizer.…
Creates a CompoundObserver to observe property changes.
NOTE, this is only done if there are any properties in the _observe
object.
Synchronously deliver pending changes. Returns true if any records were delivered, otherwise false.
Force any pending property changes to synchronously deliver to handlers
specified in the observe
object.
Note: normally changes are processed at microtask time.
Convert representation of value
based on type
and currentValue
.
Called by the DOM when this element has been removed from the live document.…
Calls methodOrCallback
with args
if it is a closure, otherwise, treat
it as a method name in object
, and invoke it.
Implement to access custom elements in dom descendants, ancestors,
or siblings. Because custom elements upgrade in document order,
elements accessed in ready
or attached
may not be upgraded. When
domReady
is called, all registered custom elements are guaranteed
to have been upgraded.
Deprecated*: override attached
instead.
Given a <polymer-element>
, find an associated template (if any) to be
used for shadow-root generation.…
Fire a CustomEvent
targeting onNode
, or this
if onNode is not
supplied. Returns the new event.
Returns the smallest bounding rectangle that encompasses this element's padding, scrollbar, and border.…
Returns a list of bounding rectangles for each box associated with this element.…
The set of all CSS values applied to this element, including inherited and default values.…
Returns a list of shadow DOM insertion points to which this element is distributed.…
Returns a list of nodes with the given class name inside this element.…
Gets a map for manipulating the attributes of a particular namespace.…
Deprecated use shadowRoots instead.
Returns true if this node has any children.…
Inject HTML which contains markup bound to this element into a target element (replacing target element content).
Parses text as an HTML fragment and inserts it into the DOM at the specified location.…
Inserts all of the nodes into this node directly before refChild.…
Inserts all of the nodes into this node directly before refChild.…
Installs external stylesheets and <style> elements with the attribute polymer-scope='controller' into the scope of element. This is intended to be called during custom element construction.
Creates the document fragment to use for each instance of the custom
element, given the <template>
node. By default this is equivalent to:…
Call methodName
method on this object with args
.
Deprecated*: override detached
instead.
Utility function that stamps a <template>
into light-dom.
Deprecated: This is no longer a public method.
Locate nodes with id and store references to them in $ hash.
Checks if this element or any of its parents match the CSS selectors.
Invoked when a non-existent method or property is accessed.…
Notify observers of a change.…
Notify that the field name
of this object has been changed.…
Handler for property changes; routes changes to observing methods. Note: array valued properties are observed for array splices.
Provides the offset of this element's borderEdge
relative to the
specified parent
.…
Returns a future when node
changes, or when its children or subtree
changes.…
Start observing property changes.
Perform init-time actions based on static information in the
<polymer-element>
instance argument.…
Walks the prototype-chain of this element and allows specific classes a chance to process static declarations.…
If this class is used as a mixin, this method must be called from inside
of the created()
constructor.…
Return the published property matching name, or null.
Alias for querySelector
. Note this function is deprecated because its
semantics will be changing in the future.
Alias for querySelectorAll
. Note this function is deprecated because its
semantics will be changing in the future.
Finds the first descendant element of this element that matches the specified group of selectors.…
Finds all descendent elements of this element that match the specified group of selectors.…
Helper to implement a property with the given name
. This is used for
normal and computed properties. Normal properties can provide the initial
value using the initialValue
function. Computed properties ignore
initialValue
, their value is derived from the expression in the
ComputedProperty annotation that appears above the getter that uses this
helper.
Lifecycle method called when the element has populated it's shadowRoot
,
prepared data-observation, and made itself ready for API interaction.
To wait until the element has been attached to the default view, use
attached or domReady.
Bookkeeping observers for memory management.
Removes this node from the DOM.
Replaces this node with another node.
Invoke callback
in wait
, unless the job is re-registered,
which resets the timer. If wait
is not supplied, this will use
window.requestAnimationFrame
instead of a Timer
.…
Scrolls this element into view.…
Parses the HTML fragment and sets it as the contents of this element. This ensures that the generated content follows the sanitization rules specified by the validator or treeSanitizer.…
Utility function that creates a shadow root from a <template>
.…
Returns a string representation of this object.
This method should rarely be used and only if cancelUnbindAll
has been
called to prevent element unbinding. In this case, the element's bindings
will not be automatically cleaned up and it cannot be garbage collected by
by the system. If memory pressure is a concern or a large amount of
elements need to be managed in this way, unbindAll
can be called to
deactivate the element's bindings and allow its memory to be reclaimed.
Helper to implement a setter of a property with the given name
on a
polymer element. This can be used on normal properties and also on
computed properties, as long as the expression used for the computed
property is assignable (see ComputedProperty).