@eturnity/eturnity_reusable_components 1.0.92 → 1.0.93
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -17,6 +17,9 @@
|
|
|
17
17
|
:inputWidth="inputWidth"
|
|
18
18
|
:value="value"
|
|
19
19
|
@input="onChangeHandler"
|
|
20
|
+
:noBorder="noBorder"
|
|
21
|
+
:disabled="disabled"
|
|
22
|
+
:isDisabled="disabled"
|
|
20
23
|
/>
|
|
21
24
|
</input-wrapper>
|
|
22
25
|
<error-message v-if="isError">{{ errorMessage }}</error-message>
|
|
@@ -44,11 +47,20 @@ const LabelWrapper = styled.div`
|
|
|
44
47
|
margin-bottom: 12px;
|
|
45
48
|
`
|
|
46
49
|
|
|
47
|
-
const inputProps = {
|
|
50
|
+
const inputProps = {
|
|
51
|
+
isError: Boolean,
|
|
52
|
+
inputWidth: String,
|
|
53
|
+
noBorder: Boolean,
|
|
54
|
+
isDisabled: Boolean,
|
|
55
|
+
}
|
|
48
56
|
const InputContainer = styled("input", inputProps)`
|
|
49
57
|
border: ${(props) =>
|
|
50
58
|
props.isError
|
|
51
59
|
? "1px solid " + props.theme.colors.red
|
|
60
|
+
: props.noBorder
|
|
61
|
+
? "none"
|
|
62
|
+
: props.hasLength
|
|
63
|
+
? "1px solid " + props.theme.colors.black
|
|
52
64
|
: "1px solid " + props.theme.colors.mediumGray};
|
|
53
65
|
padding: ${(props) =>
|
|
54
66
|
props.hasUnit ? "11px 40px 11px 10px" : "11px 5px 11px 10px"};
|
|
@@ -59,6 +71,9 @@ const InputContainer = styled("input", inputProps)`
|
|
|
59
71
|
width: 100%;
|
|
60
72
|
box-sizing: border-box; // to allow width of 100% with padding
|
|
61
73
|
font-weight: 500;
|
|
74
|
+
cursor: ${(props) => (props.isDisabled ? "not-allowed" : "auto")};
|
|
75
|
+
background-color: ${(props) =>
|
|
76
|
+
props.isDisabled ? props.theme.colors.grey5 : "#fff"};
|
|
62
77
|
|
|
63
78
|
&::placeholder {
|
|
64
79
|
color: ${(props) =>
|
|
@@ -84,16 +99,16 @@ const ErrorMessage = styled.div`
|
|
|
84
99
|
export default {
|
|
85
100
|
// import InputText from "@eturnity/eturnity_reusable_components/src/components/inputs/inputText"
|
|
86
101
|
// To use:
|
|
87
|
-
//
|
|
88
|
-
//
|
|
89
|
-
//
|
|
90
|
-
//
|
|
91
|
-
//
|
|
92
|
-
//
|
|
93
|
-
//
|
|
94
|
-
//
|
|
95
|
-
//
|
|
96
|
-
//
|
|
102
|
+
// <input-text
|
|
103
|
+
// placeholder="Company name"
|
|
104
|
+
// :value="companyName"
|
|
105
|
+
// @input-change="onInputChange({ value: $event, type: 'companyName' })"
|
|
106
|
+
// :isError="checkErrors()"
|
|
107
|
+
// :errorMessage="This is my error message"
|
|
108
|
+
// infoTextAlign="right" // left by default
|
|
109
|
+
// infoTextMessage="My info message"
|
|
110
|
+
// label="Question 5"
|
|
111
|
+
// />
|
|
97
112
|
name: "input-text",
|
|
98
113
|
components: {
|
|
99
114
|
Container,
|
|
@@ -134,6 +149,14 @@ export default {
|
|
|
134
149
|
label: {
|
|
135
150
|
required: false,
|
|
136
151
|
},
|
|
152
|
+
noBorder: {
|
|
153
|
+
required: false,
|
|
154
|
+
default: false,
|
|
155
|
+
},
|
|
156
|
+
disabled: {
|
|
157
|
+
required: false,
|
|
158
|
+
default: false,
|
|
159
|
+
},
|
|
137
160
|
},
|
|
138
161
|
methods: {
|
|
139
162
|
onChangeHandler($event) {
|