-
Notifications
You must be signed in to change notification settings - Fork 274
Expand file tree
/
Copy pathForms.js
More file actions
238 lines (215 loc) · 8.37 KB
/
Forms.js
File metadata and controls
238 lines (215 loc) · 8.37 KB
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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
import React, { PropTypes } from 'react';
import {
Panel,
Button,
Col,
PageHeader,
ControlLabel,
FormControl,
HelpBlock,
FormGroup,
Checkbox,
Form,
Radio,
InputGroup,
Glyphicon } from 'react-bootstrap';
import FormControlFeedback from 'react-bootstrap/lib/FormControlFeedback';
import FormControlStatic from 'react-bootstrap/lib/FormControlStatic';
import InputGroupAddon from 'react-bootstrap/lib/InputGroupAddon';
const title = 'Forms';
function displayForms(props, context) {
context.setTitle(title);
return (
<div>
<div className="row">
<div className="col-lg-12">
<PageHeader>Forms</PageHeader>
</div>
</div>
<div className="row">
<div className="col-lg-12">
<Panel header={<span>Basic Form Elements</span>} >
<div className="row">
<div className="col-lg-6">
<Form>
<FormGroup
controlId="formBasicText"
>
<ControlLabel>Text Input</ControlLabel>
<FormControl
type="text"
/>
<FormControlFeedback />
<HelpBlock>Example block-level help text here.</HelpBlock>
</FormGroup>
<FormGroup controlId="formBasicText2">
<ControlLabel>Text Input</ControlLabel>
<FormControl
type="text"
placeholder="Enter Text"
/>
<FormControlFeedback />
</FormGroup>
<FormGroup>
<ControlLabel>Static text</ControlLabel>
<FormControlStatic>
email@example.com
</FormControlStatic>
</FormGroup>
<FormGroup
controlId="formBasicFile"
>
<ControlLabel>File Input</ControlLabel>
<FormControl
type="file"
/>
<FormControlFeedback />
</FormGroup>
<FormGroup controlId="formControlsTextarea">
<ControlLabel>Textarea</ControlLabel>
<FormControl componentClass="textarea" placeholder="textarea" />
</FormGroup>
<FormGroup controlId="formControlsCheckbox">
<ControlLabel>CheckBox</ControlLabel>
<Checkbox>Checkbox #1 </Checkbox>
<Checkbox> Checkbox #2 </Checkbox>
<Checkbox> Checkbox #3 </Checkbox>
</FormGroup>
<FormGroup>
<ControlLabel>Inline CheckBox</ControlLabel>
<Col>
<Checkbox inline>
1
</Checkbox>
{' '}
<Checkbox inline>
2
</Checkbox>
{' '}
<Checkbox inline>
3
</Checkbox>
</Col>
</FormGroup>
<FormGroup>
<ControlLabel>Inline Radio</ControlLabel>
<Col>
<Radio inline>
1
</Radio>
{' '}
<Radio inline>
2
</Radio>
{' '}
<Radio inline>
3
</Radio>
</Col>
</FormGroup>
<FormGroup controlId="formControlsSelect">
<ControlLabel>Select</ControlLabel>
<FormControl componentClass="select" placeholder="select">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
</FormControl>
</FormGroup>
<FormGroup controlId="formControlsSelectMultiple">
<ControlLabel>Multiple select</ControlLabel>
<FormControl componentClass="select" multiple>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
</FormControl>
</FormGroup>
<FormGroup>
<Button type="submit">Submit Button</Button>
{' '}
<Button type="reset">Reset Button</Button>
</FormGroup>
</Form>
</div>
<div className="col-lg-6">
<h1>Disabled Form States</h1>
<Form>
<FormGroup controlId="formControlDisableState" >
<ControlLabel> Disabled Input </ControlLabel>
<FormControl type="text" placeholder="Disabled Input" disabled />
</FormGroup>
<FormGroup controlId="formControlsDisableSelect">
<ControlLabel>Disabled Select</ControlLabel>
<FormControl componentClass="select" placeholder="select" disabled>
<option value="1">1</option>
<option value="2">2</option>
</FormControl>
</FormGroup>
<FormGroup controlId="formControlsDisabledCheckbox">
<Checkbox disabled>Disabled CheckBox</Checkbox>
</FormGroup>
<FormGroup controlId="formControlsDisabledButton">
<Button bsStyle="primary" type="submit" disabled>Disabled Button </Button>
</FormGroup>
</Form>
<h1>Form Validation States</h1>
<Form>
<FormGroup controlId="formValidationSuccess2" validationState="success">
<ControlLabel>Input with success</ControlLabel>
<FormControl type="text" />
<FormControlFeedback />
</FormGroup>
<FormGroup controlId="formValidationWarning1" validationState="warning">
<ControlLabel>Input with warning</ControlLabel>
<FormControl type="text" />
<FormControlFeedback />
</FormGroup>
<FormGroup controlId="formValidationWarning1" validationState="error">
<ControlLabel>Input with Error</ControlLabel>
<FormControl type="text" />
<FormControlFeedback />
</FormGroup>
</Form>
<h1>Input Groups</h1>
<Form>
<FormGroup>
<InputGroup>
<InputGroupAddon>@</InputGroupAddon>
<FormControl type="text" />
</InputGroup>
</FormGroup>
<FormGroup>
<InputGroup>
<FormControl type="text" />
<InputGroupAddon>.00</InputGroupAddon>
</InputGroup>
</FormGroup>
<FormGroup>
<InputGroup>
<InputGroupAddon>$</InputGroupAddon>
<FormControl type="text" />
<InputGroupAddon>.00</InputGroupAddon>
</InputGroup>
</FormGroup>
<FormGroup>
<InputGroup>
<FormControl type="text" />
<InputGroupAddon>
<Glyphicon glyph="music" />
</InputGroupAddon>
</InputGroup>
</FormGroup>
</Form>
</div>
</div>
</Panel>
</div>
</div>
</div>
);
}
displayForms.contextTypes = { setTitle: PropTypes.func.isRequired };
export default displayForms;