AbstractComponent

page/AbstractComponent~ AbstractComponent

The base class for all view components.

Constructor

(abstract) new AbstractComponent(props, context)

Source:
Initializes the component.
Parameters:
Name Type Description
props Object.<string, *> The component properties.
context Object.<string, *> The component context.

Members

(nullable) _utils :Object.<string, *>

Source:
The view utilities, initialized lazily upon first use from either the context, or the component's props.
Type:
  • Object.<string, *>

utils

Source:
Returns the utilities for the view components. The returned value is the value bound to the $Utils object container constant.

Methods

cssClasses(classRules, includeComponentClassName) → {string}

Source:
Generate a string of CSS classes from the properties of the passed-in object that resolve to true.
Examples
this.cssClasses('my-class my-class-modificator', true);
this.cssClasses({
           'my-class': true,
           'my-class-modificator': this.props.modificator
       }, true);
Parameters:
Name Type Default Description
classRules string | Object.<string, boolean> CSS classes in a string separated by whitespace, or a map of CSS class names to boolean values. The CSS class name will be included in the result only if the value is true.
includeComponentClassName boolean false
Returns:
String of CSS classes that had their property resolved to true.
Type
string

findDOMNode(component) → (nullable) {HTMLElement}

Source:
Deprecated:
  • Use refs instead.
Finds and returns the DOM node representing the specified React component. Note that this method can be used only at the client-side.
Parameters:
Name Type Description
component React.Component
Returns:
The DOM node representing the specified React component, or null if no such node was found.
Type
HTMLElement

fire(eventName, dataopt)

Source:
Creates and sends a new IMA.js DOM custom event from this component.
Parameters:
Name Type Attributes Default Description
eventName string The name of the event.
data * <optional>
null Data to send within the event.
Source:
Generates an absolute URL using the provided route name (see the app/config/routes.js file). The provided parameters will replace the placeholders in the route pattern, while the extraneous parameters will be appended to the generated URL's query string.
Parameters:
Name Type Attributes Description
name string The route name.
params Object.<string, (number|string)> <optional>
Router parameters and extraneous parameters to add to the URL as a query string.
Returns:
The generated URL.
Type
string

listen(eventTarget, eventName, listener)

Source:
Registers the provided event listener for execution whenever an IMA.js DOM custom event of the specified name occurs at the specified event target.
Parameters:
Name Type Description
eventTarget React.Element | EventTarget The react component or event target at which the listener should listen for the event.
eventName string The name of the event for which to listen.
listener function The listener for event to register.

localize(key, paramsopt) → {string}

Source:
Returns the localized phrase identified by the specified key. The placeholders in the localization phrase will be replaced by the provided values.
Parameters:
Name Type Attributes Description
key string Localization key.
params Object.<string, (number|string)> <optional>
Values for replacing the placeholders in the localization phrase.
Returns:
Localized phrase.
Type
string

unlisten(eventTarget, eventName, listener)

Source:
Deregisters the provided event listener for an IMA.js DOM custom event of the specified name at the specified event target.
Parameters:
Name Type Description
eventTarget React.Element | EventTarget The react component or event target at which the listener should listen for the event.
eventName string The name of the event for which to listen.
listener function The listener for event to register.