Skip to content

Commit

Permalink
fix: rewrite in jade and commenting problematic fields
Browse files Browse the repository at this point in the history
  • Loading branch information
Lionel Bijaoui committed Oct 7, 2016
1 parent 5d6c0c7 commit 35be49e
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 36 deletions.
34 changes: 17 additions & 17 deletions dev/schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -408,25 +408,25 @@ module.exports = {
styleClasses: ["half-width", "first"],
validator: validators.required
},
// {
// type: "selectEx",
// label: "Country (selectEx field)",
// model: "address.country",
// multi: true,
// required: true,
// values: ["United Kingdom", "France", "Germany"],
// //default: "United Kingdom",
// multiSelect: false,
// selectOptions: {
// // https://silviomoreto.github.io/bootstrap-select/options/
// liveSearch: true,
/*{
type: "selectEx",
label: "Country (selectEx field)",
model: "address.country",
multi: true,
required: true,
values: ["United Kingdom", "France", "Germany"],
//default: "United Kingdom",
multiSelect: false,
selectOptions: {
// https://silviomoreto.github.io/bootstrap-select/options/
liveSearch: true,
size: 10,
noneSelectedText: "Nincs kijelölve"
},
styleClasses: "half-width",
validator: validators.required
},
{
}, */
/*{
type: "selectEx",
label: "Skills (selectEx field)",
model: "skills",
Expand All @@ -453,7 +453,7 @@ module.exports = {
min: 2,
max: 4,
validator: validators.array
},
},*/
{
type: "rangeSlider",
label: "Rank (rangeSlider field)",
Expand Down Expand Up @@ -558,7 +558,7 @@ module.exports = {
required: true,
disabled: false,
noUiSliderOptions: {
connect: "lower", // "lower", "upper", true, false
connect: [true, false], // "lower", "upper", true, false
// margin: 2 //number
// limit: 2 //number
step:1,
Expand Down Expand Up @@ -589,7 +589,7 @@ module.exports = {
disabled: false,
noUiSliderOptions: {
double:true,
connect: true, // "lower", "upper", true, false
connect: [false, true, false], // "lower", "upper", true, false
// margin: 2 //number
// limit: 2 //number
step: 1000,
Expand Down
36 changes: 17 additions & 19 deletions src/formGenerator.vue
Original file line number Diff line number Diff line change
@@ -1,22 +1,20 @@
<template>
<div>
<fieldset v-if="schema != null" class="vue-form-generator">
<template v-for="field in fields">
<div v-if="fieldVisible(field)" :class="getFieldRowClasses(field)" class="form-group">
<label>{{ field.label }}<span v-if="field.help" class="help"><i class="icon"></i>
<div v-html="field.help" class="helpText"></div></span></label>
<div class="field-wrap">
<component :is="getFieldType(field)" :disabled="fieldDisabled(field)" :model="model" :schema.sync="field" @model-updated="modelUpdated"></component>
<div v-if="buttonVisibility(field)" class="buttons">
<button v-for="btn in field.buttons" @click="btn.onclick(model, field)" :class="btn.classes">{{ btn.label }}</button>
</div>
</div>
<div v-if="field.hint" class="hint">{{ field.hint }}</div>
<div v-if="errorsVisibility(field)" class="errors"><span v-for="error in field.errors" track-by="$index">{{ error }}</span></div>
</div>
</template>
</fieldset>
</div>
<template lang="jade">
div
fieldset.vue-form-generator(v-if='schema != null')
template(v-for='field in fields')
.form-group(v-if='fieldVisible(field)', :class='getFieldRowClasses(field)')
label
| {{ field.label }}
span.help(v-if='field.help')
i.icon
.helpText(v-html='field.help')
.field-wrap
component(:is='getFieldType(field)', :disabled='fieldDisabled(field)', :model='model', :schema.sync='field', @model-updated='modelUpdated')
.buttons(v-if='buttonVisibility(field)')
button(v-for='btn in field.buttons', @click='btn.onclick(model, field)', :class='btn.classes') {{ btn.label }}
.hint(v-if='field.hint') {{ field.hint }}
.errors(v-if='errorsVisibility(field)')
span(v-for='error in field.errors', track-by='$index') {{ error }}
</template>

<script>
Expand Down

0 comments on commit 35be49e

Please sign in to comment.