@eturnity/eturnity_reusable_components 1.2.19-EPDM-5262.6 → 1.2.19-EPDM-3412.1
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 +46 -47
- package/src/assets/icons/error_icon copy.png +0 -0
- package/src/components/errorMessage/index.vue +62 -0
- package/src/components/inputs/inputNumber/index.vue +47 -3
- package/src/components/inputs/inputText/index.vue +11 -9
- package/src/components/inputs/textAreaInput/index.vue +6 -1
package/package.json
CHANGED
package/src/App.vue
CHANGED
|
@@ -24,54 +24,46 @@
|
|
|
24
24
|
</InputAnnexContainer>
|
|
25
25
|
</input-number>
|
|
26
26
|
<br />
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
<info-text size="100" alignArrow="left" width="360px">This is the tooltip text center</info-text>
|
|
43
|
-
<br /><br />
|
|
44
|
-
<info-text size="50" alignArrow="left" width="360px">This is the tooltip text center</info-text>
|
|
45
|
-
<br /><br />
|
|
46
|
-
<info-text size="10" alignArrow="left" width="360px">This is the tooltip text center</info-text>
|
|
47
|
-
<br /><br />
|
|
48
|
-
<br /><br /><br />
|
|
49
|
-
<info-text size="100" alignArrow="right" width="360px">This is the tooltip text center</info-text>
|
|
50
|
-
<br /><br />
|
|
51
|
-
<info-text size="50" alignArrow="right" width="360px">This is the tooltip text center</info-text>
|
|
52
|
-
<br /><br />
|
|
53
|
-
<info-text size="10" alignArrow="right" width="360px">This is the tooltip text center</info-text>
|
|
54
|
-
<br /><br />
|
|
55
|
-
</div>
|
|
27
|
+
|
|
28
|
+
<p>InputText</p>
|
|
29
|
+
<input-text
|
|
30
|
+
placeholder="Company name"
|
|
31
|
+
:value="inputValue"
|
|
32
|
+
:isError="true"
|
|
33
|
+
errorMessage="This is my error message"
|
|
34
|
+
infoTextAlign="right"
|
|
35
|
+
infoTextMessage="My info message"
|
|
36
|
+
label="Question 5"
|
|
37
|
+
alignItems="vertical"
|
|
38
|
+
inputWidth="250px"
|
|
39
|
+
minWidth="100px"
|
|
40
|
+
/>
|
|
41
|
+
<br/>
|
|
56
42
|
<input-number
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
43
|
+
:value="num"
|
|
44
|
+
@input-change="num = $event"
|
|
45
|
+
unitName="t"
|
|
46
|
+
id="biebie"
|
|
47
|
+
test="koko"
|
|
48
|
+
@keydown="keydownHandler"
|
|
49
|
+
/>
|
|
64
50
|
</page-container>
|
|
65
51
|
</ThemeProvider>
|
|
66
52
|
</template>
|
|
67
53
|
|
|
68
54
|
<script>
|
|
69
|
-
import { ThemeProvider } from
|
|
70
|
-
import theme from
|
|
71
|
-
import styled from
|
|
72
|
-
|
|
73
|
-
import
|
|
74
|
-
import
|
|
55
|
+
import { ThemeProvider } from "vue-styled-components"
|
|
56
|
+
import theme from "./assets/theme"
|
|
57
|
+
import styled from "vue-styled-components"
|
|
58
|
+
import MainTable from "@/components/tables/mainTable"
|
|
59
|
+
import ThreeDots from "@/components/threeDots"
|
|
60
|
+
import Toggle from "@/components/inputs/toggle"
|
|
61
|
+
import InputNumber from "@/components/inputs/inputNumber"
|
|
62
|
+
import Checkbox from "@/components/inputs/checkbox"
|
|
63
|
+
import PageSubtitle from "@/components/pageSubtitle"
|
|
64
|
+
import Spinner from "@/components/spinner"
|
|
65
|
+
import ExternalButton from "@/components/buttons/externalButton"
|
|
66
|
+
import InputText from "@/components/inputs/inputText"
|
|
75
67
|
// import TableDropdown from "@/components/tableDropdown"
|
|
76
68
|
const InputAnnexContainer = styled.div`
|
|
77
69
|
display: grid;
|
|
@@ -89,12 +81,16 @@ export default {
|
|
|
89
81
|
ThemeProvider,
|
|
90
82
|
PageContainer,
|
|
91
83
|
InputNumber,
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
84
|
+
PageSubtitle,
|
|
85
|
+
Spinner,
|
|
86
|
+
Checkbox,
|
|
87
|
+
InputText,
|
|
88
|
+
ExternalButton,
|
|
89
|
+
Modal,
|
|
95
90
|
},
|
|
96
91
|
data() {
|
|
97
92
|
return {
|
|
93
|
+
num: 42,
|
|
98
94
|
inputValue: null,
|
|
99
95
|
checkedOption: 'button_1',
|
|
100
96
|
question: {
|
|
@@ -153,6 +149,9 @@ export default {
|
|
|
153
149
|
}
|
|
154
150
|
},
|
|
155
151
|
methods: {
|
|
152
|
+
keydownHandler(e) {
|
|
153
|
+
console.log('test', e)
|
|
154
|
+
},
|
|
156
155
|
getTheme() {
|
|
157
156
|
return theme
|
|
158
157
|
},
|
|
@@ -202,8 +201,8 @@ export default {
|
|
|
202
201
|
item = '-'
|
|
203
202
|
}
|
|
204
203
|
return item
|
|
205
|
-
}
|
|
206
|
-
}
|
|
204
|
+
}
|
|
205
|
+
}
|
|
207
206
|
}
|
|
208
207
|
</script>
|
|
209
208
|
|
|
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>
|
|
@@ -14,9 +14,10 @@
|
|
|
14
14
|
</label-wrapper>
|
|
15
15
|
<input-wrapper>
|
|
16
16
|
<input-container
|
|
17
|
+
v-bind="$attrs"
|
|
17
18
|
ref="inputField1"
|
|
18
19
|
:hasUnit="unitName && !!unitName.length"
|
|
19
|
-
:placeholder="
|
|
20
|
+
:placeholder="displayedPlaceholder"
|
|
20
21
|
:isError="isError"
|
|
21
22
|
:inputWidth="inputWidth"
|
|
22
23
|
:minWidth="minWidth"
|
|
@@ -30,6 +31,7 @@
|
|
|
30
31
|
:textAlign="textAlign"
|
|
31
32
|
:fontSize="fontSize"
|
|
32
33
|
:fontColor="fontColor"
|
|
34
|
+
v-on="$listeners"
|
|
33
35
|
:hasSlot="hasSlot"
|
|
34
36
|
:slotSize="slotSize"
|
|
35
37
|
/>
|
|
@@ -43,6 +45,11 @@
|
|
|
43
45
|
:isError="isError"
|
|
44
46
|
>{{ unitName }}</unit-container
|
|
45
47
|
>
|
|
48
|
+
<icon
|
|
49
|
+
v-if="(isError || inputIcon) && !showLinearUnitName"
|
|
50
|
+
:class="inputIconImageClass"
|
|
51
|
+
:src="isError ? warningIcon : inputIconImage"
|
|
52
|
+
/>
|
|
46
53
|
</input-wrapper>
|
|
47
54
|
<error-message v-if="isError">{{ errorMessage }}</error-message>
|
|
48
55
|
</container>
|
|
@@ -80,6 +87,8 @@ import {
|
|
|
80
87
|
numberToString
|
|
81
88
|
} from '../../../helpers/numberConverter'
|
|
82
89
|
import InfoText from '../../infoText'
|
|
90
|
+
import ErrorMessage from '../../errorMessage'
|
|
91
|
+
import warningIcon from '../../../assets/icons/error_icon.png'
|
|
83
92
|
|
|
84
93
|
const inputProps = {
|
|
85
94
|
isError: Boolean,
|
|
@@ -141,6 +150,15 @@ const InputContainer = styled('input', inputProps)`
|
|
|
141
150
|
outline: none;
|
|
142
151
|
}
|
|
143
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
|
+
`
|
|
144
162
|
|
|
145
163
|
const InputWrapper = styled.span`
|
|
146
164
|
position: relative;
|
|
@@ -217,13 +235,23 @@ export default {
|
|
|
217
235
|
ErrorMessage,
|
|
218
236
|
LabelWrapper,
|
|
219
237
|
LabelText,
|
|
238
|
+
InfoText,
|
|
239
|
+
Icon,
|
|
220
240
|
SlotContainer,
|
|
221
241
|
InfoText
|
|
222
242
|
},
|
|
243
|
+
inheritAttrs: false,
|
|
223
244
|
data() {
|
|
224
245
|
return {
|
|
225
246
|
textInput: '',
|
|
226
|
-
isFocused: false
|
|
247
|
+
isFocused: false,
|
|
248
|
+
warningIcon: warningIcon
|
|
249
|
+
}
|
|
250
|
+
},
|
|
251
|
+
computed: {
|
|
252
|
+
displayedPlaceholder() {
|
|
253
|
+
if (this.placeholder) return this.placeholder
|
|
254
|
+
return `${this.minNumber || 0} ${this.unitName ? this.unitName : ''}`
|
|
227
255
|
}
|
|
228
256
|
},
|
|
229
257
|
props: {
|
|
@@ -307,6 +335,21 @@ export default {
|
|
|
307
335
|
required: false,
|
|
308
336
|
default: true
|
|
309
337
|
},
|
|
338
|
+
inputIcon: {
|
|
339
|
+
require: false,
|
|
340
|
+
type: Boolean,
|
|
341
|
+
default: false
|
|
342
|
+
},
|
|
343
|
+
inputIconImage: {
|
|
344
|
+
require: false,
|
|
345
|
+
type: String,
|
|
346
|
+
default: ''
|
|
347
|
+
},
|
|
348
|
+
inputIconImageClass: {
|
|
349
|
+
require: false,
|
|
350
|
+
type: Array,
|
|
351
|
+
default: () => []
|
|
352
|
+
},
|
|
310
353
|
slotSize: {
|
|
311
354
|
required: false
|
|
312
355
|
}
|
|
@@ -321,7 +364,7 @@ export default {
|
|
|
321
364
|
},
|
|
322
365
|
methods: {
|
|
323
366
|
onChangeHandler(event) {
|
|
324
|
-
if (isNaN(event)) {
|
|
367
|
+
if (isNaN(event) || event=="") {
|
|
325
368
|
event = this.minNumber || this.minNumber === 0 ? this.minNumber : event
|
|
326
369
|
}
|
|
327
370
|
this.$emit('input-change', event)
|
|
@@ -387,6 +430,7 @@ export default {
|
|
|
387
430
|
this.$nextTick(() => {
|
|
388
431
|
this.$refs.inputField1.$el.select()
|
|
389
432
|
})
|
|
433
|
+
this.$emit('input-focus')
|
|
390
434
|
},
|
|
391
435
|
formatWithCurrency(value) {
|
|
392
436
|
let adjustedMinValue =
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
:alignText="infoTextAlign"
|
|
15
15
|
/>
|
|
16
16
|
</label-wrapper>
|
|
17
|
+
<input-error-wrapper>
|
|
17
18
|
<input-container
|
|
18
19
|
:placeholder="placeholder"
|
|
19
20
|
:isError="isError"
|
|
@@ -26,20 +27,27 @@
|
|
|
26
27
|
:isDisabled="disabled"
|
|
27
28
|
:fontSize="fontSize"
|
|
28
29
|
/>
|
|
30
|
+
<error-message v-if="isError">{{ errorMessage }}</error-message>
|
|
31
|
+
</input-error-wrapper>
|
|
29
32
|
</input-wrapper>
|
|
30
|
-
<error-message v-if="isError">{{ errorMessage }}</error-message>
|
|
31
33
|
</container>
|
|
32
34
|
</template>
|
|
33
35
|
|
|
34
36
|
<script>
|
|
35
37
|
import styled from "vue-styled-components"
|
|
36
38
|
import InfoText from "../../infoText"
|
|
39
|
+
import ErrorMessage from '../../errorMessage'
|
|
37
40
|
|
|
38
41
|
const Container = styled.div`
|
|
39
42
|
width: 100%;
|
|
40
43
|
position: relative;
|
|
41
44
|
`
|
|
42
|
-
|
|
45
|
+
const InputErrorWrapper = styled.div`
|
|
46
|
+
display: inline-grid;
|
|
47
|
+
grid-template-row: auto auto;
|
|
48
|
+
grid-gap: 0px;
|
|
49
|
+
align-items: center;
|
|
50
|
+
`
|
|
43
51
|
const labelAttrs = { fontSize: String }
|
|
44
52
|
const InputLabel = styled("div", labelAttrs)`
|
|
45
53
|
font-weight: bold;
|
|
@@ -104,13 +112,6 @@ const InputWrapper = styled("div", inputAttrs)`
|
|
|
104
112
|
props.alignItems === "vertical" || !props.hasLabel ? "1fr" : "auto 1fr"};
|
|
105
113
|
`
|
|
106
114
|
|
|
107
|
-
const ErrorMessage = styled.div`
|
|
108
|
-
font-size: 14px;
|
|
109
|
-
color: ${(props) => props.theme.colors.red};
|
|
110
|
-
position: absolute;
|
|
111
|
-
top: calc(100% + 1px);
|
|
112
|
-
`
|
|
113
|
-
|
|
114
115
|
export default {
|
|
115
116
|
// import InputText from "@eturnity/eturnity_reusable_components/src/components/inputs/inputText"
|
|
116
117
|
// To use:
|
|
@@ -136,6 +137,7 @@ export default {
|
|
|
136
137
|
ErrorMessage,
|
|
137
138
|
InfoText,
|
|
138
139
|
InputLabel,
|
|
140
|
+
InputErrorWrapper,
|
|
139
141
|
LabelWrapper,
|
|
140
142
|
},
|
|
141
143
|
props: {
|
|
@@ -23,6 +23,7 @@
|
|
|
23
23
|
:disabled="isDisabled"
|
|
24
24
|
:fontSize="fontSize"
|
|
25
25
|
@input="onChangeHandler"
|
|
26
|
+
:resize="resize"
|
|
26
27
|
/>
|
|
27
28
|
</input-wrapper>
|
|
28
29
|
<error-message v-if="isError && errorText">{{ errorText }}</error-message>
|
|
@@ -174,7 +175,11 @@ export default {
|
|
|
174
175
|
},
|
|
175
176
|
inputWidth: {
|
|
176
177
|
required: false,
|
|
177
|
-
default: null
|
|
178
|
+
default: null,
|
|
179
|
+
},
|
|
180
|
+
resize:{
|
|
181
|
+
required:false,
|
|
182
|
+
default: "none"
|
|
178
183
|
}
|
|
179
184
|
},
|
|
180
185
|
methods: {
|