@eturnity/eturnity_reusable_components 1.2.34 → 1.2.36
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 +105 -204
- package/src/assets/svgIcons/align_panel.svg +1 -0
- package/src/assets/svgIcons/areas_tool.svg +14 -0
- package/src/assets/svgIcons/base_layer.svg +3 -0
- package/src/assets/svgIcons/bug.svg +6 -0
- package/src/assets/svgIcons/direction_arrow.svg +4 -0
- package/src/assets/svgIcons/distance_tool.svg +8 -0
- package/src/assets/svgIcons/distort_tool.svg +10 -0
- package/src/assets/svgIcons/distort_tool2.svg +16 -0
- package/src/assets/svgIcons/draggable_corner.svg +5 -0
- package/src/assets/svgIcons/draw_tool.svg +3 -0
- package/src/assets/svgIcons/flatten.svg +12 -0
- package/src/assets/svgIcons/layers_close.svg +4 -0
- package/src/assets/svgIcons/layers_open.svg +4 -0
- package/src/assets/svgIcons/magic_tool.svg +6 -0
- package/src/assets/svgIcons/map_icon.svg +4 -2
- package/src/assets/svgIcons/map_settings.svg +3 -0
- package/src/assets/svgIcons/margin_tool.svg +4 -0
- package/src/assets/svgIcons/obstacle_tool.svg +7 -11
- package/src/assets/svgIcons/obstacle_tool_origin.svg +3 -0
- package/src/assets/svgIcons/opacity.svg +1 -0
- package/src/assets/svgIcons/outline_tool.svg +11 -0
- package/src/assets/svgIcons/redo.svg +6 -0
- package/src/assets/svgIcons/resizer.svg +5 -0
- package/src/assets/svgIcons/roof_layer.svg +3 -0
- package/src/assets/svgIcons/rotate_tool.svg +3 -0
- package/src/assets/svgIcons/ruler_tool.svg +3 -0
- package/src/assets/svgIcons/trim_tool.svg +4 -0
- package/src/assets/svgIcons/undo.svg +6 -0
- package/src/assets/svgIcons/vertical_tool.svg +3 -0
- package/src/assets/theme.js +2 -0
- package/src/components/icon/index.vue +13 -10
- package/src/components/iconWrapper/index.vue +116 -0
- package/src/components/inputs/inputNumber/index.vue +112 -15
- package/src/components/inputs/inputText/index.vue +49 -8
- package/src/components/inputs/select/index.vue +387 -0
- package/src/components/inputs/select/option/index.vue +60 -0
- package/src/components/inputs/select/select.stories.js +59 -0
- package/src/components/inputs/switchField/index.vue +244 -0
- package/src/components/modals/modal/index.vue +7 -2
- package/src/helpers/numberConverter.js +1 -0
@@ -0,0 +1,6 @@
|
|
1
|
+
<svg width="14" height="10" viewBox="0 0 14 10" fill="none" xmlns="http://www.w3.org/2000/svg">
|
2
|
+
<path d="M9.48096 2H3.48096V4H9.48096V2Z" fill="white"/>
|
3
|
+
<path d="M9.48096 8H5.48096V10H9.48096V8Z" fill="white"/>
|
4
|
+
<path d="M3.48096 5.92321L0.519349 2.96161L3.48096 0L3.48096 5.92321Z" fill="white"/>
|
5
|
+
<path d="M6.01609 8C6.70771 9.1956 8.00039 10 9.48096 10C11.6901 10 13.481 8.20914 13.481 6C13.481 3.79086 11.6901 2 9.48096 2C8.00039 2 6.7077 2.8044 6.01609 4H9.48096C10.5855 4 11.481 4.89543 11.481 6C11.481 7.10457 10.5855 8 9.48096 8H6.01609Z" fill="white"/>
|
6
|
+
</svg>
|
@@ -0,0 +1,3 @@
|
|
1
|
+
<svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">
|
2
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M6.96161 0L10.9232 3.96161L7.96713 3.96161V6.55264L12.3875 9.0786L14 10L12.3875 10.9214L7 14L1.61245 10.9214L0 10L1.61245 9.0786L5.99272 6.57559V3.96161L3 3.96161L6.96161 0ZM5.99272 8.41839L3.2249 10L7 12.1572L10.7751 10L7.96713 8.39545V9.78795H5.99272V8.41839Z" fill="white"/>
|
3
|
+
</svg>
|
package/src/assets/theme.js
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
<template>
|
2
|
-
<
|
2
|
+
<Wrapper :isDisabled="disabled" :size="size" :cursor="cursor">
|
3
3
|
<icon-image
|
4
|
+
:disabled="disabled"
|
4
5
|
:size="size"
|
5
6
|
:color="color"
|
6
7
|
:hoveredColor="hoveredColor"
|
@@ -8,7 +9,7 @@
|
|
8
9
|
require(`!html-loader!./../../assets/svgIcons/${name.toLowerCase()}.svg`)
|
9
10
|
"
|
10
11
|
></icon-image>
|
11
|
-
</
|
12
|
+
</Wrapper>
|
12
13
|
</template>
|
13
14
|
|
14
15
|
<script>
|
@@ -29,20 +30,22 @@ const Wrapper = styled('div', wrapperAttrs)`
|
|
29
30
|
display: inline-block;
|
30
31
|
width: ${(props) => props.size};
|
31
32
|
height: ${(props) => props.size};
|
33
|
+
min-width: ${(props) => props.size};
|
34
|
+
min-height: ${(props) => props.size};
|
32
35
|
cursor: ${(props) => (props.isDisabled ? 'not-allowed' : props.cursor)};
|
33
36
|
line-height: 0;
|
34
37
|
`
|
35
38
|
const IconImageProps = { color: String, hoveredColor: String, size: String }
|
36
39
|
const IconImage = styled('div', IconImageProps)`
|
37
40
|
svg {
|
38
|
-
width:
|
39
|
-
height:
|
41
|
+
width: 100%;
|
42
|
+
height: 100%;
|
40
43
|
}
|
41
|
-
svg
|
44
|
+
svg path {
|
42
45
|
${(props) =>
|
43
46
|
props.color && `fill: ${props.theme.colors[props.color] || props.color};`}
|
44
47
|
}
|
45
|
-
&:hover > svg
|
48
|
+
&:hover > svg path {
|
46
49
|
${(props) => props.hoveredColor && `fill: ${props.hoveredColor};`}
|
47
50
|
}
|
48
51
|
`
|
@@ -50,11 +53,11 @@ const IconImage = styled('div', IconImageProps)`
|
|
50
53
|
export default {
|
51
54
|
name: 'icon',
|
52
55
|
components: {
|
53
|
-
|
54
|
-
|
56
|
+
IconImage,
|
57
|
+
Wrapper
|
55
58
|
},
|
56
59
|
props: {
|
57
|
-
|
60
|
+
disabled: {
|
58
61
|
required: false,
|
59
62
|
default: false
|
60
63
|
},
|
@@ -73,7 +76,7 @@ export default {
|
|
73
76
|
},
|
74
77
|
cursor: {
|
75
78
|
required: false,
|
76
|
-
default:
|
79
|
+
default: null
|
77
80
|
}
|
78
81
|
},
|
79
82
|
data() {
|
@@ -0,0 +1,116 @@
|
|
1
|
+
<template>
|
2
|
+
<Wrapper
|
3
|
+
:disabled="disabled"
|
4
|
+
:size="size"
|
5
|
+
:backgroundColor="backgroundColor"
|
6
|
+
:borderRadius="borderRadius"
|
7
|
+
:hoveredBackgroundColor="hoveredBackgroundColor"
|
8
|
+
:isHovered="isHovered"
|
9
|
+
>
|
10
|
+
<icon :disabled="disabled"
|
11
|
+
:size="iconSize"
|
12
|
+
:name="name"
|
13
|
+
:color="iconColor"
|
14
|
+
:hoveredColor="hoveredIconColor" />
|
15
|
+
<caret v-if="hasCaret">
|
16
|
+
<iconWrapper :disabled="disabled"
|
17
|
+
size="10px"
|
18
|
+
name="arrow_down"
|
19
|
+
:iconColor="iconColor"
|
20
|
+
:hoveredBackgroundColor="hoveredIconColor"
|
21
|
+
borderRadius="1px"
|
22
|
+
/>
|
23
|
+
</caret>
|
24
|
+
</Wrapper>
|
25
|
+
</template>
|
26
|
+
|
27
|
+
<script>
|
28
|
+
// import Icon from "@eturnity/eturnity_reusable_components/src/components/icon"
|
29
|
+
// How to use:
|
30
|
+
//<icon
|
31
|
+
// name="House" //required. a svg file named [name].svg should be present in /assets/svgIcons
|
32
|
+
// color="red"
|
33
|
+
// hoveredColor="blue"
|
34
|
+
// size="60px" by default, this is 30px
|
35
|
+
// />
|
36
|
+
|
37
|
+
import styled from 'vue-styled-components'
|
38
|
+
import icon from '../icon'
|
39
|
+
const wrapperAttrs = { isHovered:Boolean,borderRadius:String,disabled: Boolean, size: String,backgroundColor:String,hoveredBackgroundColor:String }
|
40
|
+
const Wrapper = styled('div', wrapperAttrs)`
|
41
|
+
position:relative;
|
42
|
+
display: inline-flex;
|
43
|
+
width: ${(props) => props.size};
|
44
|
+
height: ${(props) => props.size};
|
45
|
+
justify-content:center;
|
46
|
+
align-items:center;
|
47
|
+
cursor: ${(props) => (props.disabled ? 'not-allowed' : 'pointer')};
|
48
|
+
background-color: ${(props)=>props.theme.colors[props.backgroundColor] || props.backgroundColor};
|
49
|
+
border-radius: ${(props) => props.borderRadius};
|
50
|
+
${(props)=>(props.isHovered ? 'background-color:'+props.theme.colors[props.hoveredBackgroundColor] || props.hoveredBackgroundColor : "")};
|
51
|
+
&:hover{
|
52
|
+
background-color:${(props)=>props.theme.colors[props.hoveredBackgroundColor] || props.hoveredBackgroundColor};
|
53
|
+
}
|
54
|
+
`
|
55
|
+
const caret=styled.div`
|
56
|
+
position:absolute;
|
57
|
+
bottom:3px;
|
58
|
+
right:2px;
|
59
|
+
height:10px;
|
60
|
+
`
|
61
|
+
|
62
|
+
export default {
|
63
|
+
name: 'iconWrapper',
|
64
|
+
components: {
|
65
|
+
Wrapper,
|
66
|
+
icon,
|
67
|
+
caret
|
68
|
+
},
|
69
|
+
props: {
|
70
|
+
disabled: {
|
71
|
+
required: false,
|
72
|
+
default: false
|
73
|
+
},
|
74
|
+
name: {
|
75
|
+
required: true
|
76
|
+
},
|
77
|
+
iconColor: {
|
78
|
+
required: false,
|
79
|
+
default: 'white'
|
80
|
+
},
|
81
|
+
hoveredIconColor: {
|
82
|
+
required: false
|
83
|
+
},
|
84
|
+
backgroundColor: {
|
85
|
+
required: false,
|
86
|
+
},
|
87
|
+
hoveredBackgroundColor: {
|
88
|
+
required: false,
|
89
|
+
default:"transparentWhite1"
|
90
|
+
},
|
91
|
+
size: {
|
92
|
+
required: false,
|
93
|
+
default: '32px'
|
94
|
+
},
|
95
|
+
iconSize:{
|
96
|
+
required: false,
|
97
|
+
default:'18px'
|
98
|
+
},
|
99
|
+
hasCaret:{
|
100
|
+
required: false,
|
101
|
+
default: false
|
102
|
+
},
|
103
|
+
borderRadius:{
|
104
|
+
required:false,
|
105
|
+
default:'6px'
|
106
|
+
},
|
107
|
+
isHovered:{
|
108
|
+
required:false,
|
109
|
+
default:false
|
110
|
+
}
|
111
|
+
},
|
112
|
+
data() {
|
113
|
+
return {}
|
114
|
+
}
|
115
|
+
}
|
116
|
+
</script>
|
@@ -1,7 +1,11 @@
|
|
1
1
|
<template>
|
2
|
-
<container :inputWidth="inputWidth">
|
2
|
+
<container :inputWidth="inputWidth" :alignItems="alignItems">
|
3
|
+
<label-slot-wrapper v-if="hasLabelSlot" :isInteractive="isInteractive" @mousedown="initInteraction">
|
4
|
+
<slot name="label"></slot>
|
5
|
+
</label-slot-wrapper>
|
6
|
+
|
3
7
|
<label-wrapper v-if="labelText">
|
4
|
-
<label-text>
|
8
|
+
<label-text :labelFontColor="labelFontColor">
|
5
9
|
{{ labelText }}
|
6
10
|
</label-text>
|
7
11
|
<info-text
|
@@ -19,21 +23,24 @@
|
|
19
23
|
:hasUnit="unitName && !!unitName.length"
|
20
24
|
:placeholder="displayedPlaceholder"
|
21
25
|
:isError="isError"
|
22
|
-
:inputWidth="inputWidth"
|
23
26
|
:inputHeight="inputHeight"
|
24
27
|
:minWidth="minWidth"
|
25
28
|
:value="formatWithCurrency(value)"
|
26
29
|
@blur="onInputBlur($event)"
|
27
30
|
@focus="focusInput()"
|
28
31
|
@keyup.enter="$emit('on-enter-click')"
|
32
|
+
@input="onInput($event)"
|
29
33
|
:disabled="disabled"
|
30
34
|
:isDisabled="disabled"
|
31
35
|
:noBorder="noBorder"
|
36
|
+
:borderColor="borderColor"
|
32
37
|
:textAlign="textAlign"
|
33
38
|
:fontSize="fontSize"
|
34
39
|
:fontColor="fontColor"
|
40
|
+
:backgroundColor="backgroundColor"
|
35
41
|
v-on="$listeners"
|
36
42
|
:hasSlot="hasSlot"
|
43
|
+
:hasLabelSlot="hasLabelSlot"
|
37
44
|
:slotSize="slotSize"
|
38
45
|
/>
|
39
46
|
<slot-container v-if="hasSlot" :slotSize="slotSize" :isError="isError">
|
@@ -101,14 +108,23 @@ const inputProps = {
|
|
101
108
|
textAlign: String,
|
102
109
|
fontSize: String,
|
103
110
|
fontColor: String,
|
111
|
+
backgroundColor:String,
|
104
112
|
hasSlot: Boolean,
|
113
|
+
hasLabelSlot: Boolean,
|
105
114
|
slotSize: String,
|
106
|
-
inputHeight:
|
115
|
+
inputHeight:String,
|
116
|
+
isInteractive:Boolean,
|
117
|
+
alignItems:String,
|
118
|
+
labelFontColor:String,
|
119
|
+
borderColor:String
|
107
120
|
}
|
108
121
|
|
109
122
|
const Container = styled('div', inputProps)`
|
110
123
|
width: ${(props) => (props.inputWidth ? props.inputWidth : '100%')};
|
111
124
|
position: relative;
|
125
|
+
display:grid;
|
126
|
+
grid-template-columns: ${(props) =>
|
127
|
+
props.alignItems === "vertical" ? "1fr" : "auto 1fr"};
|
112
128
|
`
|
113
129
|
|
114
130
|
const InputContainer = styled('input', inputProps)`
|
@@ -117,6 +133,10 @@ const InputContainer = styled('input', inputProps)`
|
|
117
133
|
? '1px solid ' + props.theme.colors.red
|
118
134
|
: props.noBorder
|
119
135
|
? 'none'
|
136
|
+
: props.borderColor ?
|
137
|
+
props.theme.colors[props.borderColor]
|
138
|
+
? '1px solid ' + props.theme.colors[props.borderColor]
|
139
|
+
: '1px solid ' + props.borderColor
|
120
140
|
: '1px solid ' + props.theme.colors.grey4};
|
121
141
|
padding-top: 11px;
|
122
142
|
padding-bottom: 11px;
|
@@ -124,8 +144,6 @@ const InputContainer = styled('input', inputProps)`
|
|
124
144
|
padding-right: ${(props) =>
|
125
145
|
props.slotSize
|
126
146
|
? 'calc(' + props.slotSize + ' + 10px)'
|
127
|
-
: props.hasUnit
|
128
|
-
? '40px'
|
129
147
|
: '5px'};
|
130
148
|
border-radius: 4px;
|
131
149
|
text-align: ${(props) => props.textAlign};
|
@@ -139,7 +157,10 @@ const InputContainer = styled('input', inputProps)`
|
|
139
157
|
: props.fontColor
|
140
158
|
? props.fontColor + ' !important'
|
141
159
|
: props.theme.colors.black};
|
142
|
-
|
160
|
+
background-color:${(props) => props.backgroundColor
|
161
|
+
? props.backgroundColor+' !important'
|
162
|
+
: props.theme.colors.white};
|
163
|
+
width: ${(props) => (props.inputWidth && !props.hasLabelSlot ? props.inputWidth : '100%')};
|
143
164
|
min-width: ${(props) => (props.minWidth ? props.minWidth : 'unset')};
|
144
165
|
background-color: ${(props) =>
|
145
166
|
props.isDisabled ? props.theme.colors.grey5 : '#fff'};
|
@@ -211,16 +232,23 @@ const SlotContainer = styled('span', inputProps)`
|
|
211
232
|
: props.theme.colors.mediumGray};
|
212
233
|
`
|
213
234
|
|
214
|
-
const LabelWrapper = styled
|
235
|
+
const LabelWrapper = styled('div',inputProps)`
|
215
236
|
display: flex;
|
216
237
|
align-items: center;
|
217
238
|
gap: 10px;
|
218
239
|
margin-bottom: 8px;
|
240
|
+
cursor: ${(props) => (props.isInteractive?'ew-resize':'auto')};
|
241
|
+
`
|
242
|
+
const LabelSlotWrapper = styled('div',inputProps)`
|
243
|
+
display: flex;
|
244
|
+
gap: 10px;
|
245
|
+
align-items:center;
|
246
|
+
cursor: ${(props) => (props.isInteractive?'ew-resize':'auto')};
|
219
247
|
`
|
220
248
|
|
221
|
-
const LabelText = styled
|
249
|
+
const LabelText = styled('div',inputProps)`
|
222
250
|
font-size: 13px;
|
223
|
-
color: ${(props) => props.theme.colors.
|
251
|
+
color: ${(props) => props.theme.colors[props.labelFontColor]?props.theme.colors[props.labelFontColor]:props.labelFontColor};
|
224
252
|
font-weight: 700;
|
225
253
|
`
|
226
254
|
|
@@ -233,10 +261,11 @@ export default {
|
|
233
261
|
UnitContainer,
|
234
262
|
ErrorMessage,
|
235
263
|
LabelWrapper,
|
264
|
+
LabelSlotWrapper,
|
236
265
|
LabelText,
|
237
266
|
InfoText,
|
238
267
|
Icon,
|
239
|
-
SlotContainer
|
268
|
+
SlotContainer,
|
240
269
|
},
|
241
270
|
inheritAttrs: false,
|
242
271
|
data() {
|
@@ -275,6 +304,10 @@ export default {
|
|
275
304
|
required: false,
|
276
305
|
default: false
|
277
306
|
},
|
307
|
+
alignItems: {
|
308
|
+
required: false,
|
309
|
+
default: "vertical",
|
310
|
+
},
|
278
311
|
errorMessage: {
|
279
312
|
required: false,
|
280
313
|
default: 'Please insert a correct number'
|
@@ -299,6 +332,9 @@ export default {
|
|
299
332
|
required: false,
|
300
333
|
default: false
|
301
334
|
},
|
335
|
+
borderColor:{
|
336
|
+
required:false,
|
337
|
+
},
|
302
338
|
textAlign: {
|
303
339
|
required: false,
|
304
340
|
default: 'left'
|
@@ -307,6 +343,14 @@ export default {
|
|
307
343
|
required: false,
|
308
344
|
default: '13px'
|
309
345
|
},
|
346
|
+
isInteractive: {
|
347
|
+
required: false,
|
348
|
+
default: false
|
349
|
+
},
|
350
|
+
interactionStep:{
|
351
|
+
required:false,
|
352
|
+
default:1
|
353
|
+
},
|
310
354
|
labelText: {
|
311
355
|
required: false,
|
312
356
|
default: null
|
@@ -327,6 +371,10 @@ export default {
|
|
327
371
|
required: false,
|
328
372
|
default: null
|
329
373
|
},
|
374
|
+
backgroundColor: {
|
375
|
+
required: false,
|
376
|
+
default: null
|
377
|
+
},
|
330
378
|
numberToStringEnabled: {
|
331
379
|
required: false,
|
332
380
|
default: true
|
@@ -352,6 +400,10 @@ export default {
|
|
352
400
|
},
|
353
401
|
slotSize: {
|
354
402
|
required: false
|
403
|
+
},
|
404
|
+
labelFontColor:{
|
405
|
+
required:false,
|
406
|
+
default:'eturnityGrey'
|
355
407
|
}
|
356
408
|
},
|
357
409
|
computed: {
|
@@ -362,9 +414,9 @@ export default {
|
|
362
414
|
hasSlot() {
|
363
415
|
return !!this.$slots.default
|
364
416
|
},
|
365
|
-
|
366
|
-
return this
|
367
|
-
}
|
417
|
+
hasLabelSlot(){
|
418
|
+
return !!this.$slots.label
|
419
|
+
},
|
368
420
|
},
|
369
421
|
methods: {
|
370
422
|
onChangeHandler(event) {
|
@@ -413,6 +465,16 @@ export default {
|
|
413
465
|
}
|
414
466
|
return evaluated
|
415
467
|
},
|
468
|
+
onInput(value){
|
469
|
+
let evaluatedVal
|
470
|
+
try{
|
471
|
+
evaluatedVal=this.onEvaluateCode(value)
|
472
|
+
}finally {
|
473
|
+
if(evaluatedVal){
|
474
|
+
this.$emit('on-input',evaluatedVal)
|
475
|
+
}
|
476
|
+
}
|
477
|
+
},
|
416
478
|
onInputBlur(e) {
|
417
479
|
this.isFocused = false
|
418
480
|
let value = e.target.value
|
@@ -443,6 +505,15 @@ export default {
|
|
443
505
|
})
|
444
506
|
this.$emit('input-focus')
|
445
507
|
},
|
508
|
+
blurInput() {
|
509
|
+
if (this.disabled) {
|
510
|
+
return
|
511
|
+
}
|
512
|
+
this.isFocused = false
|
513
|
+
this.$nextTick(() => {
|
514
|
+
this.$refs.inputField1.$el.blur()
|
515
|
+
})
|
516
|
+
},
|
446
517
|
formatWithCurrency(value) {
|
447
518
|
let adjustedMinValue =
|
448
519
|
value || value === 0
|
@@ -470,7 +541,33 @@ export default {
|
|
470
541
|
})
|
471
542
|
: adjustedMinValue
|
472
543
|
}
|
473
|
-
}
|
544
|
+
},
|
545
|
+
initInteraction(e) {
|
546
|
+
window.addEventListener('mousemove', this.interact, false);
|
547
|
+
window.addEventListener('mouseup', this.stopInteract, false);
|
548
|
+
e.preventDefault()
|
549
|
+
this.focusInput()
|
550
|
+
},
|
551
|
+
interact(e) {
|
552
|
+
e.preventDefault()
|
553
|
+
let value=parseFloat(this.value || 0)
|
554
|
+
console.log("value",value)
|
555
|
+
value+=parseFloat(this.interactionStep)*parseInt(e.movementX)
|
556
|
+
this.$emit('on-input',value)
|
557
|
+
|
558
|
+
this.textInput=numberToString({
|
559
|
+
value:
|
560
|
+
value && value.length ? value : this.minNumber,
|
561
|
+
numberPrecision: this.numberPrecision
|
562
|
+
})
|
563
|
+
//this.value=value
|
564
|
+
},
|
565
|
+
stopInteract(e) {
|
566
|
+
e.preventDefault()
|
567
|
+
window.removeEventListener('mousemove', this.interact, false);
|
568
|
+
window.removeEventListener('mouseup', this.stopInteract, false);
|
569
|
+
this.blurInput()
|
570
|
+
},
|
474
571
|
},
|
475
572
|
created() {
|
476
573
|
if (this.value) {
|
@@ -5,7 +5,7 @@
|
|
5
5
|
:alignItems="alignItems"
|
6
6
|
>
|
7
7
|
<label-wrapper v-if="label">
|
8
|
-
<input-label :fontSize="fontSize">{{ label }}</input-label>
|
8
|
+
<input-label :labelFontColor="labelFontColor" :fontSize="fontSize">{{ label }}</input-label>
|
9
9
|
<info-text
|
10
10
|
v-if="infoTextMessage"
|
11
11
|
:text="infoTextMessage"
|
@@ -21,6 +21,7 @@
|
|
21
21
|
:isError="isError"
|
22
22
|
:inputWidth="inputWidth"
|
23
23
|
:minWidth="minWidth"
|
24
|
+
:inputHeight="inputHeight"
|
24
25
|
:value="value"
|
25
26
|
@input="onChangeHandler"
|
26
27
|
@blur="onInputBlur"
|
@@ -30,6 +31,8 @@
|
|
30
31
|
:fontSize="fontSize"
|
31
32
|
:inputType="inputType"
|
32
33
|
:type="inputTypeData"
|
34
|
+
:fontColor="fontColor"
|
35
|
+
:backgroundColor="backgroundColor"
|
33
36
|
/>
|
34
37
|
<icon-wrapper
|
35
38
|
v-if="inputType === 'password' && !isError"
|
@@ -61,9 +64,15 @@ const Container = styled.div`
|
|
61
64
|
position: relative;
|
62
65
|
`
|
63
66
|
|
64
|
-
const labelAttrs = { fontSize: String }
|
67
|
+
const labelAttrs = { fontSize: String,labelFontColor:String, }
|
65
68
|
const InputLabel = styled('div', labelAttrs)`
|
66
|
-
color: ${(props) => props.theme.colors.
|
69
|
+
color: ${(props) => props.theme.colors[props.labelFontColor]?
|
70
|
+
props.theme.colors[props.labelFontColor]:
|
71
|
+
props.labelFontColor?
|
72
|
+
props.labelFontColor:
|
73
|
+
props.theme.colors.eturnityGrey
|
74
|
+
};
|
75
|
+
|
67
76
|
font-size: ${(props) => (props.fontSize ? props.fontSize : '13px')};
|
68
77
|
font-weight: 700;
|
69
78
|
`
|
@@ -90,14 +99,22 @@ const inputProps = {
|
|
90
99
|
noBorder: Boolean,
|
91
100
|
isDisabled: Boolean,
|
92
101
|
fontSize: String,
|
93
|
-
inputType: String
|
102
|
+
inputType: String,
|
103
|
+
fontColor: String,
|
104
|
+
backgroundColor:String,
|
105
|
+
borderColor:String,
|
106
|
+
inputHeight:String,
|
94
107
|
}
|
95
108
|
const InputContainer = styled('input', inputProps)`
|
96
109
|
border: ${(props) =>
|
97
|
-
|
110
|
+
props.isError
|
98
111
|
? '1px solid ' + props.theme.colors.red
|
99
112
|
: props.noBorder
|
100
113
|
? 'none'
|
114
|
+
: props.borderColor ?
|
115
|
+
props.theme.colors[props.borderColor]
|
116
|
+
? '1px solid ' + props.theme.colors[props.borderColor]
|
117
|
+
: '1px solid ' + props.borderColor
|
101
118
|
: '1px solid ' + props.theme.colors.grey4};
|
102
119
|
padding: ${(props) =>
|
103
120
|
props.isError
|
@@ -113,15 +130,20 @@ const InputContainer = styled('input', inputProps)`
|
|
113
130
|
? props.theme.colors.grey6
|
114
131
|
: props.isDisabled
|
115
132
|
? props.theme.colors.grey2
|
133
|
+
: props.fontColor
|
134
|
+
? props.fontColor + ' !important'
|
116
135
|
: props.theme.colors.black};
|
136
|
+
|
117
137
|
width: ${(props) => (props.inputWidth ? props.inputWidth : '100%')};
|
118
138
|
min-width: ${(props) => (props.minWidth ? props.minWidth : 'unset')};
|
139
|
+
max-height: ${(props) => props.inputHeight};
|
119
140
|
box-sizing: border-box; // to allow width of 100% with padding
|
120
141
|
font-weight: 500;
|
121
142
|
cursor: ${(props) => (props.isDisabled ? 'not-allowed' : 'auto')};
|
122
143
|
background-color: ${(props) =>
|
123
|
-
props.isDisabled ? props.theme.colors.grey5 :
|
124
|
-
|
144
|
+
props.isDisabled ? props.theme.colors.grey5 :
|
145
|
+
props.backgroundColor ? props.backgroundColor+' !important' :
|
146
|
+
props.theme.colors.white};
|
125
147
|
&::placeholder {
|
126
148
|
color: ${(props) => props.theme.colors.grey2};
|
127
149
|
}
|
@@ -209,6 +231,10 @@ export default {
|
|
209
231
|
required: false,
|
210
232
|
default: null
|
211
233
|
},
|
234
|
+
inputHeight: {
|
235
|
+
required: false,
|
236
|
+
default: null
|
237
|
+
},
|
212
238
|
minWidth: {
|
213
239
|
required: false,
|
214
240
|
default: null
|
@@ -245,7 +271,22 @@ export default {
|
|
245
271
|
inputType: {
|
246
272
|
required: false,
|
247
273
|
default: 'text'
|
248
|
-
}
|
274
|
+
},
|
275
|
+
labelFontColor:{
|
276
|
+
required:false,
|
277
|
+
default:'black'
|
278
|
+
},
|
279
|
+
backgroundColor:{
|
280
|
+
required:false,
|
281
|
+
default:'white'
|
282
|
+
},
|
283
|
+
fontColor:{
|
284
|
+
required:false,
|
285
|
+
default:'black'
|
286
|
+
},
|
287
|
+
borderColor:{
|
288
|
+
required:false,
|
289
|
+
},
|
249
290
|
},
|
250
291
|
methods: {
|
251
292
|
onChangeHandler($event) {
|