@eturnity/eturnity_reusable_components 1.2.16-QA03-23092022.4 → 1.2.16-QA03-23092022.6
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
package/src/App.vue
CHANGED
|
Binary file
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<component-wrapper>
|
|
3
|
+
<text-overlay>
|
|
4
|
+
<slot></slot>
|
|
5
|
+
</text-overlay>
|
|
6
|
+
</component-wrapper>
|
|
7
|
+
</template>
|
|
8
|
+
|
|
9
|
+
<script>
|
|
10
|
+
// import InfoText from "@eturnity/eturnity_reusable_components/src/components/infoText"
|
|
11
|
+
//To use:
|
|
12
|
+
// <error-message
|
|
13
|
+
// alignText="right" // default is left
|
|
14
|
+
// />
|
|
15
|
+
|
|
16
|
+
import styled from 'vue-styled-components'
|
|
17
|
+
|
|
18
|
+
const TextOverlay = styled.div`
|
|
19
|
+
position: absolute;
|
|
20
|
+
top: calc(100% + 13px);
|
|
21
|
+
background: ${(props) => props.theme.colors.red};
|
|
22
|
+
padding: 10px;
|
|
23
|
+
width: max-content;
|
|
24
|
+
max-width: 100%;
|
|
25
|
+
min-width: 200px;
|
|
26
|
+
font-size: 11px;
|
|
27
|
+
font-weight: 400;
|
|
28
|
+
border-radius: 4px;
|
|
29
|
+
font-family: 'Lato-Bold', Arial;
|
|
30
|
+
z-index: 99;
|
|
31
|
+
color: ${(props) => props.theme.colors.white};
|
|
32
|
+
|
|
33
|
+
:before {
|
|
34
|
+
content: '';
|
|
35
|
+
background-color: ${(props) => props.theme.colors.red};
|
|
36
|
+
position: absolute;
|
|
37
|
+
top: 2px;
|
|
38
|
+
left: 40px;
|
|
39
|
+
height: 11px;
|
|
40
|
+
width: 11px;
|
|
41
|
+
transform-origin: center center;
|
|
42
|
+
transform: translate(-2em, -0.5em) rotate(45deg);
|
|
43
|
+
}
|
|
44
|
+
`
|
|
45
|
+
|
|
46
|
+
const ComponentWrapper = styled.div`
|
|
47
|
+
display: block;
|
|
48
|
+
`
|
|
49
|
+
|
|
50
|
+
export default {
|
|
51
|
+
name: 'info-text',
|
|
52
|
+
components: {
|
|
53
|
+
TextOverlay,
|
|
54
|
+
ComponentWrapper
|
|
55
|
+
},
|
|
56
|
+
props: {},
|
|
57
|
+
methods: {},
|
|
58
|
+
data() {
|
|
59
|
+
return {}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
</script>
|
|
@@ -45,6 +45,11 @@
|
|
|
45
45
|
:isError="isError"
|
|
46
46
|
>{{ unitName }}</unit-container
|
|
47
47
|
>
|
|
48
|
+
<icon
|
|
49
|
+
v-if="(isError || inputIcon) && !showLinearUnitName"
|
|
50
|
+
:class="inputIconImageClass"
|
|
51
|
+
:src="isError ? warningIcon : inputIconImage"
|
|
52
|
+
/>
|
|
48
53
|
</input-wrapper>
|
|
49
54
|
<error-message v-if="isError">{{ errorMessage }}</error-message>
|
|
50
55
|
</container>
|
|
@@ -82,6 +87,8 @@ import {
|
|
|
82
87
|
numberToString
|
|
83
88
|
} from '../../../helpers/numberConverter'
|
|
84
89
|
import InfoText from '../../infoText'
|
|
90
|
+
import ErrorMessage from '../../errorMessage'
|
|
91
|
+
import warningIcon from '../../../assets/icons/error_icon.png'
|
|
85
92
|
|
|
86
93
|
const inputProps = {
|
|
87
94
|
isError: Boolean,
|
|
@@ -143,6 +150,15 @@ const InputContainer = styled('input', inputProps)`
|
|
|
143
150
|
outline: none;
|
|
144
151
|
}
|
|
145
152
|
`
|
|
153
|
+
const IconProps = {
|
|
154
|
+
inputIconHeight: String
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
const Icon = styled('img', IconProps)`
|
|
158
|
+
position: absolute;
|
|
159
|
+
right: 10px;
|
|
160
|
+
top: 2px;
|
|
161
|
+
`
|
|
146
162
|
|
|
147
163
|
const InputWrapper = styled.span`
|
|
148
164
|
position: relative;
|
|
@@ -191,12 +207,12 @@ const SlotContainer = styled('span', inputProps)`
|
|
|
191
207
|
? props.theme.colors.black
|
|
192
208
|
: props.theme.colors.mediumGray};
|
|
193
209
|
`
|
|
194
|
-
const ErrorMessage = styled.div`
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
`
|
|
210
|
+
// const ErrorMessage = styled.div`
|
|
211
|
+
// font-size: 14px;
|
|
212
|
+
// color: ${(props) => props.theme.colors.red};
|
|
213
|
+
// position: absolute;
|
|
214
|
+
// top: calc(100% + 1px);
|
|
215
|
+
// `
|
|
200
216
|
|
|
201
217
|
const LabelWrapper = styled.div`
|
|
202
218
|
display: flex;
|
|
@@ -220,13 +236,15 @@ export default {
|
|
|
220
236
|
LabelWrapper,
|
|
221
237
|
LabelText,
|
|
222
238
|
SlotContainer,
|
|
223
|
-
InfoText
|
|
239
|
+
InfoText,
|
|
240
|
+
Icon
|
|
224
241
|
},
|
|
225
242
|
inheritAttrs: false,
|
|
226
243
|
data() {
|
|
227
244
|
return {
|
|
228
245
|
textInput: '',
|
|
229
|
-
isFocused: false
|
|
246
|
+
isFocused: false,
|
|
247
|
+
warningIcon: warningIcon
|
|
230
248
|
}
|
|
231
249
|
},
|
|
232
250
|
props: {
|
|
@@ -312,6 +330,21 @@ export default {
|
|
|
312
330
|
},
|
|
313
331
|
slotSize: {
|
|
314
332
|
required: false
|
|
333
|
+
},
|
|
334
|
+
inputIcon: {
|
|
335
|
+
require: false,
|
|
336
|
+
type: Boolean,
|
|
337
|
+
default: false
|
|
338
|
+
},
|
|
339
|
+
inputIconImage: {
|
|
340
|
+
require: false,
|
|
341
|
+
type: String,
|
|
342
|
+
default: ''
|
|
343
|
+
},
|
|
344
|
+
inputIconImageClass: {
|
|
345
|
+
require: false,
|
|
346
|
+
type: Array,
|
|
347
|
+
default: () => []
|
|
315
348
|
}
|
|
316
349
|
},
|
|
317
350
|
computed: {
|