Component

ve. Component

ve.Component: Components represent inputs and displays that yield a value via .v. They are typically encapsulated by a ve.Feature, but can be manually mounted via bind(arg0_container_el:HTMLElement).

Constructor:
  • arg0_options: Object
    • All bindings accept 'this'/'global'/'window' variables. Bindings propagate recursively upwards (i.e. a userchange at a lower level will register as a userchange in an upper level).
    • .binding: string - Related event: .onchange. Bidirectional data binding for both .from_binding/.to_binding.
    • .from_binding: string - Related event: .onprogramchange. Unidirectional data binding.
    • .to_binding: string - Related event: .onuserchange. Unidirectional data binding.
    • .onchange: function(this.v, this:ve.Component)
    • .onprogramchange: function(this.v, this:ve.Component)
    • .onuserchange: function(this.v, this:ve.Component)
    • .attributes: Object - Any attributes to place on the mounted this.element.
      • <attribute_key>: string
    • .limit=true: function(this.v)|undefined | boolean - Whether to display the current Component. Immediate mode.
    • .onload: function(this:ve.Component)
    • .tooltip: Object<ve.Component>|string
    • .style: Object - The CSS/Telestyle object to use for the current element. Immediate mode CSS if function is declared.
      • <selector_key>: string - CSS query selector. :nth-parent() is acceptable.
        • <css_property>: function|string
      • <css_property>: function|string
DOM:
  • Attributes:
    • data-debug-add-component: boolean
    • data-debug-limit: boolean
  • Fields:
Instance:
  • .child_class=this.constructor: ve.Component - The constructor object of the child class.
  • .is_vercengen_component=true: boolean - Whether to mark this ve.Component as a Vercengen component.
  • .parent_el: HTMLElement - The parent element of the current component, should it exist.
  • .height=1: number
  • .width=1: number
  • .x=0: number - Switches to an n+1 default if only .y is defined.
  • .y=n + 1: number - Switches to 0 if only .x is defined.
  • The linter/engine guarantees the following fields:
  • .element: HTMLElement - The HTMLElement that the ve.Component is mounted to.
  • .name: string - The name to display for the current ve.Component.
  • .owner: any - The root owner of the current ve.Component. This is typically a ve.Class, but can also be a ve.Feature or global/window.
  • .owners: Array<any> - A list of relevant owners in descending orders.
  • .v: any - The value stored by the component. Getter/setter.
Methods:
  • addComponent() - Attempts to mount the current component on its parent_el.
  • bind(arg0_container_el:HTMLElement) - Manually mounts the current component to arg0_container_el.
  • fireFromBinding() - Pseudo-setter from binding. Fires only upon program-driven changes to .v directly.
  • fireToBinding() - Pseudo-setter to binding. Fires only upon user-driven changes to .v.
  • remove() - Removes the component/element from the DOM.
  • removeComponent() - Unmounts the current component from its parent_el.
  • setValueFromObject(arg0_object:Object, arg1_object:Object) -
  • setOwner(arg0_value:Object, arg1_owner_array=[]:Array<Object>) - Used by the reflection engine in ve.Class to set the owner hierarchy automatically.
Static Methods:
  • linter() - Run at startup if ve.registry.debug_mode is true. Lints all Vercengen components.
Types:

Types are annotated by both their constructor function and what they return after the pipe separator (.v).

* indicates a recursive Object of that type.

Source:

Classes

ve.Button
ve.Checkbox
ve.Colour
ve.Datalist
ve.DatavisSuite
ve.Date
ve.DateLength
ve.File
ve.FileExplorer
ve.FlexInterface
ve.Graph
ve.HTML
ve.Hierarchy
ve.HierarchyDatatype
ve.Interface
ve.List
ve.Log
ve.Map
ve.MultiTag
ve.NodeEditor
ve.NodeEditorDatatype
ve.Number
ve.ObjectEditor
ve.ObjectInspector
ve.PageMenu
ve.Password
ve.Radio
ve.Range
ve.RawInterface
ve.RichText
ve.ScriptManager
ve.ScriptManagerBlockly
ve.ScriptManagerMonaco
ve.SearchSelect
ve.Select
ve.Spreadsheet
ve.Table
ve.Telephone
ve.Text
ve.Time
ve.Toggle
ve.URL
ve.UndoRedo
ve.WordProcessor

Members

from_binding

Internal .from_binding setter for handling .options.from_binding. Accepts a string literal that is then parsed to a variable reference.

.to_binding counterparts are manually handled child-side.

Source:

limit

Tests the current this.limit by calling this.limit_function(this.v, this). Otherwise resolves to true if no .options.limit is set.

Source:

limit

Sets the present this.limit or clears it (if undefined). Calls this.limit_function(this.v, this) when polled.

Source:

name

Returns the visual name of the present ve.Component,

Source:

name

Sets the visual name of the present ve.Component

Source:

Methods

addComponent()

Adds the current component to this.parent_el should it exist.

Source:

bind(arg0_container_el)

Manually binds/mounts the present ve.Component into the visual DOM.

Source:
Parameters:
Name Type Description
arg0_container_el HTMLElement

fireFromBinding()

Pseudo-setter from binding. Fires only upon program-driven changes to .v directly, which means that this has to be monitored manually component-side in set v(). This should always come last in set v().

Source:

fireToBinding()

Pseudo-setter to binding. Fires only upon user-driven changes, which means that this has to be monitored manually component-side.

Source:

remove()

Removes the component/element from the DOM.

Source:

removeComponent()

Removes the current component from this.parent_el should it exist.

Source:

setOwner(arg0_value, arg1_owner_array)

Sets the root parent and ownership tree. Influences this.parent_el, this.owner, this.owners.

Source:
Parameters:
Name Type Description
arg0_value
arg1_owner_array

setValueFromObject(arg0_object, arg1_object)

Destructures Object values and transfers them into the .v instance fields of each Vercengen component.

Source:
Parameters:
Name Type Description
arg0_object Object

The Vercengen object to transfer to.

arg1_object Object

The other object to transfer from.

(static) linter()

Runs over all Vercengen components that extend ve.Component and lints them in addition to declaring ve[local_key]() as a functional binding for each.

Ensures the following properties if ve.registry.debug_mode=true:

  • get v()/set v()
  • Not a duplicate component
Source: