Module Goog.​Ui.​Component

module Component : sig..end

val addChild : 
  #Goog.Ui.component Js.t ->
  #Goog.Ui.component Js.t -> bool Js.t Js.opt -> unit
val addChildAt : 
  #Goog.Ui.component Js.t ->
  #Goog.Ui.component Js.t -> int -> bool Js.t Js.opt -> unit

Adds the specified component as a child of this component at the given 0-based index.

Both addChild and addChildAt assume the following contract between parent and child components:

  • the child component's element must be a descendant of the parent component's element, and
  • the DOM state of the child component must be consistent with the DOM state of the parent component (see isInDocument).

In particular, parent.addChild(child) will throw an error if the child component is already in the document, but the parent isn't.

Clients of this API may call addChild and addChildAt with opt_render set to true. If opt_render is true, calling these methods will automatically render the child component's element into the parent component's element. However, parent.addChild(child, true) will throw an error if:

  • the parent component has no DOM (i.e. parent.getElement() is null), or
  • the child component is already in the document, regardless of the parent's DOM state.

Finally, this method also throws an error if the new child already has a different parent, or the given index is out of bounds. Returns

val removeChild : 
  #Goog.Ui.component Js.t ->
  #Goog.Ui.component Js.t ->
  bool Js.t Js.opt -> Goog.Ui.component Js.t Js.meth

Removes the given child from this component, and returns it. Throws an error if the argument is invalid or if the specified child isn't found in the parent component. The argument can either be a string (interpreted as the ID of the child component to remove) or the child component itself.

If opt_unrender is true, calls goog.ui.component#exitDocument on the removed child, and subsequently detaches the child's DOM from the document. Otherwise it is the caller's responsibility to clean up the child component's DOM. Returns The removed component, if any.

val removeChild_id : 
  #Goog.Ui.component Js.t ->
  Js.js_string Js.t ->
  bool Js.t Js.opt -> Goog.Ui.component Js.t Js.meth
module State : sig..end
module EventType : sig..end

Common events fired by components so that event propagation is useful.