@eturnity/eturnity_reusable_components 7.24.3-EPDM-11250.0 → 7.24.3-EPDM-11320.0
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/.eslintrc.js +125 -0
- package/package.json +6 -20
- package/src/App.vue +75 -70
- package/src/components/addNewButton/index.vue +24 -27
- package/src/components/banner/actionBanner/index.vue +32 -30
- package/src/components/banner/banner/index.vue +88 -80
- package/src/components/banner/infoBanner/index.vue +36 -44
- package/src/components/buttons/buttonIcon/index.vue +83 -78
- package/src/components/buttons/closeButton/index.vue +26 -26
- package/src/components/buttons/mainButton/index.vue +80 -76
- package/src/components/card/index.vue +56 -52
- package/src/components/collapsableInfoText/index.vue +81 -76
- package/src/components/deleteIcon/index.vue +31 -28
- package/src/components/draggableInputHandle/index.vue +20 -17
- package/src/components/dropdown/Dropdown.stories.js +8 -8
- package/src/components/dropdown/index.vue +75 -72
- package/src/components/errorMessage/index.vue +23 -23
- package/src/components/filter/filterSettings.vue +349 -329
- package/src/components/filter/index.vue +130 -130
- package/src/components/filter/parentDropdown.vue +43 -40
- package/src/components/icon/Icons.stories.js +4 -4
- package/src/components/icon/iconCache.js +1 -1
- package/src/components/icon/iconCollection.vue +40 -37
- package/src/components/icon/index.vue +72 -65
- package/src/components/iconWrapper/index.vue +122 -118
- package/src/components/infoCard/index.vue +20 -17
- package/src/components/infoText/index.vue +88 -82
- package/src/components/inputs/checkbox/index.vue +91 -94
- package/src/components/inputs/inputNumber/index.vue +508 -488
- package/src/components/inputs/inputNumberQuestion/index.vue +127 -124
- package/src/components/inputs/inputText/index.vue +265 -252
- package/src/components/inputs/radioButton/index.vue +135 -120
- package/src/components/inputs/searchInput/index.vue +84 -81
- package/src/components/inputs/select/index.vue +644 -631
- package/src/components/inputs/select/option/index.vue +91 -91
- package/src/components/inputs/select/select.stories.js +7 -7
- package/src/components/inputs/slider/index.vue +46 -46
- package/src/components/inputs/switchField/index.vue +159 -152
- package/src/components/inputs/textAreaInput/index.vue +120 -113
- package/src/components/inputs/toggle/index.vue +137 -127
- package/src/components/label/index.vue +64 -61
- package/src/components/markerItem/index.vue +40 -40
- package/src/components/modals/actionModal/index.vue +32 -29
- package/src/components/modals/infoModal/index.vue +34 -27
- package/src/components/modals/modal/index.vue +88 -80
- package/src/components/navigationTabs/index.vue +50 -47
- package/src/components/pageSubtitle/index.vue +33 -29
- package/src/components/pageTitle/index.vue +47 -39
- package/src/components/pagination/index.vue +64 -62
- package/src/components/progressBar/index.vue +70 -67
- package/src/components/projectMarker/index.vue +172 -163
- package/src/components/rangeSlider/Slider.vue +449 -449
- package/src/components/rangeSlider/index.vue +282 -270
- package/src/components/rangeSlider/utils/dom.js +3 -3
- package/src/components/selectedOptions/index.vue +51 -51
- package/src/components/sideMenu/index.vue +117 -109
- package/src/components/spinner/index.vue +37 -34
- package/src/components/tableDropdown/index.vue +343 -326
- package/src/components/tables/mainTable/index.vue +109 -106
- package/src/components/tables/viewTable/index.vue +105 -92
- package/src/components/threeDots/index.vue +174 -171
- package/src/components/videoThumbnail/index.vue +67 -59
- package/src/components/videoThumbnail/videoThumbnail.stories.js +6 -6
- package/src/helpers/numberConverter.js +1 -3
- package/src/helpers/translateLang.js +10 -13
- package/.prettierrc +0 -7
- package/public/favicon.ico +0 -0
- package/public/index.html +0 -17
@@ -1,26 +1,29 @@
|
|
1
1
|
<template>
|
2
|
-
<
|
3
|
-
<
|
4
|
-
<
|
5
|
-
:
|
2
|
+
<Container>
|
3
|
+
<InputWrapper>
|
4
|
+
<InputContainer
|
5
|
+
:has-length="!!textInput.length"
|
6
|
+
:has-unit="!!question.unit_short_name"
|
7
|
+
:input-width="inputWidth"
|
8
|
+
:is-error="isError"
|
6
9
|
:placeholder="placeholder"
|
7
|
-
:isError="isError"
|
8
|
-
:inputWidth="inputWidth"
|
9
10
|
:value="textInput"
|
10
|
-
:hasLength="!!textInput.length"
|
11
|
-
@input="onChangeHandler"
|
12
11
|
@blur="onInputBlur()"
|
12
|
+
@input="onChangeHandler"
|
13
13
|
@keyup.enter="$emit('on-enter-click')"
|
14
14
|
/>
|
15
|
-
<
|
15
|
+
<UnitContainer
|
16
16
|
v-if="question.unit_short_name"
|
17
|
-
:
|
18
|
-
:
|
19
|
-
>{{ question.unit_short_name }}</unit-container
|
17
|
+
:has-length="!!textInput.length"
|
18
|
+
:is-error="isError"
|
20
19
|
>
|
21
|
-
|
22
|
-
|
23
|
-
|
20
|
+
{{ question.unit_short_name }}
|
21
|
+
</UnitContainer>
|
22
|
+
</InputWrapper>
|
23
|
+
<ErrorMessage v-if="isError">
|
24
|
+
{{ errorMessage }}
|
25
|
+
</ErrorMessage>
|
26
|
+
</Container>
|
24
27
|
</template>
|
25
28
|
|
26
29
|
<script>
|
@@ -44,42 +47,42 @@
|
|
44
47
|
// number_max_allowed: 10,
|
45
48
|
// unit_short_name: "cm",
|
46
49
|
// },
|
47
|
-
import styled from "vue3-styled-components"
|
48
|
-
import {
|
49
|
-
|
50
|
-
|
51
|
-
} from "../../../helpers/numberConverter"
|
50
|
+
import styled from "vue3-styled-components"
|
51
|
+
import {
|
52
|
+
stringToNumber,
|
53
|
+
numberToString,
|
54
|
+
} from "../../../helpers/numberConverter"
|
52
55
|
|
53
|
-
const Container = styled.div`
|
56
|
+
const Container = styled.div`
|
54
57
|
width: 100%;
|
55
58
|
position: relative;
|
56
59
|
`
|
57
60
|
|
58
|
-
const inputProps = {
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
}
|
64
|
-
const InputContainer = styled("input", inputProps)`
|
61
|
+
const inputProps = {
|
62
|
+
isError: Boolean,
|
63
|
+
hasUnit: Boolean,
|
64
|
+
inputWidth: String,
|
65
|
+
hasLength: Boolean,
|
66
|
+
}
|
67
|
+
const InputContainer = styled("input", inputProps)`
|
65
68
|
border: 1px solid
|
66
69
|
${(props) =>
|
67
70
|
props.isError
|
68
71
|
? props.theme.colors.red
|
69
72
|
: props.hasLength
|
70
73
|
? props.theme.colors.primary
|
71
|
-
|
74
|
+
: props.theme.colors.mediumGray};
|
72
75
|
padding: ${(props) =>
|
73
|
-
|
76
|
+
props.hasUnit ? "11px 40px 11px 10px" : "11px 5px 11px 10px"};
|
74
77
|
border-radius: 4px;
|
75
78
|
font-size: 16px;
|
76
79
|
color: ${(props) =>
|
77
|
-
|
80
|
+
props.isError ? props.theme.colors.red : props.theme.colors.primary};
|
78
81
|
width: ${(props) => (props.inputWidth ? props.inputWidth : "auto")};
|
79
82
|
|
80
83
|
&::placeholder {
|
81
84
|
color: ${(props) =>
|
82
|
-
|
85
|
+
props.isError ? props.theme.colors.red : props.theme.colors.darkGray};
|
83
86
|
}
|
84
87
|
|
85
88
|
&:focus {
|
@@ -87,18 +90,18 @@ const InputContainer = styled("input", inputProps)`
|
|
87
90
|
}
|
88
91
|
`
|
89
92
|
|
90
|
-
const InputWrapper = styled.span`
|
93
|
+
const InputWrapper = styled.span`
|
91
94
|
position: relative;
|
92
95
|
`
|
93
96
|
|
94
|
-
const UnitContainer = styled("span", inputProps)`
|
97
|
+
const UnitContainer = styled("span", inputProps)`
|
95
98
|
border-left: 1px solid
|
96
99
|
${(props) =>
|
97
100
|
props.isError
|
98
101
|
? props.theme.colors.red
|
99
102
|
: props.hasLength
|
100
103
|
? props.theme.colors.primary
|
101
|
-
|
104
|
+
: props.theme.colors.mediumGray};
|
102
105
|
position: absolute;
|
103
106
|
right: 10px;
|
104
107
|
top: 0;
|
@@ -108,108 +111,108 @@ const UnitContainer = styled("span", inputProps)`
|
|
108
111
|
? props.theme.colors.red
|
109
112
|
: props.hasLength
|
110
113
|
? props.theme.colors.primary
|
111
|
-
|
114
|
+
: props.theme.colors.mediumGray};
|
112
115
|
`
|
113
116
|
|
114
|
-
const ErrorMessage = styled.div`
|
117
|
+
const ErrorMessage = styled.div`
|
115
118
|
font-size: 14px;
|
116
119
|
color: ${(props) => props.theme.colors.red};
|
117
120
|
padding-top: 16px;
|
118
121
|
`
|
119
122
|
|
120
|
-
export default {
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
},
|
129
|
-
data() {
|
130
|
-
return {
|
131
|
-
textInput: "",
|
132
|
-
numberPrecision: 0, // we set this on created. By default is 0
|
133
|
-
minValue: 0,
|
134
|
-
maxValue: 100,
|
135
|
-
}
|
136
|
-
},
|
137
|
-
props: {
|
138
|
-
placeholder: {
|
139
|
-
required: false,
|
140
|
-
default: "",
|
141
|
-
},
|
142
|
-
isError: {
|
143
|
-
required: false,
|
144
|
-
default: false,
|
145
|
-
},
|
146
|
-
question: {
|
147
|
-
required: true,
|
123
|
+
export default {
|
124
|
+
name: "InputNumberQuestion",
|
125
|
+
components: {
|
126
|
+
Container,
|
127
|
+
InputContainer,
|
128
|
+
InputWrapper,
|
129
|
+
UnitContainer,
|
130
|
+
ErrorMessage,
|
148
131
|
},
|
149
|
-
|
150
|
-
|
151
|
-
|
132
|
+
props: {
|
133
|
+
placeholder: {
|
134
|
+
required: false,
|
135
|
+
default: "",
|
136
|
+
},
|
137
|
+
isError: {
|
138
|
+
required: false,
|
139
|
+
default: false,
|
140
|
+
},
|
141
|
+
question: {
|
142
|
+
required: true,
|
143
|
+
},
|
144
|
+
inputWidth: {
|
145
|
+
required: false,
|
146
|
+
default: null,
|
147
|
+
},
|
148
|
+
value: {
|
149
|
+
required: true,
|
150
|
+
default: null,
|
151
|
+
},
|
152
|
+
clearInput: {
|
153
|
+
required: false,
|
154
|
+
default: false,
|
155
|
+
},
|
156
|
+
errorMessage: {
|
157
|
+
required: false,
|
158
|
+
default: "Please insert a correct number",
|
159
|
+
},
|
152
160
|
},
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
default: false,
|
160
|
-
},
|
161
|
-
errorMessage: {
|
162
|
-
required: false,
|
163
|
-
default: "Please insert a correct number",
|
164
|
-
},
|
165
|
-
},
|
166
|
-
methods: {
|
167
|
-
onChangeHandler($event) {
|
168
|
-
this.textInput = $event
|
169
|
-
let formattedValue = stringToNumber({
|
170
|
-
value: $event,
|
171
|
-
numberPrecision: this.numberPrecision,
|
172
|
-
})
|
173
|
-
if (isNaN(formattedValue)) {
|
174
|
-
this.textInput = ""
|
175
|
-
formattedValue = ""
|
161
|
+
data() {
|
162
|
+
return {
|
163
|
+
textInput: "",
|
164
|
+
numberPrecision: 0, // we set this on created. By default is 0
|
165
|
+
minValue: 0,
|
166
|
+
maxValue: 100,
|
176
167
|
}
|
177
|
-
this.$emit("input-change", formattedValue)
|
178
168
|
},
|
179
|
-
|
180
|
-
|
181
|
-
value
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
169
|
+
watch: {
|
170
|
+
clearInput: function(value) {
|
171
|
+
if (value) {
|
172
|
+
// If the value is typed, then we should clear the textInput on Continue
|
173
|
+
this.textInput = ""
|
174
|
+
}
|
175
|
+
},
|
176
|
+
question: function(value) {
|
177
|
+
this.numberPrecision = value.number_format_precision
|
178
|
+
this.minValue = value.number_min_allowed
|
179
|
+
this.maxValue = value.number_max_allowed
|
180
|
+
},
|
188
181
|
},
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
})
|
199
|
-
}
|
200
|
-
},
|
201
|
-
watch: {
|
202
|
-
clearInput: function (value) {
|
203
|
-
if (value) {
|
204
|
-
// If the value is typed, then we should clear the textInput on Continue
|
205
|
-
this.textInput = ""
|
182
|
+
created() {
|
183
|
+
this.numberPrecision = this.question.number_format_precision
|
184
|
+
this.minValue = this.question.number_min_allowed
|
185
|
+
this.maxValue = this.question.number_max_allowed
|
186
|
+
if (this.value) {
|
187
|
+
this.textInput = numberToString({
|
188
|
+
value: this.value,
|
189
|
+
numberPrecision: this.numberPrecision,
|
190
|
+
})
|
206
191
|
}
|
207
192
|
},
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
193
|
+
methods: {
|
194
|
+
onChangeHandler($event) {
|
195
|
+
this.textInput = $event
|
196
|
+
let formattedValue = stringToNumber({
|
197
|
+
value: $event,
|
198
|
+
numberPrecision: this.numberPrecision,
|
199
|
+
})
|
200
|
+
if (isNaN(formattedValue)) {
|
201
|
+
this.textInput = ""
|
202
|
+
formattedValue = ""
|
203
|
+
}
|
204
|
+
this.$emit("input-change", formattedValue)
|
205
|
+
},
|
206
|
+
onInputBlur() {
|
207
|
+
let num = stringToNumber({
|
208
|
+
value: this.textInput,
|
209
|
+
numberPrecision: this.numberPrecision,
|
210
|
+
})
|
211
|
+
this.textInput = numberToString({
|
212
|
+
value: num,
|
213
|
+
numberPrecision: this.numberPrecision,
|
214
|
+
})
|
215
|
+
},
|
212
216
|
},
|
213
|
-
}
|
214
|
-
}
|
217
|
+
}
|
215
218
|
</script>
|