@eturnity/eturnity_reusable_components 1.2.31-3d-master.1 → 1.2.31-3d-master.2
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 +1 -1
- package/src/App.vue +12 -34
- package/src/assets/theme.js +3 -1
- package/src/components/errorMessage/index.vue +4 -4
- package/src/components/infoText/index.vue +41 -32
- package/src/components/inputs/inputNumber/index.vue +27 -16
- package/src/components/inputs/inputText/index.vue +52 -49
- package/src/components/inputs/searchInput/index.vue +16 -15
- package/src/components/inputs/textAreaInput/index.vue +8 -14
package/package.json
CHANGED
package/src/App.vue
CHANGED
|
@@ -115,13 +115,14 @@
|
|
|
115
115
|
<br /> -->
|
|
116
116
|
<!-- <iconCollection /> -->
|
|
117
117
|
<input-text
|
|
118
|
-
placeholder="
|
|
118
|
+
placeholder="Company name"
|
|
119
119
|
:value="inputValue"
|
|
120
120
|
@input-change="onInputChange($event)"
|
|
121
121
|
@input-blur="onInputBlur($event)"
|
|
122
122
|
type="password"
|
|
123
123
|
/>
|
|
124
124
|
<br />
|
|
125
|
+
<<<<<<< HEAD
|
|
125
126
|
<!-- <page-subtitle text="My Subtitle" infoText="My info Text" />
|
|
126
127
|
<spinner size="30px" />
|
|
127
128
|
<checkbox
|
|
@@ -131,6 +132,16 @@
|
|
|
131
132
|
:isDisabled="false"
|
|
132
133
|
/> -->
|
|
133
134
|
<!-- <external-button text="Click me!" minWidth="500px" /> -->
|
|
135
|
+
>>>>>>> master
|
|
136
|
+
=======
|
|
137
|
+
<input-number
|
|
138
|
+
:value="num"
|
|
139
|
+
@input-change="num = $event"
|
|
140
|
+
unitName="t"
|
|
141
|
+
id="biebie"
|
|
142
|
+
test="koko"
|
|
143
|
+
@keydown="keydownHandler"
|
|
144
|
+
/>
|
|
134
145
|
>>>>>>> master
|
|
135
146
|
</page-container>
|
|
136
147
|
</ThemeProvider>
|
|
@@ -150,11 +161,6 @@ import Spinner from "@/components/spinner"
|
|
|
150
161
|
import ExternalButton from "@/components/buttons/externalButton"
|
|
151
162
|
import InputText from "@/components/inputs/inputText"
|
|
152
163
|
// import TableDropdown from "@/components/tableDropdown"
|
|
153
|
-
const InputAnnexContainer = styled.div`
|
|
154
|
-
display: grid;
|
|
155
|
-
grid-template-columns: auto auto;
|
|
156
|
-
grid-gap: 10px;
|
|
157
|
-
`
|
|
158
164
|
|
|
159
165
|
const PageContainer = styled.div`
|
|
160
166
|
padding: 40px;
|
|
@@ -183,35 +189,7 @@ export default {
|
|
|
183
189
|
iconCollection,
|
|
184
190
|
RowContainer
|
|
185
191
|
},
|
|
186
|
-
data() {
|
|
187
|
-
return {
|
|
188
|
-
num: 42,
|
|
189
|
-
inputValue: null,
|
|
190
|
-
checkedOption: 'button_1',
|
|
191
|
-
question: {
|
|
192
|
-
number_format_precision: 4,
|
|
193
|
-
number_min_allowed: 0,
|
|
194
|
-
number_max_allowed: 10,
|
|
195
|
-
unit_short_name: 'cm'
|
|
196
|
-
},
|
|
197
|
-
dropdownOpen: false,
|
|
198
|
-
isChecked: false,
|
|
199
|
-
listOptions: [
|
|
200
|
-
{
|
|
201
|
-
name: 'Option 1',
|
|
202
|
-
value: 'option_1',
|
|
203
|
-
disabled: true
|
|
204
|
-
},
|
|
205
|
-
{
|
|
206
|
-
name: 'Option 2',
|
|
207
|
-
value: 'option_2'
|
|
208
|
-
},
|
|
209
|
-
{
|
|
210
|
-
name: 'Option 3',
|
|
211
|
-
value: 'option_3'
|
|
212
|
-
},
|
|
213
192
|
{
|
|
214
|
-
name: 'Option 4',
|
|
215
193
|
value: 'option_4'
|
|
216
194
|
}
|
|
217
195
|
],
|
package/src/assets/theme.js
CHANGED
|
@@ -18,10 +18,12 @@ const theme = {
|
|
|
18
18
|
grey3: '#b2b9c5',
|
|
19
19
|
grey4: '#dee2eb',
|
|
20
20
|
grey5: '#fafafa',
|
|
21
|
+
grey6: '#555d61',
|
|
21
22
|
green: '#99db0c',
|
|
22
23
|
transparentWhite1:'#ffffff32',
|
|
23
24
|
transparentBlack1:'#263238e6',
|
|
24
|
-
disabled: '#dfe1e1'
|
|
25
|
+
disabled: '#dfe1e1',
|
|
26
|
+
eturnityGrey: '#263238'
|
|
25
27
|
},
|
|
26
28
|
screen: {
|
|
27
29
|
mobileSmall: '345px',
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
</template>
|
|
8
8
|
|
|
9
9
|
<script>
|
|
10
|
-
// import
|
|
10
|
+
// import ErrorMessage from "@eturnity/eturnity_reusable_components/src/components/errorMessage"
|
|
11
11
|
//To use:
|
|
12
12
|
// <error-message
|
|
13
13
|
// alignText="right" // default is left
|
|
@@ -22,12 +22,12 @@ const TextOverlay = styled.div`
|
|
|
22
22
|
padding: 10px;
|
|
23
23
|
width: max-content;
|
|
24
24
|
max-width: 100%;
|
|
25
|
-
min-width:
|
|
25
|
+
min-width: min-content;
|
|
26
26
|
font-size: 11px;
|
|
27
27
|
font-weight: 400;
|
|
28
28
|
border-radius: 4px;
|
|
29
29
|
font-family: 'Lato-Bold', Arial;
|
|
30
|
-
z-index:
|
|
30
|
+
z-index: 999;
|
|
31
31
|
color: ${(props) => props.theme.colors.white};
|
|
32
32
|
|
|
33
33
|
:before {
|
|
@@ -59,4 +59,4 @@ export default {
|
|
|
59
59
|
return {}
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
|
-
</script>
|
|
62
|
+
</script>
|
|
@@ -14,13 +14,12 @@
|
|
|
14
14
|
<text-overlay
|
|
15
15
|
v-if="showInfo"
|
|
16
16
|
:borderColor="borderColor"
|
|
17
|
-
:alignText="alignText"
|
|
18
17
|
:width="width"
|
|
19
18
|
:halfComputedTextInfoWidth="halfComputedTextInfoWidth"
|
|
20
19
|
:alignArrow="alignArrow"
|
|
21
20
|
:iconSize="size"
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
><slot />
|
|
22
|
+
<span v-html="text"></span>
|
|
24
23
|
</text-overlay>
|
|
25
24
|
</icon-wrapper>
|
|
26
25
|
</component-wrapper>
|
|
@@ -33,25 +32,32 @@
|
|
|
33
32
|
// text="Veritatis et quasi architecto beatae vitae"
|
|
34
33
|
// borderColor="#ccc"
|
|
35
34
|
// size="20"
|
|
36
|
-
//
|
|
35
|
+
// alignArrow="right" // which side the arrow should be on
|
|
37
36
|
// />
|
|
38
37
|
import theme from '../../assets/theme.js'
|
|
39
38
|
import styled from 'vue-styled-components'
|
|
40
39
|
import icon from '../icon'
|
|
41
40
|
|
|
42
|
-
const textAttrs = {
|
|
41
|
+
const textAttrs = {
|
|
42
|
+
iconSize: String,
|
|
43
|
+
borderColor: String,
|
|
44
|
+
alignArrow: String,
|
|
45
|
+
width: String,
|
|
46
|
+
halfComputedTextInfoWidth: Number
|
|
47
|
+
}
|
|
43
48
|
const TextOverlay = styled('div', textAttrs)`
|
|
44
49
|
position: absolute;
|
|
45
|
-
top: ${(props) => 'calc('+props.iconSize+' + 15px)'};
|
|
46
|
-
${(props) =>
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
50
|
+
top: ${(props) => 'calc(' + props.iconSize + ' + 15px)'};
|
|
51
|
+
${(props) =>
|
|
52
|
+
props.alignArrow === 'left'
|
|
53
|
+
? 'left: calc(' + props.iconSize + ' /2 - 18px)'
|
|
54
|
+
: props.alignArrow === 'center'
|
|
55
|
+
? 'left: calc((-' + props.width + ' + ' + props.iconSize + ') /2 + 2px)'
|
|
56
|
+
: 'right: calc(' + props.iconSize + ' /2 - 17px)'};
|
|
57
|
+
text-align: 'left';
|
|
52
58
|
background: ${(props) => props.theme.colors.black};
|
|
53
59
|
padding: 10px;
|
|
54
|
-
width: ${(props) => props.width
|
|
60
|
+
width: ${(props) => props.width};
|
|
55
61
|
max-width: 400px;
|
|
56
62
|
font-size: 13px;
|
|
57
63
|
font-weight: 400;
|
|
@@ -64,14 +70,21 @@ const TextOverlay = styled('div', textAttrs)`
|
|
|
64
70
|
background-color: ${(props) => props.theme.colors.black};
|
|
65
71
|
position: absolute;
|
|
66
72
|
top: 2px;
|
|
67
|
-
${(props) =>
|
|
68
|
-
|
|
69
|
-
|
|
73
|
+
${(props) =>
|
|
74
|
+
props.alignArrow === 'left'
|
|
75
|
+
? 'left:40px;'
|
|
76
|
+
: props.alignArrow == 'center'
|
|
77
|
+
? 'left: calc(50% + 19px);'
|
|
78
|
+
: 'right:-13px;'};
|
|
70
79
|
height: 8px;
|
|
71
80
|
width: 8px;
|
|
72
81
|
transform-origin: center center;
|
|
73
82
|
transform: translate(-2em, -0.5em) rotate(45deg);
|
|
74
83
|
}
|
|
84
|
+
|
|
85
|
+
span a {
|
|
86
|
+
color: #2cc0eb;
|
|
87
|
+
}
|
|
75
88
|
`
|
|
76
89
|
|
|
77
90
|
const iconAttrs = { isActive: Boolean, size: String, borderColor: String }
|
|
@@ -101,7 +114,7 @@ export default {
|
|
|
101
114
|
},
|
|
102
115
|
props: {
|
|
103
116
|
text: {
|
|
104
|
-
required: false
|
|
117
|
+
required: false
|
|
105
118
|
},
|
|
106
119
|
borderColor: {
|
|
107
120
|
required: false,
|
|
@@ -111,21 +124,17 @@ export default {
|
|
|
111
124
|
required: false,
|
|
112
125
|
default: '14px'
|
|
113
126
|
},
|
|
114
|
-
|
|
127
|
+
alignArrow: {
|
|
115
128
|
required: false,
|
|
116
|
-
default: '
|
|
129
|
+
default: 'center'
|
|
117
130
|
},
|
|
118
|
-
|
|
119
|
-
required:false,
|
|
120
|
-
default:'
|
|
121
|
-
},
|
|
122
|
-
openTrigger:{
|
|
123
|
-
required:false,
|
|
124
|
-
default: 'onClick'
|
|
131
|
+
openTrigger: {
|
|
132
|
+
required: false,
|
|
133
|
+
default: 'onHover' // onHover, onClick
|
|
125
134
|
},
|
|
126
|
-
width:{
|
|
127
|
-
required:false,
|
|
128
|
-
default:'165px'
|
|
135
|
+
width: {
|
|
136
|
+
required: false,
|
|
137
|
+
default: '165px'
|
|
129
138
|
}
|
|
130
139
|
},
|
|
131
140
|
methods: {
|
|
@@ -147,7 +156,7 @@ export default {
|
|
|
147
156
|
},
|
|
148
157
|
data() {
|
|
149
158
|
return {
|
|
150
|
-
showInfo: false
|
|
159
|
+
showInfo: false
|
|
151
160
|
}
|
|
152
161
|
},
|
|
153
162
|
computed: {
|
|
@@ -159,8 +168,8 @@ export default {
|
|
|
159
168
|
: theme.colors.mediumGray
|
|
160
169
|
},
|
|
161
170
|
halfComputedTextInfoWidth() {
|
|
162
|
-
return parseInt(this.width)/2
|
|
171
|
+
return parseInt(this.width) / 2
|
|
163
172
|
}
|
|
164
173
|
}
|
|
165
174
|
}
|
|
166
|
-
</script>
|
|
175
|
+
</script>
|
|
@@ -131,7 +131,7 @@ const InputContainer = styled('input', inputProps)`
|
|
|
131
131
|
? '1px solid ' + props.theme.colors.red
|
|
132
132
|
: props.noBorder
|
|
133
133
|
? 'none'
|
|
134
|
-
: '1px solid ' + props.theme.colors.
|
|
134
|
+
: '1px solid ' + props.theme.colors.grey4};
|
|
135
135
|
padding-top: 11px;
|
|
136
136
|
padding-bottom: 11px;
|
|
137
137
|
padding-left: 10px;
|
|
@@ -145,7 +145,9 @@ const InputContainer = styled('input', inputProps)`
|
|
|
145
145
|
font-size: ${(props) => (props.fontSize ? props.fontSize : '13px')};
|
|
146
146
|
color: ${(props) =>
|
|
147
147
|
props.isError
|
|
148
|
-
? props.theme.colors.
|
|
148
|
+
? props.theme.colors.grey6
|
|
149
|
+
: props.isDisabled
|
|
150
|
+
? props.theme.colors.grey2
|
|
149
151
|
: props.fontColor
|
|
150
152
|
? props.fontColor + ' !important'
|
|
151
153
|
: props.theme.colors.black};
|
|
@@ -157,10 +159,9 @@ const InputContainer = styled('input', inputProps)`
|
|
|
157
159
|
background-color: ${(props) =>
|
|
158
160
|
props.isDisabled ? props.theme.colors.grey5 : '#fff'};
|
|
159
161
|
box-sizing: border-box;
|
|
160
|
-
max-height: ${(props) =>
|
|
162
|
+
max-height: ${(props) => props.inputHeight};
|
|
161
163
|
&::placeholder {
|
|
162
|
-
color: ${(props) =>
|
|
163
|
-
props.isError ? props.theme.colors.red : props.theme.colors.darkGray};
|
|
164
|
+
color: ${(props) => props.theme.colors.grey2};
|
|
164
165
|
}
|
|
165
166
|
|
|
166
167
|
&:focus {
|
|
@@ -239,8 +240,9 @@ const LabelSlotWrapper = styled('div',inputProps)`
|
|
|
239
240
|
`
|
|
240
241
|
|
|
241
242
|
const LabelText = styled.div`
|
|
242
|
-
font-weight: bold;
|
|
243
243
|
font-size: 13px;
|
|
244
|
+
color: ${(props) => props.theme.colors.eturnityGrey};
|
|
245
|
+
font-weight: 700;
|
|
244
246
|
`
|
|
245
247
|
|
|
246
248
|
export default {
|
|
@@ -263,7 +265,7 @@ export default {
|
|
|
263
265
|
return {
|
|
264
266
|
textInput: '',
|
|
265
267
|
isFocused: false,
|
|
266
|
-
warningIcon: warningIcon
|
|
268
|
+
warningIcon: warningIcon
|
|
267
269
|
}
|
|
268
270
|
},
|
|
269
271
|
props: {
|
|
@@ -283,9 +285,9 @@ export default {
|
|
|
283
285
|
required: false,
|
|
284
286
|
default: null
|
|
285
287
|
},
|
|
286
|
-
inputHeight:{
|
|
287
|
-
required:false,
|
|
288
|
-
default:null
|
|
288
|
+
inputHeight: {
|
|
289
|
+
required: false,
|
|
290
|
+
default: null
|
|
289
291
|
},
|
|
290
292
|
value: {
|
|
291
293
|
required: true,
|
|
@@ -377,6 +379,10 @@ export default {
|
|
|
377
379
|
type: String,
|
|
378
380
|
default: ''
|
|
379
381
|
},
|
|
382
|
+
allowNegative: {
|
|
383
|
+
required: false,
|
|
384
|
+
default: true
|
|
385
|
+
},
|
|
380
386
|
inputIconImageClass: {
|
|
381
387
|
require: false,
|
|
382
388
|
type: Array,
|
|
@@ -403,9 +409,14 @@ export default {
|
|
|
403
409
|
},
|
|
404
410
|
methods: {
|
|
405
411
|
onChangeHandler(event) {
|
|
406
|
-
if (isNaN(event) || event==
|
|
412
|
+
if (isNaN(event) || event == '') {
|
|
407
413
|
event = this.minNumber || this.minNumber === 0 ? this.minNumber : event
|
|
408
414
|
}
|
|
415
|
+
if (!this.allowNegative) {
|
|
416
|
+
event = Math.abs(event)
|
|
417
|
+
}
|
|
418
|
+
event = parseFloat(event)
|
|
419
|
+
// Need to return an integer rather than a string
|
|
409
420
|
this.$emit('input-change', event)
|
|
410
421
|
},
|
|
411
422
|
onEvaluateCode(val) {
|
|
@@ -438,8 +449,8 @@ export default {
|
|
|
438
449
|
value: evaluated,
|
|
439
450
|
numberPrecision: this.numberPrecision
|
|
440
451
|
})
|
|
441
|
-
}else if(typeof evaluated === 'number'){
|
|
442
|
-
evaluated=evaluated.toFixed(this.numberPrecision)
|
|
452
|
+
} else if (typeof evaluated === 'number') {
|
|
453
|
+
evaluated = evaluated.toFixed(this.numberPrecision)
|
|
443
454
|
}
|
|
444
455
|
return evaluated
|
|
445
456
|
},
|
|
@@ -460,11 +471,11 @@ export default {
|
|
|
460
471
|
})
|
|
461
472
|
}
|
|
462
473
|
let adjustedMinValue =
|
|
463
|
-
|
|
474
|
+
evaluatedInput && evaluatedInput.length
|
|
464
475
|
? evaluatedInput
|
|
465
476
|
: this.minNumber || this.minNumber === 0
|
|
466
477
|
? this.minNumber
|
|
467
|
-
: ''
|
|
478
|
+
: ''
|
|
468
479
|
this.$emit('input-blur', adjustedMinValue)
|
|
469
480
|
},
|
|
470
481
|
focusInput() {
|
|
@@ -552,4 +563,4 @@ export default {
|
|
|
552
563
|
}
|
|
553
564
|
}
|
|
554
565
|
}
|
|
555
|
-
</script>
|
|
566
|
+
</script>
|
|
@@ -14,33 +14,38 @@
|
|
|
14
14
|
:alignText="infoTextAlign"
|
|
15
15
|
/>
|
|
16
16
|
</label-wrapper>
|
|
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
|
-
<icon
|
|
42
|
-
|
|
43
|
-
|
|
17
|
+
<input-error-wrapper>
|
|
18
|
+
<icon-container>
|
|
19
|
+
<input-container
|
|
20
|
+
:placeholder="placeholder"
|
|
21
|
+
:isError="isError"
|
|
22
|
+
:inputWidth="inputWidth"
|
|
23
|
+
:minWidth="minWidth"
|
|
24
|
+
:value="value"
|
|
25
|
+
@input="onChangeHandler"
|
|
26
|
+
@blur="onInputBlur"
|
|
27
|
+
:noBorder="noBorder"
|
|
28
|
+
:disabled="disabled"
|
|
29
|
+
:isDisabled="disabled"
|
|
30
|
+
:fontSize="fontSize"
|
|
31
|
+
:inputType="inputType"
|
|
32
|
+
:type="inputTypeData"
|
|
33
|
+
/>
|
|
34
|
+
<icon-wrapper
|
|
35
|
+
v-if="inputType === 'password' && !isError"
|
|
36
|
+
@click="toggleShowPassword()"
|
|
37
|
+
size="20px"
|
|
38
|
+
>
|
|
39
|
+
<icon name="current_variant" size="20px" />
|
|
40
|
+
</icon-wrapper>
|
|
41
|
+
<icon-wrapper v-if="isError" size="16px">
|
|
42
|
+
<icon name="warning" size="16px" cursor="default" />
|
|
43
|
+
</icon-wrapper>
|
|
44
|
+
</icon-container>
|
|
45
|
+
<error-message v-if="isError && errorMessage">{{
|
|
46
|
+
errorMessage
|
|
47
|
+
}}</error-message>
|
|
48
|
+
</input-error-wrapper>
|
|
44
49
|
</input-wrapper>
|
|
45
50
|
</container>
|
|
46
51
|
</template>
|
|
@@ -49,21 +54,18 @@
|
|
|
49
54
|
import styled from 'vue-styled-components'
|
|
50
55
|
import InfoText from '../../infoText'
|
|
51
56
|
import Icon from '../../icon'
|
|
57
|
+
import ErrorMessage from '../../errorMessage'
|
|
52
58
|
|
|
53
59
|
const Container = styled.div`
|
|
54
60
|
width: 100%;
|
|
55
61
|
position: relative;
|
|
56
62
|
`
|
|
57
|
-
|
|
58
|
-
display: inline-grid;
|
|
59
|
-
grid-template-row: auto auto;
|
|
60
|
-
grid-gap: 0px;
|
|
61
|
-
align-items: center;
|
|
62
|
-
`
|
|
63
|
+
|
|
63
64
|
const labelAttrs = { fontSize: String }
|
|
64
65
|
const InputLabel = styled('div', labelAttrs)`
|
|
65
|
-
|
|
66
|
+
color: ${(props) => props.theme.colors.eturnityGrey};
|
|
66
67
|
font-size: ${(props) => (props.fontSize ? props.fontSize : '13px')};
|
|
68
|
+
font-weight: 700;
|
|
67
69
|
`
|
|
68
70
|
|
|
69
71
|
const LabelWrapper = styled.div`
|
|
@@ -74,6 +76,13 @@ const LabelWrapper = styled.div`
|
|
|
74
76
|
justify-content: start;
|
|
75
77
|
`
|
|
76
78
|
|
|
79
|
+
const InputErrorWrapper = styled.div`
|
|
80
|
+
display: inline-grid;
|
|
81
|
+
grid-template-row: auto auto;
|
|
82
|
+
grid-gap: 0px;
|
|
83
|
+
align-items: center;
|
|
84
|
+
`
|
|
85
|
+
|
|
77
86
|
const inputProps = {
|
|
78
87
|
isError: Boolean,
|
|
79
88
|
inputWidth: String,
|
|
@@ -89,9 +98,7 @@ const InputContainer = styled('input', inputProps)`
|
|
|
89
98
|
? '1px solid ' + props.theme.colors.red
|
|
90
99
|
: props.noBorder
|
|
91
100
|
? 'none'
|
|
92
|
-
: props.
|
|
93
|
-
? '1px solid ' + props.theme.colors.black
|
|
94
|
-
: '1px solid ' + props.theme.colors.mediumGray};
|
|
101
|
+
: '1px solid ' + props.theme.colors.grey4};
|
|
95
102
|
padding: ${(props) =>
|
|
96
103
|
props.isError
|
|
97
104
|
? '11px 25px 11px 10px'
|
|
@@ -102,7 +109,11 @@ const InputContainer = styled('input', inputProps)`
|
|
|
102
109
|
position: relative;
|
|
103
110
|
font-size: ${(props) => (props.fontSize ? props.fontSize : '16px')};
|
|
104
111
|
color: ${(props) =>
|
|
105
|
-
props.isError
|
|
112
|
+
props.isError
|
|
113
|
+
? props.theme.colors.grey6
|
|
114
|
+
: props.isDisabled
|
|
115
|
+
? props.theme.colors.grey2
|
|
116
|
+
: props.theme.colors.black};
|
|
106
117
|
width: ${(props) => (props.inputWidth ? props.inputWidth : '100%')};
|
|
107
118
|
min-width: ${(props) => (props.minWidth ? props.minWidth : 'unset')};
|
|
108
119
|
box-sizing: border-box; // to allow width of 100% with padding
|
|
@@ -112,8 +123,7 @@ const InputContainer = styled('input', inputProps)`
|
|
|
112
123
|
props.isDisabled ? props.theme.colors.grey5 : '#fff'};
|
|
113
124
|
|
|
114
125
|
&::placeholder {
|
|
115
|
-
color: ${(props) =>
|
|
116
|
-
props.isError ? props.theme.colors.red : props.theme.colors.darkGray};
|
|
126
|
+
color: ${(props) => props.theme.colors.grey2};
|
|
117
127
|
}
|
|
118
128
|
|
|
119
129
|
&:focus {
|
|
@@ -131,13 +141,6 @@ const InputWrapper = styled('div', inputAttrs)`
|
|
|
131
141
|
props.alignItems === 'vertical' || !props.hasLabel ? '1fr' : 'auto 1fr'};
|
|
132
142
|
`
|
|
133
143
|
|
|
134
|
-
const ErrorMessage = styled.div`
|
|
135
|
-
font-size: 14px;
|
|
136
|
-
color: ${(props) => props.theme.colors.red};
|
|
137
|
-
position: absolute;
|
|
138
|
-
top: calc(100% + 1px);
|
|
139
|
-
`
|
|
140
|
-
|
|
141
144
|
const IconAttrs = { size: String }
|
|
142
145
|
const IconWrapper = styled('div', IconAttrs)`
|
|
143
146
|
position: absolute;
|
|
@@ -178,11 +181,11 @@ export default {
|
|
|
178
181
|
ErrorMessage,
|
|
179
182
|
InfoText,
|
|
180
183
|
InputLabel,
|
|
181
|
-
InputErrorWrapper,
|
|
182
184
|
LabelWrapper,
|
|
183
185
|
Icon,
|
|
184
186
|
IconWrapper,
|
|
185
|
-
IconContainer
|
|
187
|
+
IconContainer,
|
|
188
|
+
InputErrorWrapper
|
|
186
189
|
},
|
|
187
190
|
data() {
|
|
188
191
|
return {
|
|
@@ -25,8 +25,9 @@
|
|
|
25
25
|
// :value="companyName"
|
|
26
26
|
// :disabled="true"
|
|
27
27
|
// inputWidth="250px"
|
|
28
|
+
// @on-change="function($event)"
|
|
28
29
|
// />
|
|
29
|
-
import styled from
|
|
30
|
+
import styled from 'vue-styled-components'
|
|
30
31
|
|
|
31
32
|
const Container = styled.div`
|
|
32
33
|
width: 100%;
|
|
@@ -34,15 +35,15 @@ const Container = styled.div`
|
|
|
34
35
|
`
|
|
35
36
|
|
|
36
37
|
const inputAttrs = { isDisabled: Boolean, inputWidth: String }
|
|
37
|
-
const InputContainer = styled(
|
|
38
|
+
const InputContainer = styled('input', inputAttrs)`
|
|
38
39
|
border: 1px solid ${(props) => props.theme.colors.mediumGray};
|
|
39
40
|
padding: 11px 30px 11px 10px;
|
|
40
41
|
border-radius: 4px;
|
|
41
|
-
font-size:
|
|
42
|
+
font-size: 13px;
|
|
42
43
|
color: ${(props) => props.theme.colors.black};
|
|
43
|
-
width: ${(props) => (props.inputWidth ? props.inputWidth :
|
|
44
|
+
width: ${(props) => (props.inputWidth ? props.inputWidth : '100%')};
|
|
44
45
|
box-sizing: border-box;
|
|
45
|
-
cursor: ${(props) => (props.isDisabled ?
|
|
46
|
+
cursor: ${(props) => (props.isDisabled ? 'not-allowed' : 'auto')};
|
|
46
47
|
background: ${(props) => props.theme.colors.white} !important;
|
|
47
48
|
&::placeholder {
|
|
48
49
|
color: ${(props) => props.theme.colors.darkGray};
|
|
@@ -65,33 +66,33 @@ const InputWrapper = styled.span`
|
|
|
65
66
|
`
|
|
66
67
|
|
|
67
68
|
export default {
|
|
68
|
-
name:
|
|
69
|
+
name: 'search-input',
|
|
69
70
|
components: {
|
|
70
71
|
InputContainer,
|
|
71
72
|
InputWrapper,
|
|
72
|
-
Container
|
|
73
|
+
Container
|
|
73
74
|
},
|
|
74
75
|
props: {
|
|
75
76
|
value: {
|
|
76
|
-
required: true
|
|
77
|
+
required: true
|
|
77
78
|
},
|
|
78
79
|
disabled: {
|
|
79
80
|
required: false,
|
|
80
|
-
default: false
|
|
81
|
+
default: false
|
|
81
82
|
},
|
|
82
83
|
placeholder: {
|
|
83
84
|
required: false,
|
|
84
|
-
default:
|
|
85
|
+
default: ''
|
|
85
86
|
},
|
|
86
87
|
inputWidth: {
|
|
87
88
|
required: false,
|
|
88
|
-
default: null
|
|
89
|
-
}
|
|
89
|
+
default: null
|
|
90
|
+
}
|
|
90
91
|
},
|
|
91
92
|
methods: {
|
|
92
93
|
onChangeHandler(event) {
|
|
93
|
-
this.$emit(
|
|
94
|
-
}
|
|
95
|
-
}
|
|
94
|
+
this.$emit('on-change', event)
|
|
95
|
+
}
|
|
96
|
+
}
|
|
96
97
|
}
|
|
97
98
|
</script>
|
|
@@ -45,9 +45,11 @@
|
|
|
45
45
|
// label="Question 5"
|
|
46
46
|
// alignItems="horizontal" // horizontal, vertical
|
|
47
47
|
// :isDisabled="true"
|
|
48
|
+
// . fontSize="13px"
|
|
48
49
|
// />
|
|
49
50
|
import styled from 'vue-styled-components'
|
|
50
51
|
import InfoText from '../../infoText'
|
|
52
|
+
import ErrorMessage from '../../errorMessage'
|
|
51
53
|
|
|
52
54
|
const containerProps = { inputWidth: String }
|
|
53
55
|
const Container = styled('div', containerProps)`
|
|
@@ -73,7 +75,7 @@ const InputContainer = styled('textarea', inputProps)`
|
|
|
73
75
|
border: ${(props) =>
|
|
74
76
|
props.isError
|
|
75
77
|
? '1px solid ' + props.theme.colors.red
|
|
76
|
-
: '1px solid ' + props.theme.colors.
|
|
78
|
+
: '1px solid ' + props.theme.colors.grey4};
|
|
77
79
|
padding: ${(props) =>
|
|
78
80
|
props.hasUnit ? '11px 40px 11px 10px' : '11px 5px 11px 10px'};
|
|
79
81
|
border-radius: 4px;
|
|
@@ -85,8 +87,7 @@ const InputContainer = styled('textarea', inputProps)`
|
|
|
85
87
|
cursor: ${(props) => (props.disabled ? 'not-allowed' : 'inherit')};
|
|
86
88
|
|
|
87
89
|
&::placeholder {
|
|
88
|
-
color: ${(props) =>
|
|
89
|
-
props.isError ? props.theme.colors.red : props.theme.colors.darkGray};
|
|
90
|
+
color: ${(props) => props.theme.colors.grey2};
|
|
90
91
|
}
|
|
91
92
|
|
|
92
93
|
&:focus {
|
|
@@ -108,13 +109,6 @@ const InputWrapper = styled('div', inputAttrs)`
|
|
|
108
109
|
: 'auto 1fr'};
|
|
109
110
|
`
|
|
110
111
|
|
|
111
|
-
const ErrorMessage = styled.div`
|
|
112
|
-
font-size: 14px;
|
|
113
|
-
color: ${(props) => props.theme.colors.red};
|
|
114
|
-
position: absolute;
|
|
115
|
-
top: calc(100% + 1px);
|
|
116
|
-
`
|
|
117
|
-
|
|
118
112
|
const labelAttrs = { fontSize: String }
|
|
119
113
|
const InputLabel = styled('div', labelAttrs)`
|
|
120
114
|
font-weight: bold;
|
|
@@ -175,11 +169,11 @@ export default {
|
|
|
175
169
|
},
|
|
176
170
|
inputWidth: {
|
|
177
171
|
required: false,
|
|
178
|
-
default: null
|
|
172
|
+
default: null
|
|
179
173
|
},
|
|
180
|
-
resize:{
|
|
181
|
-
required:false,
|
|
182
|
-
default:
|
|
174
|
+
resize: {
|
|
175
|
+
required: false,
|
|
176
|
+
default: 'none'
|
|
183
177
|
}
|
|
184
178
|
},
|
|
185
179
|
methods: {
|