0.2.2 • Published 3 years ago
oca.js-vue v0.2.2
oca.js-vue
As a reference of using this dependency check OCA Editor or Aries TDA
Functions
Zip files
resolveZipFile(file)
- arguments
file
- zip file in OCA format
- returns
array of OCA Array1, each element matches one OCA schema
- arguments
exportToZip(schema)
- arguments
schema
- OCA Schema2
- returns
zip file in OCA format
- arguments
Forms
renderForm(schemaObjects)
renderEmptyForm(uuid, label)
- arguments
uuid
label
- returns
form
4 object of mapped OCA schema
- arguments
createSchemaFromForm(baseForm, form)
Events
EventHandlerConstant
provides constants of emited events:- ADD_CONTROL
- REMOVE_CONTROL
- CHANGE_DATA_OPTION_IN_CONTROL
- EXPORT_FORM
- PUBLISH_FORM
- SAVE_PREVIEW
- REJECT_PREVIEW
- ON_LANGUAGE_CHANGE
- ERROR
- ACTIVATE_EDITOR_SIDEBAR
- DEACTIVATE_EDITOR_SIDEBAR
- ON_APPLY_EDITOR_SIDEBAR
eventBus
Vue Components
PreviewComponent
shows dialog of OCA formprops
form
alternatives
readonly
confirmLabel
confirmProcessing
methods
openModal(formData, formInput)
closeModal()
MultiPreviewComponent
shows dialog of many OCA formsprops
forms
label
readonly
confirmLabel
confirmProcessing
rejectLabel
rejectProcessing
methods
openModal()
closeModal()
FormBuilder
- props
form
standards
standard
- props
vuex
vuexModulesPlugin
Add it toVuex.Store
constructor in plugins array
Schemas
1) OCA Array: Array of OCA JSONs, first object is schema_base
JSON and the rest are overlays
JSONs, ex.:
[<schema base json>, <overlay json>, <overlay json>, ...]
2) OCA Schema: JSON of OCA data, ex.:
{
"schemaBase": <schema base json>,
"overlay1Name-DRI": <overlay json>,
"overlay2Name-DRI": <overlay json>,
...
}
3) schema: JSON of base OCA schema data, ex.:
{
"name": string,
"description": string,
"classification": string,
"uuid": string,
"did": string,
"version": string
}
4) form: JSON of OCA schema mapped into form format, ex.:
{
"uuid": string,
"label": string,
"sections": array of Sections (see below),
"type": string
}