@@ -4,6 +4,17 @@ import {
4
4
validators
5
5
} from "../../src" ;
6
6
7
+ let customAsyncValidator = function ( value ) {
8
+ return new Promise ( ( resolve , reject ) => {
9
+ setTimeout ( ( ) => {
10
+ if ( value )
11
+ resolve ( ) ;
12
+ else
13
+ resolve ( [ "Invalid value from async validator" ] ) ;
14
+ } , 1000 ) ;
15
+ } ) ;
16
+ } ;
17
+
7
18
module . exports = {
8
19
fields : [
9
20
@@ -56,7 +67,7 @@ module.exports = {
56
67
model : "website" ,
57
68
placeholder : "Enter your website" ,
58
69
inputName : "website" ,
59
- validator : validators . url
70
+ validator : customAsyncValidator // validators.url
60
71
} , {
61
72
type : "input" ,
62
73
inputType : "tel" ,
@@ -120,8 +131,8 @@ module.exports = {
120
131
inputType : "number" ,
121
132
label : "Number" ,
122
133
model : "age" ,
123
- styleClasses : "half-width" ,
124
- validator : validators . number
134
+ styleClasses : "half-width"
135
+ // validator: validators.number
125
136
} , {
126
137
type : "input" ,
127
138
inputType : "range" ,
@@ -312,7 +323,8 @@ module.exports = {
312
323
rows : 4 ,
313
324
validator : validators . string
314
325
} , {
315
- type : "text" ,
326
+ type : "input" ,
327
+ inputType : "text" ,
316
328
label : "Field with buttons" ,
317
329
model : "address.geo" ,
318
330
disabled : false ,
0 commit comments