Skip to content

Commit

Permalink
update schema and fix a test
Browse files Browse the repository at this point in the history
  • Loading branch information
Lionel Bijaoui committed Sep 21, 2016
1 parent 5830e85 commit b97c6bd
Show file tree
Hide file tree
Showing 2 changed files with 84 additions and 46 deletions.
128 changes: 83 additions & 45 deletions dev/schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ module.exports = {
type: "input",
inputType: "range",
label: "Range",
model: "range",
model: "age",
styleClasses: "half-width"
},
{
Expand All @@ -149,7 +149,7 @@ module.exports = {
{
type: "input",
inputType: "checkbox",
label: "Checkbox",
label: "Checkbox (show useless)",
model: "checkbox",
styleClasses: "half-width"
},
Expand All @@ -159,48 +159,55 @@ module.exports = {
label: "Search USELESS",
model: "search",
placeholder: "Entrez un mot-clef",
styleClasses: "half-width"
styleClasses: "half-width",
visible(model){return model.checkbox}
},
{
type: "input",
inputType: "radio",
label: "radio USELESS",
model: "radio",
styleClasses: "half-width"
styleClasses: "half-width",
visible(model){return model.checkbox}
},
{
type: "input",
inputType: "file",
label: "File USELESS",
model: "file",
visible(model){return model.checkbox}
},
{
type: "input",
inputType: "image",
label: "Image USELESS",
model: "image",
styleClasses: "half-width"
styleClasses: "half-width",
visible(model){return model.checkbox}
},
{
type: "input",
inputType: "button",
label: "Button USELESS",
model: "button",
styleClasses: "half-width"
styleClasses: "half-width",
visible(model){return model.checkbox}
},
{
type: "input",
inputType: "reset",
label: "Reset USELESS",
model: "reset",
styleClasses: "half-width"
styleClasses: "half-width",
visible(model){return model.checkbox}
},
{
type: "input",
inputType: "submit",
label: "Submit USELESS",
model: "submit",
styleClasses: "half-width"
styleClasses: "half-width",
visible(model){return model.checkbox}
},

/**************/
Expand Down Expand Up @@ -354,23 +361,6 @@ module.exports = {
model: "",
styleClasses: "alert alert-info"
},
{
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
},
styleClasses: ["half-width", "first"],
validator: validators.required
},
{
type: "spectrum",
label: "Color (spectrum field)",
Expand All @@ -386,22 +376,26 @@ module.exports = {
label: "Mobile (masked field)",
model: "mobile",
mask: "(99) 999-9999",
styleClasses: "half-width",
styleClasses: ["half-width", "first"],
validator: validators.required
},
},
{
type: "rangeSlider",
label: "Income",
model: "income",
type: "selectEx",
label: "Country (selectEx field)",
model: "address.country",
multi: true,
min: 0,
max: 100000,
rangeSliderOptions: {
type: "double",
prefix: "$",
step: 1000
}
},
required: true,
values: ["United Kingdom", "France", "Germany"],
//default: "United Kingdom",
multiSelect: false,
selectOptions: {
// https://silviomoreto.github.io/bootstrap-select/options/
liveSearch: true,
size: 10
},
styleClasses: "half-width",
validator: validators.required
},
{
type: "selectEx",
label: "Skills (selectEx field)",
Expand Down Expand Up @@ -435,14 +429,28 @@ module.exports = {
label: "Rank (rangeSlider field)",
model: "rank",
multi: true,
min: 1,
min: 0,
max: 10,
required: true,
sliderOptions: {
rangeSliderOptions: {
grid: true
},
// validator: validators.integer
validator: validators.integer
},
// {
// type: "rangeSlider",
// label: "Income",
// model: "income",
// multi: true,
// min: 0,
// max: 100000,
// rangeSliderOptions: {
// type: "double",
// prefix: "$",
// step: 1000,
// force_edges: true
// }
// },
{
type: "dateTimePicker",
label: "DOB (dateTimePicker field)",
Expand Down Expand Up @@ -519,8 +527,8 @@ module.exports = {
max: 10,
required: true,
disabled: false,
sliderOptions: {
// connect: "lower", // "lower", "upper", true, false
noUiSliderOptions: {
connect: "lower", // "lower", "upper", true, false
// margin: 2 //number
// limit: 2 //number
step:1,
Expand All @@ -538,8 +546,38 @@ module.exports = {
density: 10,
stepped: true
}
},
// validator: validators.integer
}
},
{
type: "noUiSlider",
label: "Rank (noUiSlider field)",
model: "income",
multi: true,
min: 0,
max: 100000,
required: true,
disabled: false,
noUiSliderOptions: {
double:true,
connect: true, // "lower", "upper", true, false
// margin: 2 //number
// limit: 2 //number
step: 1000,
// orientation:"vertical", //"vertical", "horizontal"
// direction: "ltr", //"ltr", "rtl"
tooltips: true, // false, true, formatter, array[formatter or false]
animate: false,
range:{
'min': [ 0 ],
'max': [ 100000 ]
},
pips: {
mode: 'count',
values: 6,
density: 10,
stepped: true
}
}
},
{
type: "cleave",
Expand Down
2 changes: 1 addition & 1 deletion test/unit/specs/fields/fieldNoUiSlider.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ describe("fieldNoUiSlider.vue", function() {

describe("check template", () => {
let schema = {
type: "range",
type: "noUiSlider",
label: "Rating",
model: "rating",
min: 1,
Expand Down

0 comments on commit b97c6bd

Please sign in to comment.