Class: ContextTag

CIQ.UI. ContextTag


new ContextTag()

Abstract class for web components that use a CIQ.UI.Context to gain access to an instance of the chart engine.

See:

Extends

Methods


addClaim(helper)

Claim any keystrokes that come in. Once claimed, any keystrokes that come in are passed to the helper. The helper can then choose to capture or propagate the keystrokes. This enables a helper to capture keystrokes even if it doesn't have mouse focus.

Parameters:
Name Type Description
helper HTMLElement

The element that should claim a keystroke.

Inherited From:

addDefaultMarkup(component [, markup])

Adds default markup to a web component if the component does not have any child nodes.

Parameters:
Name Type Argument Description
component HTMLElement

The component to which the markup is added.

markup String <optional>

The markup to add to the web component. Unused if the component has a static markup property that specifies the markup; for example, MyComponent.markup.

Since:
  • 7.5.0

Inherited From:

channelMergeObject(path, value, stx)

Merges an object in the chart engine communication channel.

Parameters:
Name Type Description
path String

The channel path.

value Object

The value merged to the channel.

stx CIQ.ChartEngine

A reference to the chart engine.

Since:
  • 7.5.0

Inherited From:

channelRead(path [, stx])

Reads the current value in the chart engine communication channel.

Parameters:
Name Type Argument Description
path String

The channel path.

stx CIQ.ChartEngine <optional>

Unused.

Since:
  • 7.5.0

Inherited From:
Returns:

The current value in channel.

Type
*

channelSubscribe(path, cb, stx)

Subscribes to the chart engine messaging channel.

Parameters:
Name Type Description
path *

The channel path.

cb *

A callback invoked upon subscribing and whenever a new message is posted in the channel.

stx CIQ.ChartEngine

A reference to the chart engine.

Since:
  • 7.5.0

Inherited From:
Returns:

A callback invoked when unsubscribing from the channel.

Type
function

channelWrite(path, value, stx)

Writes in the chart engine communication channel.

Parameters:
Name Type Description
path String

The channel path.

value *

The value written to the channel.

stx CIQ.ChartEngine

A reference to the chart engine.

Since:
  • 7.5.0

Inherited From:

connectedCallback()

Convenience function that creates an array of injections for the component and sets a variable of node equal to self.

Designed to be used as a helper method for the included WebComponents. A full tutorial on how to work with and customize the WebComponents can be found here: Web Component Interface.

Overrides:
  • CIQ.UI.BaseComponent#connectedCallback

disconnectedCallback()

Removes all the the injections for a context tag and resets the tag to its default state.

Designed to be used as a helper method for the included WebComponents. A full tutorial on how to work with and customize the WebComponents can be found here: Web Component Interface.

Overrides:
  • CIQ.UI.BaseComponent#disconnectedCallback

getChartContainer( [el])

Searches the DOM for the chart container element. Begins the search with el (or this) and proceeds parent-by-parent up the ancestry tree until an element is found.

Parameters:
Name Type Argument Description
el HTMLElement <optional>

The element on which to start the search. If not provided, this is used.

Since:
  • 7.5.0

Inherited From:
Returns:

The chart container element or undefined if an element is not found.

Type
HTMLElement | undefined

getContextContainer( [el])

Searches the DOM for the chart context element. Begins the search with el (or this if el is not provided) and proceeds up the ancestry tree until an element is found or the root of the tree has been reached.

Parameters:
Name Type Argument Description
el HTMLElement <optional>

The element on which to start the search. If not provided, this is used.

Since:
  • 7.5.0

Inherited From:
Returns:

The chart context element or undefined if an element is not found.

Type
HTMLElement | undefined

inputEntry(node, cb)

Attaches a keyboard input entry event.

Parameters:
Name Type Description
node HTMLElement

The element to which the input entry event is attached.

cb function

The callback function invoked when input entry occurs.

Inherited From:

qs(path, context)

Adapts the querySelector method.

Parameters:
Name Type Description
path String

The CSS selectors for which to search.

context HTMLElement | String

The chart context element, which is the starting point of the DOM query, or "thisChart" to indicate the chart context in whidh this function is called.

Since:
  • 7.5.0

Inherited From:
Returns:

The selected DOM element or undefined if an element is not found.

Type
HTMLElement | undefined

qsa(path, context)

Adapts the querySelectorAll method. Returns an array instead of a node list to enable chaining of the array map, filter, forEach, and reduce functions.

Parameters:
Name Type Description
path String

The CSS selectors for which to search.

context HTMLElement | String

The chart context element, which is the starting point of the DOM query, or "thisChart" to indicate the chart context in whidh this function is called.

Since:
  • 7.5.0

Inherited From:
Returns:

An array of selected DOM element or undefined if no elements are found.

Type
HTMLElement | undefined

removeClaim(helper)

Remove a claim on keystrokes.

Parameters:
Name Type Description
helper CIQ.UI.Helper

Helper or ContextTag from which the claim on keystrokes is removed.

Inherited From:

setContext(context)

Called for a registered component when the context is constructed. This method does nothing; you must override it with a method that performs context initialization.

Parameters:
Name Type Description
context CIQ.UI.Context

The chart user interface context.


setContextHolder()

Stores the component in the context holder (an array associated with the cq-context element) so that when the context is started, it knows that this tag is contextual.

Designed to be used as a helper method for the included WebComponents. A full tutorial on how to work with and customize the WebComponents can be found here: Web Component Interface.