@eturnity/eturnity_reusable_components 1.2.11 → 1.2.13
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
|
@@ -65,7 +65,7 @@ const ComponentWrapper = styled("div", wrapperProps)`
|
|
|
65
65
|
display: flex;
|
|
66
66
|
flex-direction: ${(props) =>
|
|
67
67
|
props.layout === "vertical" ? "column" : "row"};
|
|
68
|
-
grid-gap:
|
|
68
|
+
grid-gap: 10px 5px;
|
|
69
69
|
flex-wrap: wrap;
|
|
70
70
|
`
|
|
71
71
|
|
|
@@ -95,13 +95,18 @@ const containerProps = { size: String, isDisabled: Boolean }
|
|
|
95
95
|
const LabelContainer = styled("label", containerProps)`
|
|
96
96
|
display: grid;
|
|
97
97
|
grid-template-columns: auto 1fr auto;
|
|
98
|
-
grid-gap:
|
|
98
|
+
grid-gap: 15px;
|
|
99
99
|
align-items: center;
|
|
100
100
|
color: ${(props) =>
|
|
101
101
|
props.isDisabled ? props.theme.colors.disabled : props.theme.colors.black};
|
|
102
102
|
position: relative;
|
|
103
103
|
cursor: ${(props) => (props.isDisabled ? "not-allowed" : "pointer")};
|
|
104
|
-
font-size:
|
|
104
|
+
font-size: ${(props) =>
|
|
105
|
+
props.size === "large"
|
|
106
|
+
? "16px"
|
|
107
|
+
: props.size === "medium"
|
|
108
|
+
? "13px"
|
|
109
|
+
: "10px"};
|
|
105
110
|
user-select: none;
|
|
106
111
|
flex: auto;
|
|
107
112
|
align-self: baseline;
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
:hasLabel="label && label.length > 0"
|
|
6
6
|
>
|
|
7
7
|
<label-wrapper v-if="label">
|
|
8
|
-
<input-label>{{ label }}</input-label>
|
|
8
|
+
<input-label :fontSize="fontSize">{{ label }}</input-label>
|
|
9
9
|
<info-text
|
|
10
10
|
v-if="infoTextMessage"
|
|
11
11
|
:text="infoTextMessage"
|
|
@@ -45,12 +45,12 @@
|
|
|
45
45
|
// alignItems="horizontal" // horizontal, vertical
|
|
46
46
|
// :isDisabled="true"
|
|
47
47
|
// />
|
|
48
|
-
import styled from
|
|
49
|
-
import InfoText from
|
|
48
|
+
import styled from 'vue-styled-components'
|
|
49
|
+
import InfoText from '../../infoText'
|
|
50
50
|
|
|
51
51
|
const containerProps = { inputWidth: String }
|
|
52
|
-
const Container = styled(
|
|
53
|
-
width: ${(props) => (props.inputWidth ? props.inputWidth :
|
|
52
|
+
const Container = styled('div', containerProps)`
|
|
53
|
+
width: ${(props) => (props.inputWidth ? props.inputWidth : '100%')};
|
|
54
54
|
position: relative;
|
|
55
55
|
margin-bottom: 20px;
|
|
56
56
|
`
|
|
@@ -66,22 +66,22 @@ const inputProps = {
|
|
|
66
66
|
isError: Boolean,
|
|
67
67
|
disabled: Boolean,
|
|
68
68
|
fontSize: String,
|
|
69
|
-
inputWidth: String
|
|
69
|
+
inputWidth: String
|
|
70
70
|
}
|
|
71
|
-
const InputContainer = styled(
|
|
71
|
+
const InputContainer = styled('textarea', inputProps)`
|
|
72
72
|
border: ${(props) =>
|
|
73
73
|
props.isError
|
|
74
|
-
?
|
|
75
|
-
:
|
|
74
|
+
? '1px solid ' + props.theme.colors.red
|
|
75
|
+
: '1px solid ' + props.theme.colors.mediumGray};
|
|
76
76
|
padding: ${(props) =>
|
|
77
|
-
props.hasUnit ?
|
|
77
|
+
props.hasUnit ? '11px 40px 11px 10px' : '11px 5px 11px 10px'};
|
|
78
78
|
border-radius: 4px;
|
|
79
|
-
font-size: ${(props) => (props.fontSize ? props.fontSize :
|
|
79
|
+
font-size: ${(props) => (props.fontSize ? props.fontSize : '16px')};
|
|
80
80
|
color: ${(props) => props.theme.colors.black};
|
|
81
|
-
width: ${(props) => (props.inputWidth ? props.inputWidth :
|
|
81
|
+
width: ${(props) => (props.inputWidth ? props.inputWidth : '100%')};
|
|
82
82
|
max-width: 100%;
|
|
83
83
|
box-sizing: border-box; // to allow width of 100% with padding
|
|
84
|
-
cursor: ${(props) => (props.disabled ?
|
|
84
|
+
cursor: ${(props) => (props.disabled ? 'not-allowed' : 'inherit')};
|
|
85
85
|
|
|
86
86
|
&::placeholder {
|
|
87
87
|
color: ${(props) =>
|
|
@@ -94,17 +94,17 @@ const InputContainer = styled("textarea", inputProps)`
|
|
|
94
94
|
`
|
|
95
95
|
|
|
96
96
|
const inputAttrs = { alignItems: String, hasLabel: Boolean }
|
|
97
|
-
const InputWrapper = styled(
|
|
97
|
+
const InputWrapper = styled('div', inputAttrs)`
|
|
98
98
|
position: relative;
|
|
99
99
|
display: grid;
|
|
100
100
|
align-items: center;
|
|
101
101
|
gap: 8px;
|
|
102
102
|
grid-template-columns: ${(props) =>
|
|
103
103
|
!props.hasLabel
|
|
104
|
-
?
|
|
105
|
-
: props.alignItems ===
|
|
106
|
-
?
|
|
107
|
-
:
|
|
104
|
+
? '1fr'
|
|
105
|
+
: props.alignItems === 'vertical'
|
|
106
|
+
? '1fr'
|
|
107
|
+
: 'auto 1fr'};
|
|
108
108
|
`
|
|
109
109
|
|
|
110
110
|
const ErrorMessage = styled.div`
|
|
@@ -114,12 +114,14 @@ const ErrorMessage = styled.div`
|
|
|
114
114
|
top: calc(100% + 1px);
|
|
115
115
|
`
|
|
116
116
|
|
|
117
|
-
const
|
|
117
|
+
const labelAttrs = { fontSize: String }
|
|
118
|
+
const InputLabel = styled('div', labelAttrs)`
|
|
118
119
|
font-weight: bold;
|
|
120
|
+
font-size: ${(props) => (props.fontSize ? props.fontSize : '16px')};
|
|
119
121
|
`
|
|
120
122
|
|
|
121
123
|
export default {
|
|
122
|
-
name:
|
|
124
|
+
name: 'text-area-input',
|
|
123
125
|
components: {
|
|
124
126
|
Container,
|
|
125
127
|
InputContainer,
|
|
@@ -127,61 +129,61 @@ export default {
|
|
|
127
129
|
ErrorMessage,
|
|
128
130
|
InfoText,
|
|
129
131
|
LabelWrapper,
|
|
130
|
-
InputLabel
|
|
132
|
+
InputLabel
|
|
131
133
|
},
|
|
132
134
|
props: {
|
|
133
135
|
placeholder: {
|
|
134
136
|
required: false,
|
|
135
|
-
default:
|
|
137
|
+
default: ''
|
|
136
138
|
},
|
|
137
139
|
isError: {
|
|
138
140
|
required: false,
|
|
139
|
-
default: false
|
|
141
|
+
default: false
|
|
140
142
|
},
|
|
141
143
|
rowHeight: {
|
|
142
144
|
required: false,
|
|
143
|
-
default:
|
|
145
|
+
default: '2'
|
|
144
146
|
},
|
|
145
147
|
value: {
|
|
146
148
|
required: true,
|
|
147
|
-
default: null
|
|
149
|
+
default: null
|
|
148
150
|
},
|
|
149
151
|
errorText: {
|
|
150
|
-
required: false
|
|
152
|
+
required: false
|
|
151
153
|
},
|
|
152
154
|
isDisabled: {
|
|
153
155
|
required: false,
|
|
154
|
-
default: false
|
|
156
|
+
default: false
|
|
155
157
|
},
|
|
156
158
|
alignItems: {
|
|
157
159
|
required: false,
|
|
158
|
-
default:
|
|
160
|
+
default: 'horizontal'
|
|
159
161
|
},
|
|
160
162
|
infoTextMessage: {
|
|
161
|
-
required: false
|
|
163
|
+
required: false
|
|
162
164
|
},
|
|
163
165
|
infoTextAlign: {
|
|
164
|
-
required: false
|
|
166
|
+
required: false
|
|
165
167
|
},
|
|
166
168
|
label: {
|
|
167
|
-
required: false
|
|
169
|
+
required: false
|
|
168
170
|
},
|
|
169
171
|
fontSize: {
|
|
170
172
|
required: false,
|
|
171
|
-
default:
|
|
173
|
+
default: '16px'
|
|
172
174
|
},
|
|
173
175
|
inputWidth: {
|
|
174
176
|
required: false,
|
|
175
|
-
default: null
|
|
176
|
-
}
|
|
177
|
+
default: null
|
|
178
|
+
}
|
|
177
179
|
},
|
|
178
180
|
methods: {
|
|
179
181
|
onChangeHandler($event) {
|
|
180
182
|
if (this.isDisabled) {
|
|
181
183
|
return
|
|
182
184
|
}
|
|
183
|
-
this.$emit(
|
|
184
|
-
}
|
|
185
|
-
}
|
|
185
|
+
this.$emit('input-change', $event)
|
|
186
|
+
}
|
|
187
|
+
}
|
|
186
188
|
}
|
|
187
189
|
</script>
|