gradum-kit - v0.1.0
    Preparing search index...

    Class GradumBaseElement

    GradumBaseElement

    The element's view type, if initializing MVC.

    The element's data type, if initializing MVC.

    The element's model type, if initializing MVC.

    The element's emitter type, if initializing MVC.

    GradumHeadlessElement class, similar to GradumElement but without extending HTMLElement.

    Hierarchy (View Summary)

    Index
    defaultProperties: object = {}

    Default properties assigned to a new instance.

    properties: object

    The properties this element was created with.

    initialized: boolean

    Whether the element was initialized already or not.

    defaultFeedforwardProperties: GradumElementProperties

    The properties passed on to children created through feedforward, letting a parent seed its descendants with shared defaults.

    • Function

      create

      Type Parameters

      Parameters

      • this: This
      • Optionalproperties: This["prototype"]["properties"] = {}

        Properties to set on the new instance.

      Returns This["prototype"]

      The created instance.

      Instantiate this class with the given properties. Defaults declared by every class in the inheritance chain are applied first, nearest ancestor last, so a subclass' defaultProperties win over its parent's. The return type follows the class it is called on, so a subclass gets its own type back.

    • Protected Function

      Parameters

      • properties: object

        Properties to set on the new instance, defaults already merged in.

      Returns object

      The created instance.

      customCreate

      The construction step behind create. Override it to change how instances of a class are built — to route through a factory, or to wrap the instance — while keeping the default-merging that create performs.

    • Function

      destroy

      Returns this

      Itself, allowing for method chaining.

      Destroys the node by removing it from the document and removing all its bound listeners.

    • Function

      initialize

      Returns void

      Initializes the element. It sets up the UI by calling the methods setupUIElements, setupUILayout, setupUIListeners, and setupChangedCallbacks (in this order, if they are defined). This function is called automatically in .setProperties() and when instantiating an element via element(). It is called only once per element (as it checks with the reflected initialized flag).

    • Function

      feedforward

      Parameters

      • Optionalproperties: FeedforwardProperties

        Properties to feed forward. Defaults to defaultFeedforwardProperties.

      Returns this

      Itself, allowing for method chaining.

      Push this element's feedforward properties down to its children, so newly added descendants pick up the same defaults.

    • Function

      clone

      Parameters

      Returns this

      The cloned element.

      Create a copy of this element. By default the copy carries the same properties and children but none of the bound listeners.