-
Notifications
You must be signed in to change notification settings - Fork 68
/
Copy pathconfig.js
125 lines (125 loc) · 2.76 KB
/
config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
export default {
fields: [
{
type: 'text',
name: 'user_name',
icon: 'ios-person',
iconOrientation: 'right',
required: true,
label: 'Username',
editable: true,
props: {}, /* If you want to add some extra props like autoCapitalize or
autoFocus only available for textInput*/
},
{
type: 'password',
name: 'password',
icon: 'ios-lock',
required: true,
label: 'Password',
props: {
secureTextEntry: true,
},
},
{
type: 'date',
mode: 'date', // 'time', 'datetime'
name: 'birthday',
label: 'Birthday',
maxDate: new Date(2010, 7, 1),
},
{
type: 'group',
name: 'work_address',
label: 'Address',
fields: [
{
type: 'text',
name: 'city',
label: 'City',
// defaultValue: 'Bangalore',
},
{
type: 'text',
name: 'country',
label: 'Country',
// defaultValue: 'India',
},
],
},
{
type: 'select', // required
name: 'select', // required
multiple: true, // default false
required: true, // default false
label: 'Select', // required
labelKey: 'name', // tells the display key (required)
primaryKey: 'id', // tells the unique key (required)
objectType: true, // tells the type of values is object default false
options: [ // required
{
id: 1,
name: 'CAR',
},
{
id: 2,
name: 'BIKE',
},
{
id: 3,
name: 'BICYCLE',
},
],
// options: ['CAR', 'BIKE', 'BICYCLE'],
defaultValue: [{ // In case of multiple it will be an array otherwise it will be an object
id: 3,
name: 'BICYCLE',
}],
// defaultValue: ['CAR', 'BIKE'],
},
{
type: 'select', // required
name: 'status', // required
label: 'Status', // required
options: ['In Meeting', 'Busy', 'Happy', 'Sad'],
defaultValue: ['Happy'],
},
{
type: 'switch',
name: 'switch',
label: 'Notify Me',
defaultValue: true,
},
{
type: 'text',
name: 'description',
label: 'Describe Yourself',
required: true,
props: {
multiline: true,
numberOfLines: 3,
},
},
{
type: 'email',
name: 'email',
required: true,
label: 'Email',
// defaultValue: '[email protected]',
},
{
type: 'number',
name: 'number',
required: true,
label: 'Age',
// defaultValue: 18,
},
{
type: 'url',
name: 'url',
required: true,
label: 'URL',
// defaultValue: 'www.github.com',
},
],
};