Skip to content

Commit

Permalink
autocomplete
Browse files Browse the repository at this point in the history
  • Loading branch information
neferin12 committed Feb 1, 2021
1 parent 6c9c9d5 commit 12d1080
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export default {
},
data() {
return {
form: forms["Showcase"]
form: forms["5 Sicherheitsregeln"]
}
},
created() {
Expand Down
3 changes: 2 additions & 1 deletion src/components/FormFields/FormField.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
</b-input-group-prepend>
<component :is="type" :isInteger="item.type === 'integer'" :json="json" :name="title"
:required="required"
:ui="ui" @changedData="loopUp" ref="child" :filledData="filledData"/>
:ui="ui" @changedData="loopUp" ref="child" :filledData="filledData"
:autocomplete="(ui.options ||{}).autocomplete || 'on'"/>
<b-input-group-append :is-text="!noText" v-if="hasSlot()">
<!-- Content is appended to the input field-->
<slot></slot>
Expand Down
18 changes: 14 additions & 4 deletions src/exampleSchemas/5_Sicherheitsregeln/ui.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,36 @@
"elements": [
{
"type": "Control",
"scope": "#/properties/ort"
"scope": "#/properties/ort",
"options": {
"autocomplete": "postal-code"
}
},
{
"type": "Control",
"scope": "#/properties/dateTime"
},
{
"type": "Control",
"scope": "#/properties/anlageverantwortlicher"
"scope": "#/properties/anlageverantwortlicher",
"options": {
"autocomplete": "name"
}
},
{
"type": "Control",
"scope": "#/properties/arbeitsverantwortlicher",
"options": {
"multi": true
"multi": true,
"autocomplete": "name"
}
},
{
"type": "Control",
"scope": "#/properties/arbeitsausfuehrender"
"scope": "#/properties/arbeitsausfuehrender",
"options": {
"autocomplete": "name"
}
},
{
"type": "Divider"
Expand Down
4 changes: 2 additions & 2 deletions src/exampleSchemas/showcase/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
"type": "string",
"minLength": 1
},
"gender": {
"title": {
"type": "string",
"enum": ["Male", "Female", "Divers"]
"enum": ["Mrs.", "Mr.", "Miss", "Ms.", "Dr."]
},
"description": {
"type": "string"
Expand Down
5 changes: 3 additions & 2 deletions src/exampleSchemas/showcase/ui.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,14 @@
},
{
"type": "Control",
"scope": "#/properties/gender"
"scope": "#/properties/title"
},
{
"type": "Control",
"scope": "#/properties/name",
"options": {
"placeholder": "Full Name"
"placeholder": "Full Name",
"autocomplete": "name"
}
},
{
Expand Down
4 changes: 4 additions & 0 deletions src/schemas/ui/control.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,10 @@
"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"
}
}
},
Expand Down
2 changes: 1 addition & 1 deletion src/schemas/ui/ui.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"$id": "https://educorvi.github.io/vue_json_form/schemas/ui.schema.json",
"title": "UI Schema",
"description": "Schema for the UI Schema",
"oneOf": [
"anyOf": [
{"$ref": "https://educorvi.github.io/vue_json_form/schemas/layout.schema.json"},
{"$ref": "https://educorvi.github.io/vue_json_form/schemas/wizard.schema.json"}
]
Expand Down

0 comments on commit 12d1080

Please sign in to comment.