Global

Members


<constant> AFTER_HANDLE_ROUTE :string

Router fire event $IMA.$Router.afterHandleRoute after page manager handle the route. Event's data contain {response: Object, params: Object, route: ima.router.Route, path: string, options: Object}}. The response is page render result. The path is current path, the params are params extracted from path, the route is handle route for path and the options is route additional options.

Type:
  • string

BAD_REQUEST :number

Bad request

Type:
  • number

<constant> BEFORE_HANDLE_ROUTE :string

Router fire event $IMA.$Router.beforeHandleRoute before page manager handle the route. Event's data contain { params: Object, route: ima.router.Route, path: string, options: Object}}. The path is current path, the params are params extracted from path, the route is handle route for path and the options is route additional options.

Type:
  • string

<constant> CLICK :string

Name of the event produced when the user clicks the page using the mouse, or touches the page and the touch event is not stopped.

Type:
  • string

<constant> CONTROL_CHARACTERS_REGEXP :RegExp

Regular expression matching all control characters used in regular expressions. The regular expression is used to match these characters in path expressions and replace them appropriately so the path expression can be compiled to a regular expression.

Type:
  • RegExp

Separator used to separate cookie declarations in the Cookie HTTP header or the return value of the document.cookie property.

Type:
  • string

<constant> EMPTY_MAP :Map.<function(*), Set.<?Object>>

An empty immutable map of event listener to scopes, used for a mismatch in the _eventListeners map.

Type:
  • Map.<function(*), Set.<?Object>>

<constant> EMPTY_SET :Set.<?Object>

An empty immutable set of event listener scopes, used for a mismatch in the _eventListeners map.

Type:
  • Set.<?Object>

<constant> ERROR :string

The internal route name used for the error page (the 5XX HTTP status code error page).

Type:
  • string

<constant> Events :string

Events constants, which is firing to app.

Type:
  • string

<constant> Events :string

Names of the DOM events the router responds to.

Type:
  • string

FORBIDDEN :number

Forbidden

Type:
  • number

<constant> IMA_EVENT :string

Global name of IMA.js custom event.

Type:
  • string

<constant> LOOSE_SLASHES_REGEXP :RegExp

Regular expression used to match and remove the starting and trailing forward slashes from a path expression or a URL path.

Type:
  • RegExp

<constant> MAX_EXPIRE_DATE :Date

Implementation note: This is the largest possible safe value that has been tested, used to represent "infinity".

Type:
  • Date

<constant> MOUSE_LEFT_BUTTON :number

The number used as the index of the mouse left button in DOM MouseEvents.

Type:
  • number

NO_CONTENT :number

No content

Type:
  • number

<constant> NOT_FOUND :string

The internal route name used for the "not found" error page (the 4XX HTTP status code error page).

Type:
  • string

NOT_FOUND :number

Not found

Type:
  • number

OK :number

OK

Type:
  • number

<constant> PARAMS_END_PATTERN :String

Regular expression used to match end of parameter names from a path expression.

Type:
  • String

<constant> PARAMS_MAIN_REGEXP :RegExp

Regular expression used to match all main parameter names from a path expression.

Type:
  • RegExp

<constant> PARAMS_NEVER_MATCH_REGEXP :RegExp

Regular expression used to never match the parameter names from a path expression. It's used for wrong parameters order (optional vs. required ones)

Type:
  • RegExp

<constant> PARAMS_REGEXP_CORE_NAME :RegExp

Regular expression used to separate a camelCase parameter name

Type:
  • RegExp

<constant> PARAMS_REGEXP_OPT :RegExp

Regular expression used to match the parameter names from a path expression.

Type:
  • RegExp

<constant> PARAMS_REGEXP_REQUIRED :RegExp

Regular expression used to match the required parameter names from a path expression.

Type:
  • RegExp

<constant> PARAMS_REGEXP_UNIVERSAL :RegExp

Regular expression used to match the parameter names from a path expression.

Type:
  • RegExp

<constant> PARAMS_START_PATTERN :String

Regular expression used to match start of parameter names from a path expression.

Type:
  • String

<constant> POP_STATE :string

Name of the event fired when the user navigates back in the history.

Type:
  • string

<constant> PRODUCTION_ENVIRONMENT :string

Environment name value in the production environment.

Type:
  • string

<constant> RouteNames :string

HTTP status code constants, representing the HTTP status codes recognized and processed by this proxy.

Type:
  • string
See:

SERVER_ERROR :number

Internal Server Error

Type:
  • number

<constant> StatusCode :number

HTTP status code constants, representing the HTTP status codes recognized and processed by this proxy.

Type:
  • number
See:

<constant> SUBPARAMS_OPT_REGEXP :Object.<String, RegExp>

Regular expression used to match the optional parameter names from a path expression.

Type:
  • Object.<String, RegExp>

<constant> SUBPARAMS_REQUIRED_REGEXP :Object.<String, RegExp>

Regular expression used to match the required subparameter names from a path expression. (e.g. for path '/:paramA-:paramB/:nextParam' are subparametres 'paramA' and 'paramB')

Type:
  • Object.<String, RegExp>

TIMEOUT :number

Request timeout

Type:
  • number

UNAUTHORIZED :number

Unauthorized

Type:
  • number

Methods


cssClasses(component, classRules, includeComponentClassName)

Generate a string of CSS classes from the properties of the passed-in object that resolve to true.

Parameters:
Name Type Description
component AbstractComponent | AbstractPureComponent

The component requiring the composition of the CSS class names.

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
Returns:

String of CSS classes that had their property resolved to true.

Type
string
Examples
this.cssClasses('my-class my-class-modificator', true);
this.cssClasses({
           'my-class': true,
           'my-class-modificator': this.props.modificator
       }, true);

defaultCssClasses(classRules, component)

Generate a string of CSS classes from the properties of the passed-in object that resolve to true.

Parameters:
Name Type Argument 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.

component AbstractComponent | AbstractPureComponent | string <nullable>

The component requiring the composition of the CSS class names, if it has the className property set and requires its inclusion this time.

Returns:

String of CSS classes that had their property resolved to true.

Type
string

fire(component, eventName [, data])

Creates and sends a new IMA.js DOM custom event from the provided component.

Parameters:
Name Type Argument Description
component AbstractComponent | AbstractPureComponent

The component at which's root element the event will originate.

eventName string

The name of the event.

data * <optional>

Data to send within the event.


getContextTypes(classConstructor)

Retrieves the context type declarations for the specified component.

Parameters:
Name Type Description
classConstructor function

The constructor of the react component.

Returns:

The context type declarations associated with the specified component.

Type
Object.<string, function(...*): boolean>

getUtils(props, context)

Retrieves the view utilities from the component's current context or properties (preferring the context).

Parameters:
Name Type Description
props Object.<string, *>

The component's current properties.

context Object.<string, *>

The component's current context.

Throws:

Error Throw if the view utils cannot be located in the provided properties nor context.

Returns:

The retrieved view utilities.

Type
Object.<string, *>

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 Argument Description
component AbstractComponent | AbstractPureComponent

The component requiring the generating of the URL.

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(component, eventTarget, eventName, listener)

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
component AbstractComponent | AbstractPureComponent

The component requesting the registration of the event listener.

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(component, key [, params])

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 Argument Description
component AbstractComponent | AbstractPureComponent

The component requiring the localization.

key string

Localization key.

params Object.<string, (number|string)> <optional>

Values for replacing the placeholders in the localization phrase.

Returns:

Localized phrase.

Type
string

setContextTypes(classConstructor, contextTypes)

Overrides the previously associated context type declarations for the specified component to the provided ones.

Parameters:
Name Type Description
classConstructor function

The constructor of the react component.

contextTypes Object.<string, function(...*): boolean>

The new context type declarations to associate with the specified component.

Returns:

The provided context type declarations.

Type
Object.<string, function(...*): boolean>

unlisten(component, eventTarget, eventName, listener)

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
component AbstractComponent | AbstractPureComponent

The component that requested the registration of the event listener.

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.