Class: UiSchemaGenerator

UiSchemaGenerator(jsonSchema)

特定のコンポーネントもしくは HTML タグを利用した uiSchema をまとめて生成するクラス

Constructor

new UiSchemaGenerator(jsonSchema)

Parameters:
Name Type Description
jsonSchema Object JSON Schema の スキーマ定義部分
Properties:
Name Type Description
uiSchema Object uiSchema
schema Object JSON Schema の スキーマ定義部分
fieldOptions Object デフォルトのデータオブジェクト
errorOptions Object デフォルトのエラーオプション
License:
  • MIT
Source:
See:

Methods

generate(component, modelsopt, fieldOptionsopt, displayOptionsopt, errorOptionsopt, childrenopt, errorHandleropt) → {UiSchemaGenerator}

特定の要素の uiSchema をまとめて生成する
Parameters:
Name Type Attributes Description
component Object | String 生成するコンポーネントもしくはHTMLタグ名
models Array.<String> <optional>
要素と紐付けるモデル
fieldOptions Object <optional>
テンプレート内で使う属性に対応するデータオブジェクト。値として function(model, index) を取ることもできる。 公式の説明はこちら
displayOptions Object <optional>
表示するかどうかの条件を JSON Schema で指定する
errorOptions Object <optional>
エラーが発生した時のみ有効になる fieldOptions
children Array <optional>
子要素
errorHandler boolean <optional>
エラーハンドリングを行うかどうか
Source:
Returns:
UiSchemaGenerator
Type
UiSchemaGenerator

setDefaultErrorOptions(errorOptions) → {UiSchemaGenerator}

デフォルトのエラーオプションを追加設定する。
Parameters:
Name Type Description
errorOptions Object データオブジェクト
Source:
Returns:
UiSchemaGenerator
Type
UiSchemaGenerator

setDefaultFieldOptions(fieldOptions) → {UiSchemaGenerator}

デフォルトのデータオブジェクトを追加設定する。
Parameters:
Name Type Description
fieldOptions Object データオブジェクト
Source:
Returns:
UiSchemaGenerator
Type
UiSchemaGenerator

toArray() → {Array}

uiSchema を返却する
Source:
Returns:
uiSchema
Type
Array