Skip to content
This repository has been archived by the owner on Mar 25, 2022. It is now read-only.

Latest commit

 

History

History
124 lines (83 loc) · 3.27 KB

src-exo-core_ExoFormFactory.md

File metadata and controls

124 lines (83 loc) · 3.27 KB

Module exo/core/ExoFormFactory

category:other

Source file

Class ExoFormFactory

Factory class for XO form - Used to create an XO form context. Provides factory methods. Starting point for using XO form.

Methods

build()

modifier: private modifier: static

Build {ExoFormContext} instance.


extractControlMeta(library) ► Array

modifier: private modifier: static

Generates meta documentation about all controls in the given control library.

Parameters Type Description
library Object **
return Array - Array containing control metadata.

all() ► Object

modifier: private modifier: static

Generates an XO form schema with all available controls

Parameters Type Description
return Object - XO form schema

read(value, options) ► ExoFormSchema

modifier: private modifier: static

Loads and parses an XO form schema from the given source

Parameters Type Description
value * Object, string, URL
options * options
return ExoFormSchema **

determineSchemaType(value) ► String

modifier: private modifier: static

Determines the XO form schema type from an object.

Parameters Type Description
value Object **
return String - the detected type ("field", "json-schema" or "form")

run(value, options) ►

modifier: private modifier: static

Run a form directly and return generated container

Parameters Type Description
value * JS/JSON schema or a URL to fetch it from.
options * *Object containing options
  • context: ExoFormContext
  • on: object with event listeners e.g. xo.form.run(schema, { on: { post: e => { // handle post } } })
  • for DOM event listening, use (on: {dom: {change: e => { ... }}}) xo.form.run(schema, { on: { post: e => { // handle post }, dom: { change: e => { // handle change event } } } })* return | undefined | div element (form container element div.exf-container)

readJSONSchema(schemaUrl) ► Object

modifier: private modifier: static

Read JSON Schema from the given URL.

Parameters Type Description
schemaUrl URL The URL to read the JSON Schema from
return Object - JSON Schema Object