Skip to content

Commit b97c6bd

Browse files
author
Lionel Bijaoui
committed
update schema and fix a test
1 parent 5830e85 commit b97c6bd

File tree

2 files changed

+84
-46
lines changed

2 files changed

+84
-46
lines changed

dev/schema.js

+83-45
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ module.exports = {
136136
type: "input",
137137
inputType: "range",
138138
label: "Range",
139-
model: "range",
139+
model: "age",
140140
styleClasses: "half-width"
141141
},
142142
{
@@ -149,7 +149,7 @@ module.exports = {
149149
{
150150
type: "input",
151151
inputType: "checkbox",
152-
label: "Checkbox",
152+
label: "Checkbox (show useless)",
153153
model: "checkbox",
154154
styleClasses: "half-width"
155155
},
@@ -159,48 +159,55 @@ module.exports = {
159159
label: "Search USELESS",
160160
model: "search",
161161
placeholder: "Entrez un mot-clef",
162-
styleClasses: "half-width"
162+
styleClasses: "half-width",
163+
visible(model){return model.checkbox}
163164
},
164165
{
165166
type: "input",
166167
inputType: "radio",
167168
label: "radio USELESS",
168169
model: "radio",
169-
styleClasses: "half-width"
170+
styleClasses: "half-width",
171+
visible(model){return model.checkbox}
170172
},
171173
{
172174
type: "input",
173175
inputType: "file",
174176
label: "File USELESS",
175177
model: "file",
178+
visible(model){return model.checkbox}
176179
},
177180
{
178181
type: "input",
179182
inputType: "image",
180183
label: "Image USELESS",
181184
model: "image",
182-
styleClasses: "half-width"
185+
styleClasses: "half-width",
186+
visible(model){return model.checkbox}
183187
},
184188
{
185189
type: "input",
186190
inputType: "button",
187191
label: "Button USELESS",
188192
model: "button",
189-
styleClasses: "half-width"
193+
styleClasses: "half-width",
194+
visible(model){return model.checkbox}
190195
},
191196
{
192197
type: "input",
193198
inputType: "reset",
194199
label: "Reset USELESS",
195200
model: "reset",
196-
styleClasses: "half-width"
201+
styleClasses: "half-width",
202+
visible(model){return model.checkbox}
197203
},
198204
{
199205
type: "input",
200206
inputType: "submit",
201207
label: "Submit USELESS",
202208
model: "submit",
203-
styleClasses: "half-width"
209+
styleClasses: "half-width",
210+
visible(model){return model.checkbox}
204211
},
205212

206213
/**************/
@@ -354,23 +361,6 @@ module.exports = {
354361
model: "",
355362
styleClasses: "alert alert-info"
356363
},
357-
{
358-
type: "selectEx",
359-
label: "Country (selectEx field)",
360-
model: "address.country",
361-
multi: true,
362-
required: true,
363-
values: ["United Kingdom", "France", "Germany"],
364-
//default: "United Kingdom",
365-
multiSelect: false,
366-
selectOptions: {
367-
// https://silviomoreto.github.io/bootstrap-select/options/
368-
liveSearch: true,
369-
size: 10
370-
},
371-
styleClasses: ["half-width", "first"],
372-
validator: validators.required
373-
},
374364
{
375365
type: "spectrum",
376366
label: "Color (spectrum field)",
@@ -386,22 +376,26 @@ module.exports = {
386376
label: "Mobile (masked field)",
387377
model: "mobile",
388378
mask: "(99) 999-9999",
389-
styleClasses: "half-width",
379+
styleClasses: ["half-width", "first"],
390380
validator: validators.required
391-
},
381+
},
392382
{
393-
type: "rangeSlider",
394-
label: "Income",
395-
model: "income",
383+
type: "selectEx",
384+
label: "Country (selectEx field)",
385+
model: "address.country",
396386
multi: true,
397-
min: 0,
398-
max: 100000,
399-
rangeSliderOptions: {
400-
type: "double",
401-
prefix: "$",
402-
step: 1000
403-
}
404-
},
387+
required: true,
388+
values: ["United Kingdom", "France", "Germany"],
389+
//default: "United Kingdom",
390+
multiSelect: false,
391+
selectOptions: {
392+
// https://silviomoreto.github.io/bootstrap-select/options/
393+
liveSearch: true,
394+
size: 10
395+
},
396+
styleClasses: "half-width",
397+
validator: validators.required
398+
},
405399
{
406400
type: "selectEx",
407401
label: "Skills (selectEx field)",
@@ -435,14 +429,28 @@ module.exports = {
435429
label: "Rank (rangeSlider field)",
436430
model: "rank",
437431
multi: true,
438-
min: 1,
432+
min: 0,
439433
max: 10,
440434
required: true,
441-
sliderOptions: {
435+
rangeSliderOptions: {
442436
grid: true
443437
},
444-
// validator: validators.integer
438+
validator: validators.integer
445439
},
440+
// {
441+
// type: "rangeSlider",
442+
// label: "Income",
443+
// model: "income",
444+
// multi: true,
445+
// min: 0,
446+
// max: 100000,
447+
// rangeSliderOptions: {
448+
// type: "double",
449+
// prefix: "$",
450+
// step: 1000,
451+
// force_edges: true
452+
// }
453+
// },
446454
{
447455
type: "dateTimePicker",
448456
label: "DOB (dateTimePicker field)",
@@ -519,8 +527,8 @@ module.exports = {
519527
max: 10,
520528
required: true,
521529
disabled: false,
522-
sliderOptions: {
523-
// connect: "lower", // "lower", "upper", true, false
530+
noUiSliderOptions: {
531+
connect: "lower", // "lower", "upper", true, false
524532
// margin: 2 //number
525533
// limit: 2 //number
526534
step:1,
@@ -538,8 +546,38 @@ module.exports = {
538546
density: 10,
539547
stepped: true
540548
}
541-
},
542-
// validator: validators.integer
549+
}
550+
},
551+
{
552+
type: "noUiSlider",
553+
label: "Rank (noUiSlider field)",
554+
model: "income",
555+
multi: true,
556+
min: 0,
557+
max: 100000,
558+
required: true,
559+
disabled: false,
560+
noUiSliderOptions: {
561+
double:true,
562+
connect: true, // "lower", "upper", true, false
563+
// margin: 2 //number
564+
// limit: 2 //number
565+
step: 1000,
566+
// orientation:"vertical", //"vertical", "horizontal"
567+
// direction: "ltr", //"ltr", "rtl"
568+
tooltips: true, // false, true, formatter, array[formatter or false]
569+
animate: false,
570+
range:{
571+
'min': [ 0 ],
572+
'max': [ 100000 ]
573+
},
574+
pips: {
575+
mode: 'count',
576+
values: 6,
577+
density: 10,
578+
stepped: true
579+
}
580+
}
543581
},
544582
{
545583
type: "cleave",

test/unit/specs/fields/fieldNoUiSlider.spec.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ describe("fieldNoUiSlider.vue", function() {
1717

1818
describe("check template", () => {
1919
let schema = {
20-
type: "range",
20+
type: "noUiSlider",
2121
label: "Rating",
2222
model: "rating",
2323
min: 1,

0 commit comments

Comments
 (0)