Skip to content

Commit

Permalink
examples in doc
Browse files Browse the repository at this point in the history
  • Loading branch information
neferin12 committed Feb 15, 2021
1 parent 175a0b2 commit 027050b
Show file tree
Hide file tree
Showing 23 changed files with 160 additions and 89 deletions.
13 changes: 13 additions & 0 deletions docs/demo/css/app.1e3d846d.css

Large diffs are not rendered by default.

13 changes: 0 additions & 13 deletions docs/demo/css/app.be04920c.css

This file was deleted.

2 changes: 1 addition & 1 deletion docs/demo/index.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no"><link rel="icon" href="favicon.ico"><title>@educorvi/vue-json-form</title><link href="css/app.be04920c.css" rel="preload" as="style"><link href="css/chunk-vendors.5699e6ca.css" rel="preload" as="style"><link href="js/app.39513a81.js" rel="preload" as="script"><link href="js/chunk-vendors.98709b53.js" rel="preload" as="script"><link href="css/chunk-vendors.5699e6ca.css" rel="stylesheet"><link href="css/app.be04920c.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but @educorvi/vue-json-form doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div><script src="js/chunk-vendors.98709b53.js"></script><script src="js/app.39513a81.js"></script></body></html>
<!DOCTYPE html><html lang=en><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><meta name=viewport content="width=device-width,initial-scale=1,shrink-to-fit=no"><link rel=icon href=favicon.ico><title>@educorvi/vue-json-form</title><link href=css/app.1e3d846d.css rel=preload as=style><link href=css/chunk-vendors.5699e6ca.css rel=preload as=style><link href=js/app.3cd9c991.js rel=preload as=script><link href=js/chunk-vendors.99d4e714.js rel=preload as=script><link href=css/chunk-vendors.5699e6ca.css rel=stylesheet><link href=css/app.1e3d846d.css rel=stylesheet></head><body><noscript><strong>We're sorry but @educorvi/vue-json-form doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id=app></div><script src=js/chunk-vendors.99d4e714.js></script><script src=js/app.3cd9c991.js></script></body></html>
2 changes: 0 additions & 2 deletions docs/demo/js/app.39513a81.js

This file was deleted.

1 change: 0 additions & 1 deletion docs/demo/js/app.39513a81.js.map

This file was deleted.

2 changes: 2 additions & 0 deletions docs/demo/js/app.3cd9c991.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions docs/demo/js/app.3cd9c991.js.map

Large diffs are not rendered by default.

63 changes: 0 additions & 63 deletions docs/demo/js/chunk-vendors.98709b53.js

This file was deleted.

1 change: 0 additions & 1 deletion docs/demo/js/chunk-vendors.98709b53.js.map

This file was deleted.

56 changes: 56 additions & 0 deletions docs/demo/js/chunk-vendors.99d4e714.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions docs/demo/js/chunk-vendors.99d4e714.js.map

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Will be rendered as tags-Field

`object` ([Details](control-properties-options-properties-tags.md))

# undefined Properties
# tags Properties

| Property | Type | Required | Nullable | Defined by |
| :------------------ | :-------- | :------- | :------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ If the text in a enums select field is supposed to differ from the keys, they ca

`object` ([Titles for enum](control-properties-options-properties-titles-for-enum.md))

# Titles for enum Properties
# enumTitles Properties

| Property | Type | Required | Nullable | Defined by |
| :------- | :------- | :------- | :------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
Expand Down
2 changes: 1 addition & 1 deletion docs/schemaDoc/control-properties-options.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Gives multiple options to configure the element

`object` ([Options](control-properties-options.md))

# Options Properties
# options Properties

| Property | Type | Required | Nullable | Defined by |
| :---------------------------------------- | :-------- | :------- | :------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
Expand Down
2 changes: 1 addition & 1 deletion docs/schemaDoc/control-properties-showon-property.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Show field depending on value of other field

`object` ([ShowOn property](control-properties-showon-property.md))

# ShowOn property Properties
# showOn Properties

| Property | Type | Required | Nullable | Defined by |
| :-------------------------------- | :------- | :------- | :------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------- |
Expand Down
26 changes: 26 additions & 0 deletions docs/schemaDoc/control.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,32 @@ Contains a form element, e. g. a text input

`object` ([Control](control.md))

## Control Examples

```json
{
"type": "Control",
"scope": "#/properties/objectInJsonSchema"
}
```

```json
{
"type": "Control",
"scope": "#/properties/field",
"showOn": {
"scope": "#/properties/referenceField",
"type": "EQUALS",
"referenceValue": "awesomeValue"
},
"options": {
"label": false,
"radiobuttons": true,
"stacked": true
}
}
```

# Control Properties

| Property | Type | Required | Nullable | Defined by |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ A wizard that contains the form spread over multiple pages

`object` ([Wizard](layout-properties-elements-layoutelement-oneof-wizard.md))

# Wizard Properties
# 4 Properties

| Property | Type | Required | Nullable | Defined by |
| :----------------- | :------- | :------- | :------------- | :---------------------------------------------------------------------------------------------------------------------------------------- |
Expand Down
17 changes: 17 additions & 0 deletions docs/schemaDoc/layout.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,23 @@ The different Layouts

`object` ([Layout](layout.md))

## Layout Examples

```json
{
"type": "VerticalLayout",
"elements": []
}
```

```json
{
"type": "Group",
"label": "This is a group",
"elements": []
}
```

# Layout Properties

| Property | Type | Required | Nullable | Defined by |
Expand Down
2 changes: 1 addition & 1 deletion docs/schemaDoc/wizard-properties-pages-wizard-page.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ https://educorvi.github.io/vue_json_form/schemas/wizard_page.schema.json#/proper

`object` ([Wizard Page](wizard-properties-pages-wizard-page.md))

# Wizard Page Properties
# items Properties

| Property | Type | Required | Nullable | Defined by |
| :-------------------- | :-------- | :------- | :------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------- |
Expand Down
2 changes: 1 addition & 1 deletion docs/schemas/control.schema.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"$id":"https://educorvi.github.io/vue_json_form/schemas/control.schema.json","$schema":"http://json-schema.org/draft-07/schema#","type":"object","title":"Control","description":"Contains a form element, e. g. a text input","properties":{"type":{"type":"string","enum":["Control"]},"scope":{"type":"string","description":"A json pointer referring to the form element in the forms json schema","format":"json-pointer"},"format":{"description":"Format for string fields","type":"string","enum":["time","date","date-time","email","password","search","url","tel","color"]},"options":{"type":"object","title":"Options","description":"Gives multiple options to configure the element","properties":{"label":{"type":"boolean","description":"Defines whether the fields label is activated","default":true},"multi":{"oneOf":[{"type":"boolean"},{"type":"integer"}],"default":false,"description":"If set true, textarea will be shown instead of textfield. \n Alternatively can be set to the number of wanted lines"},"rating":{"type":"boolean","default":false,"description":"If set to true, numberfield will appear as star-rating-field"},"placeholder":{"type":"string","description":"Will be shown as placeholder in form fields, if supported by field"},"drop-placeholder":{"type":"string","description":"Will be shown as placeholder in file upload field when file drag and drop"},"allowMultipleFiles":{"type":"boolean","description":"Allows the upload of multiple files with fileupload"},"acceptedFileType":{"type":"string","description":"The accepted File Types","examples":["image/*","image/jpeg, image/png, image/gif",".jpg, .png, .gif"]},"enumTitles":{"type":"object","title":"Titles for enum","description":"If the text in a enums select field is supposed to differ from the keys, they can be specified as properties of this object. The value in the enum must be used as property name","propertyNames":{"type":"string","minLength":1},"patternProperties":{"":{"type":"string","minLength":1}}},"radiobuttons":{"type":"boolean","description":"If set to true, a group of radiobuttons will be shown instead of the select field","default":false},"stacked":{"type":"boolean","description":"Radiobutton-/Checkbox group will be stacked if set to true","default":false},"buttons":{"title":"Buttons","description":"Render fields that support it (Radiobuttons, Checkboxgroups) as Buttons","oneOf":[{"type":"boolean","description":"set to true, if should be rendered as buttons"},{"$ref":"https://educorvi.github.io/vue_json_form/schemas/variants.schema.json"}]},"switch":{"type":"boolean","title":"Switch(es)","description":"If set to true, the checkbox(-group) it was specified for will be rendered as switch(es)"},"append":{"type":"string","description":"Will be appended to field"},"tags":{"type":"object","description":"Will be rendered as tags-Field","properties":{"enabled":{"type":"boolean"},"variant":{"$ref":"https://educorvi.github.io/vue_json_form/schemas/variants.schema.json"},"pills":{"type":"boolean"}}},"autocomplete":{"type":"string","description":"Specifies what should be autocompleted by the browser. Possible values are listed here: https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete#values"}}},"showOn":{"$ref":"https://educorvi.github.io/vue_json_form/schemas/show_on.schema.json"}},"additionalProperties":false,"required":["type","scope"]}
{"$id":"https://educorvi.github.io/vue_json_form/schemas/control.schema.json","$schema":"http://json-schema.org/draft-07/schema#","type":"object","title":"Control","description":"Contains a form element, e. g. a text input","properties":{"type":{"type":"string","enum":["Control"]},"scope":{"type":"string","description":"A json pointer referring to the form element in the forms json schema","format":"json-pointer"},"format":{"description":"Format for string fields","type":"string","enum":["time","date","date-time","email","password","search","url","tel","color"]},"options":{"type":"object","title":"Options","description":"Gives multiple options to configure the element","properties":{"label":{"type":"boolean","description":"Defines whether the fields label is activated","default":true},"multi":{"oneOf":[{"type":"boolean"},{"type":"integer"}],"default":false,"description":"If set true, textarea will be shown instead of textfield. \n Alternatively can be set to the number of wanted lines"},"rating":{"type":"boolean","default":false,"description":"If set to true, numberfield will appear as star-rating-field"},"placeholder":{"type":"string","description":"Will be shown as placeholder in form fields, if supported by field"},"drop-placeholder":{"type":"string","description":"Will be shown as placeholder in file upload field when file drag and drop"},"allowMultipleFiles":{"type":"boolean","description":"Allows the upload of multiple files with fileupload"},"acceptedFileType":{"type":"string","description":"The accepted File Types","examples":["image/*","image/jpeg, image/png, image/gif",".jpg, .png, .gif"]},"enumTitles":{"type":"object","title":"Titles for enum","description":"If the text in a enums select field is supposed to differ from the keys, they can be specified as properties of this object. The value in the enum must be used as property name","propertyNames":{"type":"string","minLength":1},"patternProperties":{"":{"type":"string","minLength":1}}},"radiobuttons":{"type":"boolean","description":"If set to true, a group of radiobuttons will be shown instead of the select field","default":false},"stacked":{"type":"boolean","description":"Radiobutton-/Checkbox group will be stacked if set to true","default":false},"buttons":{"title":"Buttons","description":"Render fields that support it (Radiobuttons, Checkboxgroups) as Buttons","oneOf":[{"type":"boolean","description":"set to true, if should be rendered as buttons"},{"$ref":"https://educorvi.github.io/vue_json_form/schemas/variants.schema.json"}]},"switch":{"type":"boolean","title":"Switch(es)","description":"If set to true, the checkbox(-group) it was specified for will be rendered as switch(es)"},"append":{"type":"string","description":"Will be appended to field"},"tags":{"type":"object","description":"Will be rendered as tags-Field","properties":{"enabled":{"type":"boolean"},"variant":{"$ref":"https://educorvi.github.io/vue_json_form/schemas/variants.schema.json"},"pills":{"type":"boolean"}}},"autocomplete":{"type":"string","description":"Specifies what should be autocompleted by the browser. Possible values are listed here: https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete#values"}}},"showOn":{"$ref":"https://educorvi.github.io/vue_json_form/schemas/show_on.schema.json"}},"examples":[{"type":"Control","scope":"#/properties/objectInJsonSchema"},{"type":"Control","scope":"#/properties/field","showOn":{"scope":"#/properties/referenceField","type":"EQUALS","referenceValue":"awesomeValue"},"options":{"label":false,"radiobuttons":true,"stacked":true}}],"additionalProperties":false,"required":["type","scope"]}
2 changes: 1 addition & 1 deletion docs/schemas/layout.schema.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"title":"Layout","$schema":"http://json-schema.org/draft-07/schema#","$id":"https://educorvi.github.io/vue_json_form/schemas/layout.schema.json","type":"object","description":"The different Layouts","properties":{"type":{"type":"string","enum":["VerticalLayout","HorizontalLayout","Group"]},"elements":{"title":"Elements","description":"The elements of the layout","type":"array","default":[],"items":{"title":"Layoutelement","oneOf":[{"$ref":"https://educorvi.github.io/vue_json_form/schemas/control.schema.json"},{"$ref":"https://educorvi.github.io/vue_json_form/schemas/layout.schema.json"},{"$ref":"https://educorvi.github.io/vue_json_form/schemas/html.schema.json"},{"$ref":"https://educorvi.github.io/vue_json_form/schemas/divider.schema.json"},{"$ref":"https://educorvi.github.io/vue_json_form/schemas/wizard.schema.json"},{"$ref":"https://educorvi.github.io/vue_json_form/schemas/button.schema.json"}]}},"showOn":{"$ref":"https://educorvi.github.io/vue_json_form/schemas/show_on.schema.json"},"label":{"type":"string"},"$schema":{"type":"string","description":"May contain a schema reference to the uischema"}},"additionalProperties":false,"required":["type","elements"]}
{"title":"Layout","$schema":"http://json-schema.org/draft-07/schema#","$id":"https://educorvi.github.io/vue_json_form/schemas/layout.schema.json","type":"object","description":"The different Layouts","properties":{"type":{"type":"string","enum":["VerticalLayout","HorizontalLayout","Group"]},"elements":{"title":"Elements","description":"The elements of the layout","type":"array","default":[],"items":{"title":"Layoutelement","oneOf":[{"$ref":"https://educorvi.github.io/vue_json_form/schemas/control.schema.json"},{"$ref":"https://educorvi.github.io/vue_json_form/schemas/layout.schema.json"},{"$ref":"https://educorvi.github.io/vue_json_form/schemas/html.schema.json"},{"$ref":"https://educorvi.github.io/vue_json_form/schemas/divider.schema.json"},{"$ref":"https://educorvi.github.io/vue_json_form/schemas/wizard.schema.json"},{"$ref":"https://educorvi.github.io/vue_json_form/schemas/button.schema.json"}]}},"showOn":{"$ref":"https://educorvi.github.io/vue_json_form/schemas/show_on.schema.json"},"label":{"type":"string"},"$schema":{"type":"string","description":"May contain a schema reference to the uischema"}},"examples":[{"type":"VerticalLayout","elements":[]},{"type":"Group","label":"This is a group","elements":[]}],"additionalProperties":false,"required":["type","elements"]}
20 changes: 20 additions & 0 deletions src/schemas/ui/control.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,26 @@
"$ref": "https://educorvi.github.io/vue_json_form/schemas/show_on.schema.json"
}
},
"examples": [
{
"type": "Control",
"scope": "#/properties/objectInJsonSchema"
},
{
"type": "Control",
"scope": "#/properties/field",
"showOn": {
"scope": "#/properties/referenceField",
"type": "EQUALS",
"referenceValue": "awesomeValue"
},
"options": {
"label": false,
"radiobuttons": true,
"stacked": true
}
}
],
"additionalProperties": false,
"required": [
"type",
Expand Down
15 changes: 15 additions & 0 deletions src/schemas/ui/layout.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,21 @@
"description": "May contain a schema reference to the uischema"
}
},
"examples": [
{
"type": "VerticalLayout",
"elements": [

]
},
{
"type": "Group",
"label": "This is a group",
"elements": [

]
}
],
"additionalProperties": false,
"required": [
"type",
Expand Down

0 comments on commit 027050b

Please sign in to comment.