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