Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • __type<{}, this> & HTMLElement
    • default

Index

Constructors

constructor

Properties

_attrToProp

_attrToProp: Object

Object of attribute names to property names

_changing

_changing: boolean

Flag indicating pending property changes are being processed

_connectedOnce

_connectedOnce: boolean

Flag indicating if element has been connected to DOM at least once

_firstUpdate

_firstUpdate: boolean

Flag indicating if this is the first update to occur

_initials

_initials: Object

Initial values of properties

_newChanges

_newChanges: boolean

Flag indicating if there are any pending changes in the current update cycle

_propNames

_propNames: string[]

Array of property names

_props

_props: Object

Current values of properties <string, any>

_removeUnreflectedAttributes

_removeUnreflectedAttributes: boolean

Indicates if unreflected attributes should be removed on initialisation

_toUpdate

_toUpdate: Map<string, any>

Map of all properties to their new values, that have changed in the current update cycle

_updatePromise

_updatePromise: null | Promise<void>

Promise that will resolve when all the current updates have been triggered

Accessors

_needsRehydrating

  • get _needsRehydrating(): boolean
  • Returns true if the component has been rendered on the server and has not yet been rehydrated

    Returns boolean

events

  • get events(): Object
  • Object keyed by a CSS Selector to an object mapping DOM event names to the function that should be called when the event occurs. The function will be automatically bound to the current element. Alternatively the event name can map to a TargetEvent to enable binding to different targets and/or use different event options

    Returns Object

props

  • get props(): Object

Static isSSR

  • set isSSR(ssr: boolean): void
  • Parameters

    • ssr: boolean

    Returns void

Static observedAttributes

  • get observedAttributes(): string[]
  • A list of all attributes whose values should be used to set properties, using attributeName set in props if available

    Returns string[]

Static props

  • get props(): Object

Static supportsDSD

  • get supportsDSD(): boolean
  • Does the current client context support Declarative Shadow DOM

    Returns boolean

Static template

  • get template(): string

Methods

_getter

  • _getter(name: string): () => any
  • Returns a getter for named property

    Parameters

    • name: string

      Property name

    Returns () => any

      • (): any
      • Returns any

_setFromAttribute

  • _setFromAttribute(name: string, value: null | string): void
  • Sets property value from named attribute

    Parameters

    • name: string

      Property name

    • value: null | string

      Attribute value

    Returns void

_setFromProp

  • _setFromProp(name: string, value: any): void
  • Sets attribute from named property value

    Parameters

    • name: string

      Property name

    • value: any

      Property value

    Returns void

_setter

  • _setter(name: string): (value: any) => void
  • Returns a setter method for named property

    Parameters

    • name: string

      Property name

    Returns (value: any) => void

      • (value: any): void
      • Parameters

        • value: any

        Returns void

attributeChangedCallback

  • attributeChangedCallback(name: string, oldValue: null | string, newValue: null | string): void
  • Callback triggered when an attribute with a name matching a property name is changed

    Parameters

    • name: string

      Attribute name

    • oldValue: null | string

      Old attribute value

    • newValue: null | string

      New attribute value

    Returns void

changed

  • changed(changed: Map<string, any>): void | string[] | Promise<string[]>
  • Called when all pending property value changes have been processed, but before their targets have been updated. Changes made to properties in this callback will not trigger another update, but the updated values will be used for the current update.

    Parameters

    • changed: Map<string, any>

      A Map of properties and their old values that have changed in the current cycle

    Returns void | string[] | Promise<string[]>

    If an array of property names (or a Promise that resolves to an array) is returned then those properties will not have their targets updated. If a promise is returned then it will be awaited

connectedCallback

  • connectedCallback(): void
  • Called when an element is attached to the DOM

    Returns void

firstUpdated

  • firstUpdated(updated: Map<string, any>): void | Promise<void>
  • Called after the initial update of this component has occurred.

    Parameters

    • updated: Map<string, any>

    Returns void | Promise<void>

init

initialiseProps

  • initialiseProps(): void
  • Set up initial values of properties

    Returns void

requestUpdate

  • requestUpdate(props?: undefined | null | string[]): Promise<void>
  • Manually request an update cycle to run

    Parameters

    • props: undefined | null | string[] = []

    Returns Promise<void>

setupPropValues

  • setupPropValues(): void
  • Set initial property values

    Returns void

triggerUpdate

  • triggerUpdate(): Promise<void>
  • Trigger an update to the component that will be run at the end of the current task

    Returns Promise<void>

update

  • update(props?: undefined | null | string[]): void
  • Update property targets for all properties whose values have changed or have been manually requested

    Parameters

    • props: undefined | null | string[] = []

    Returns void

updateDone

  • updateDone(): Promise<void>
  • Returns a promise that will resolve when the current update cycle is complete, or immediately if there is no update pending.

    Returns Promise<void>

updateTargets

  • updateTargets(name: string): Promise<void>
  • Update the targets for property

    Parameters

    • name: string

    Returns Promise<void>

updated

  • updated(updated: Map<string, any>): void | Promise<void>
  • Called when all pending property target updates have been called. Changes made to properties in this callback will trigger another update cycle.

    Parameters

    • updated: Map<string, any>

      A Map of properties and their old values that have had their targets updated in the current cycle.

    Returns void | Promise<void>

    If a promise is returned then it will be awaited - this is useful in a server context where, if further work is initiated that results in property changes (and targets updated), the response shouldn't be set until all changes have been processed.

Generated using TypeDoc