Wait is used as to indicate a process that is in-progress for an indefinite amount of time. When the time is known, <coral-progress> should be used instead.

Coral.Wait API

Constructor

JavaScript:

new Coral.Wait() or document.createElement('coral-wait')

HTML Tag:

<coral-wait>

Extends

Static Properties

Coral.Wait.size {String}

Enumeration representing wait indicator sizes.

Properties:

Name Type Value Description
SMALL String S A small wait indicator. This is the default size.
MEDIUM String M A medium wait indicator.
LARGE String L A large wait indicator.

Coral.Wait.variant {String}

Enum for wait variant values.

Properties:

Name Type Value Description
DEFAULT String default The default variant.
DOTS String dots A dot styled wait.

Instance Properties

instance.centered {Boolean}

Reflected
Whether the component is centered or not. The container needs to have the style position: relative for the centering to work correctly.
Default Value:
  • false
HTML Attribute:
  • centered

instance.hidden {Boolean}

Reflected
Whether this component is hidden or not.
Inherited From:
Default Value:
  • false
HTML Attribute:
  • hidden

instance.size {Coral.Wait.size}

The size of the wait indicator. Currently 'S' (the default), 'M' and 'L' are available. See Coral.Wait.size
Default Value:
  • Coral.Wait.size.SMALL
HTML Attribute:
  • size

instance.variant {Coral.Wait.variant}

The wait's variant.
Default Value:
  • Coral.Wait.variant.DEFAULT
HTML Attribute:
  • variant

Methods

instance.get

Get the value of a property.
Parameters:
Name Type Description
property String The name of the property to fetch the value of.
Returns:
Property value. {*}
Inherited From:

instance.hide

Hide this component.
Returns:
this, chainable {Coral.Component}
Inherited From:

instance.off

Remove an event listener.
Parameters:
Name Type Optional Description
eventName String No
The event name to stop listening for.
selector String Yes
The selector that was used for event delegation.
func function No
The function that was passed to on().
useCapture Boolean Yes
Only remove listeners with useCapture set to the value passed in.
Returns:
this, chainable. {Coral.Component}
Inherited From:

instance.on

Add an event listener.
Parameters:
Name Type Optional Default Description
eventName String No
The event name to listen for.
selector String Yes
The selector to use for event delegation.
func function No
The function that will be called when the event is triggered.
useCapture Boolean Yes
Whether or not to listen during the capturing or bubbling phase.
Returns:
this, chainable. {Coral.Component}
Inherited From:

instance.remove

Non-destructively remove this element. It can be re-added by simply appending it to the document again. It will be garbage collected if there are no more references to it. This is different from using jQuery's remove(), which is destructive in that it removes data and listeners.
Inherited From:

instance.set

Set a single property.
Parameters:
Name Type Description
property String The name of the property to set.
value * The value to set the property to.
silent Boolean If true, events should not be triggered as a result of this set.
Returns:
this, chainable. {Coral.Component}
Inherited From:

instance.show

Show this component.
Returns:
this, chainable {Coral.Component}
Inherited From:

instance.trigger

Trigger an event.
Parameters:
Name Type Optional Default Description
eventName String No
The event name to trigger.
props Object Yes
Additional properties to make available to handlers as event.detail.
bubbles Boolean Yes
Set to false to prevent the event from bubbling.
cancelable Boolean Yes
Set to false to prevent the event from being cancelable.
Returns:
CustomEvent object {CustomEvent}
Inherited From:

Events

coral-component:attached

Triggered when the component is attached to the DOM.
Callback Parameters:
Name Type Description
event Object Event object.
Inherited From:
Deprecated:
  • since 1.14.0, use MutationObserver instead.

    coral-component:detached

    Triggered when the component is detached to the DOM.
    Callback Parameters:
    Name Type Description
    event Object Event object.
    Inherited From:
    Deprecated:
    • since 1.14.0, use MutationObserver instead.

      coral-component:ready

      Triggerred when the component has been upgraded and is ready for use.
      Callback Parameters:
      Name Type Description
      event Object Event object.
      Inherited From:
      Deprecated:
      • since 1.9.0, use Coral.commons.ready() instead.