Skip to content

Commit 1d8e545

Browse files
authored
Merge pull request #27 from dmblack/feature_input-type-password
Input Type: Password
2 parents a31deba + ee7b3c7 commit 1d8e545

12 files changed

Lines changed: 852 additions & 1 deletion

File tree

examples/basic/app.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import React, { Component } from 'react';
22
import ReactDOM from 'react-dom';
33
import Input from 'react-component_input';
44
import Button from './button';
5+
import Password from './password';
56
import Radio from './radio';
67
import TextExample from './text';
78
import Textarea from './textarea';
@@ -10,6 +11,7 @@ const appElement = document.getElementById('example');
1011

1112
const examples = [
1213
Button,
14+
Password,
1315
Radio,
1416
TextExample,
1517
Textarea

examples/basic/password/index.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import React, { Component } from 'react';
2+
import Input from 'react-component_input';
3+
4+
class Password extends Component {
5+
render() {
6+
return (
7+
<div>
8+
<Input
9+
identifier="passwordInput"
10+
labelContent="Password Input"
11+
type="password"
12+
/>
13+
</div>
14+
);
15+
}
16+
}
17+
18+
export default {
19+
label: "Input - Password",
20+
app: Password
21+
};

examples/bootstrapped/app.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import React, { Component } from 'react';
22
import ReactDOM from 'react-dom';
33
import Input from 'react-component_input';
44
import Button from './button';
5+
import Password from './password';
56
import Radio from './radio';
67
import TextExample from './text';
78
import Textarea from './textarea';
@@ -10,6 +11,7 @@ const appElement = document.getElementById('example');
1011

1112
const examples = [
1213
Button,
14+
Password,
1315
Radio,
1416
TextExample,
1517
Textarea
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import React, { Component } from 'react';
2+
import Input from 'react-component_input';
3+
4+
class Password extends Component {
5+
render() {
6+
return (
7+
<div>
8+
<Input
9+
identifier="passwordInput"
10+
labelContent="Password Input"
11+
type="password"
12+
inputClassNames="form-control"
13+
/>
14+
</div>
15+
);
16+
}
17+
}
18+
19+
export default {
20+
label: "Input - Password",
21+
app: Password
22+
};

examples/classnames/app.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import React, { Component } from 'react';
22
import ReactDOM from 'react-dom';
33
import Input from 'react-component_input';
44
import Button from './button';
5+
import Password from './password';
56
import Radio from './radio';
67
import TextExample from './text';
78
import Textarea from './textarea';
@@ -10,6 +11,7 @@ const appElement = document.getElementById('example');
1011

1112
const examples = [
1213
Button,
14+
Password,
1315
Radio,
1416
TextExample,
1517
Textarea
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import React, { Component } from 'react';
2+
import Input from 'react-component_input';
3+
4+
class Password extends Component {
5+
render() {
6+
return (
7+
<div>
8+
<Input
9+
identifier="passwordInput"
10+
labelContent="Password Input"
11+
type="password"
12+
containerClassNames={["button-custom-container", "my-button-custom-container"]}
13+
inputClassNames={["button-custom-input", "my-button-custom-input"]}
14+
labelClassNames={["button-custom-label", "my-button-custom-label"]}
15+
validationClassNames={["button-custom-validation", "my-button-custom-validation"]}
16+
/>
17+
</div>
18+
);
19+
}
20+
}
21+
22+
export default {
23+
label: "Input - Password",
24+
app: Password
25+
};

examples/validation/app.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
import React, { Component } from 'react';
22
import ReactDOM from 'react-dom';
33
import Input from 'react-component_input';
4+
import Password from './password';
45
import TextExample from './text';
56
import Textarea from './textarea';
67

78
const appElement = document.getElementById('example');
89

910
const examples = [
11+
Password,
1012
TextExample,
1113
Textarea
1214
];
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
import React, { Component } from 'react';
2+
import Input from 'react-component_input';
3+
4+
let validMaxLength = (length = 0) => ({
5+
errorMessage:
6+
'The length of your input must be less than ' + parseInt(length),
7+
callback: value => value.length <= parseInt(length)
8+
});
9+
10+
let validMinLength = (length = 0) => ({
11+
errorMessage:
12+
'The length of your input must be more than ' + parseInt(length),
13+
callback: value => value.length >= parseInt(length)
14+
});
15+
16+
class Password extends Component {
17+
render() {
18+
return (
19+
<div>
20+
<Input
21+
identifier="passwordInput"
22+
labelContent="Password Input"
23+
type="password"
24+
validation={[validMaxLength(15), validMinLength(8)]}
25+
/>
26+
</div>
27+
);
28+
}
29+
}
30+
31+
export default {
32+
label: "Input - Password",
33+
app: Password
34+
};

examples/validationcss/app.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@
99
}
1010

1111
/* Hides validation messages whilst the Input has cursor focus */
12-
.container-focus .validation-invalid {
12+
.validation-focus.validation-invalid {
1313
display: none;
1414
}

examples/validationcss/app.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
import React, { Component } from 'react';
22
import ReactDOM from 'react-dom';
33
import Input from 'react-component_input';
4+
import Password from './password';
45
import TextExample from './text';
56
import Textarea from './textarea';
67

78
const appElement = document.getElementById('example');
89

910
const examples = [
11+
Password,
1012
TextExample,
1113
Textarea
1214
];

0 commit comments

Comments
 (0)