@eturnity/eturnity_reusable_components 1.2.2-EPDM-4371.1 → 1.2.2-EPDM-5243.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/package.json +3 -2
- package/src/App.vue +68 -54
- package/src/assets/icons/warning_icon.svg +3 -0
- package/src/assets/svgIcons/2D_Inactive.svg +8 -0
- package/src/assets/svgIcons/2D_active.svg +7 -0
- package/src/assets/svgIcons/3D_Active.svg +7 -0
- package/src/assets/svgIcons/3D_Inactive.svg +8 -0
- package/src/assets/svgIcons/Activate_panels_Active.svg +22 -0
- package/src/assets/svgIcons/Activate_panels_Inactive.svg +20 -0
- package/src/assets/svgIcons/Add_icon-1.svg +3 -0
- package/src/assets/svgIcons/Add_icon.svg +4 -0
- package/src/assets/svgIcons/Address_book.svg +3 -0
- package/src/assets/svgIcons/All_good-1.svg +3 -0
- package/src/assets/svgIcons/All_good.svg +4 -0
- package/src/assets/svgIcons/Angle_Active.svg +5 -0
- package/src/assets/svgIcons/Angle_Inactive.svg +4 -0
- package/src/assets/svgIcons/Area_Active.svg +11 -0
- package/src/assets/svgIcons/Area_Inactive.svg +26 -0
- package/src/assets/svgIcons/Arrow_down.svg +2 -0
- package/src/assets/svgIcons/Arrow_left.svg +2 -0
- package/src/assets/svgIcons/Arrow_right.svg +2 -0
- package/src/assets/svgIcons/Arrow_up.svg +2 -0
- package/src/assets/svgIcons/Attachment.svg +3 -0
- package/src/assets/svgIcons/BOM.svg +3 -0
- package/src/assets/svgIcons/Battery.svg +3 -0
- package/src/assets/svgIcons/Bell.svg +3 -0
- package/src/assets/svgIcons/Bold.svg +3 -0
- package/src/assets/svgIcons/Bubble.svg +3 -0
- package/src/assets/svgIcons/Bullet_list.svg +8 -0
- package/src/assets/svgIcons/Calendar.svg +7 -0
- package/src/assets/svgIcons/Calendar_icon.svg +7 -0
- package/src/assets/svgIcons/Call.svg +3 -0
- package/src/assets/svgIcons/Camera.svg +3 -0
- package/src/assets/svgIcons/Car.svg +3 -0
- package/src/assets/svgIcons/Cart.svg +3 -0
- package/src/assets/svgIcons/Checkbox.svg +3 -0
- package/src/assets/svgIcons/Clear_formatting.svg +7 -0
- package/src/assets/svgIcons/Clip.svg +3 -0
- package/src/assets/svgIcons/Clock.svg +4 -0
- package/src/assets/svgIcons/Close_for_modals,_tool_tips.svg +4 -0
- package/src/assets/svgIcons/Collapse.svg +4 -0
- package/src/assets/svgIcons/Context_menu-1.svg +6 -0
- package/src/assets/svgIcons/Context_menu-2.svg +4 -0
- package/src/assets/svgIcons/Context_menu.svg +5 -0
- package/src/assets/svgIcons/Current_variant.svg +4 -0
- package/src/assets/svgIcons/Deadline.svg +4 -0
- package/src/assets/svgIcons/Delete.svg +4 -0
- package/src/assets/svgIcons/Delete_area_Active.svg +16 -0
- package/src/assets/svgIcons/Delete_area_Inactive.svg +15 -0
- package/src/assets/svgIcons/Direction_Active-1.svg +12 -0
- package/src/assets/svgIcons/Direction_Active.svg +5 -0
- package/src/assets/svgIcons/Direction_Inactive.svg +4 -0
- package/src/assets/svgIcons/Distances_Active.svg +9 -0
- package/src/assets/svgIcons/Distances_Inactive.svg +8 -0
- package/src/assets/svgIcons/Downarrow.svg +3 -0
- package/src/assets/svgIcons/Duplicate-1.svg +8 -0
- package/src/assets/svgIcons/Duplicate-2.svg +5 -0
- package/src/assets/svgIcons/Duplicate-3.svg +3 -0
- package/src/assets/svgIcons/Duplicate.svg +4 -0
- package/src/assets/svgIcons/EMS-1.svg +3 -0
- package/src/assets/svgIcons/EMS.svg +3 -0
- package/src/assets/svgIcons/Edit_button.svg +3 -0
- package/src/assets/svgIcons/Email.svg +3 -0
- package/src/assets/svgIcons/End_of_the_list.svg +5 -0
- package/src/assets/svgIcons/Fav_icon.svg +4 -0
- package/src/assets/svgIcons/Financing_for_PV-1.svg +5 -0
- package/src/assets/svgIcons/Financing_for_PV-2.svg +3 -0
- package/src/assets/svgIcons/Financing_for_PV.svg +6 -0
- package/src/assets/svgIcons/Finish-1.svg +4 -0
- package/src/assets/svgIcons/Finish.svg +3 -0
- package/src/assets/svgIcons/Folder.svg +3 -0
- package/src/assets/svgIcons/Frame_34.svg +5 -0
- package/src/assets/svgIcons/Frame_45.svg +3 -0
- package/src/assets/svgIcons/Frame_47.svg +4 -0
- package/src/assets/svgIcons/Frame_50.svg +4 -0
- package/src/assets/svgIcons/Frame_56.svg +4 -0
- package/src/assets/svgIcons/Frame_57.svg +4 -0
- package/src/assets/svgIcons/Frame_59.svg +3 -0
- package/src/assets/svgIcons/Frame_60.svg +5 -0
- package/src/assets/svgIcons/House.svg +3 -0
- package/src/assets/svgIcons/Icon-1.svg +6 -0
- package/src/assets/svgIcons/Icon.svg +4 -0
- package/src/assets/svgIcons/Initial_situation.svg +3 -0
- package/src/assets/svgIcons/Intro-tour-1.svg +3 -0
- package/src/assets/svgIcons/Intro-tour.svg +3 -0
- package/src/assets/svgIcons/Italic.svg +3 -0
- package/src/assets/svgIcons/Key.svg +3 -0
- package/src/assets/svgIcons/Lead_provider.svg +4 -0
- package/src/assets/svgIcons/Length_in_2D_Active.svg +12 -0
- package/src/assets/svgIcons/Length_in_2D_Inactive.svg +13 -0
- package/src/assets/svgIcons/Light_bulb.svg +3 -0
- package/src/assets/svgIcons/Line_graph.svg +3 -0
- package/src/assets/svgIcons/Location.svg +3 -0
- package/src/assets/svgIcons/Lock.svg +3 -0
- package/src/assets/svgIcons/Loop.svg +3 -0
- package/src/assets/svgIcons/Lunch.svg +4 -0
- package/src/assets/svgIcons/Map_icon.svg +3 -0
- package/src/assets/svgIcons/Meeting.svg +6 -0
- package/src/assets/svgIcons/New_area_Inactive.svg +11 -0
- package/src/assets/svgIcons/Next.svg +4 -0
- package/src/assets/svgIcons/Not_equal_to.svg +3 -0
- package/src/assets/svgIcons/Numbered_list.svg +6 -0
- package/src/assets/svgIcons/Obstacle_tool.svg +13 -0
- package/src/assets/svgIcons/PV.svg +3 -0
- package/src/assets/svgIcons/Pan_tool.svg +12 -0
- package/src/assets/svgIcons/Panels_tool.svg +8 -0
- package/src/assets/svgIcons/Pen_tool.svg +4 -0
- package/src/assets/svgIcons/Picker_tool.svg +4 -0
- package/src/assets/svgIcons/Picture.svg +3 -0
- package/src/assets/svgIcons/Pin.svg +5 -0
- package/src/assets/svgIcons/Presentation.svg +3 -0
- package/src/assets/svgIcons/Previous.svg +4 -0
- package/src/assets/svgIcons/Profile-1.svg +4 -0
- package/src/assets/svgIcons/Profile.svg +4 -0
- package/src/assets/svgIcons/Profitability.svg +3 -0
- package/src/assets/svgIcons/Project_analysis.svg +4 -0
- package/src/assets/svgIcons/Project_settings.svg +4 -0
- package/src/assets/svgIcons/Rotate_view.svg +5 -0
- package/src/assets/svgIcons/Row_1.svg +33 -0
- package/src/assets/svgIcons/Row_2.svg +38 -0
- package/src/assets/svgIcons/Row_3.svg +21 -0
- package/src/assets/svgIcons/Run_simulation.svg +3 -0
- package/src/assets/svgIcons/Scaling_tool.svg +8 -0
- package/src/assets/svgIcons/Search.svg +3 -0
- package/src/assets/svgIcons/Security.svg +3 -0
- package/src/assets/svgIcons/Settings.svg +3 -0
- package/src/assets/svgIcons/Show_in_a_new_tab.svg +12 -0
- package/src/assets/svgIcons/Smartphone.svg +4 -0
- package/src/assets/svgIcons/Sorting.svg +4 -0
- package/src/assets/svgIcons/Start_of_the_list.svg +5 -0
- package/src/assets/svgIcons/Strikethrough.svg +4 -0
- package/src/assets/svgIcons/Subsidies-1.svg +5 -0
- package/src/assets/svgIcons/Subsidies-2.svg +3 -0
- package/src/assets/svgIcons/Subsidies.svg +3 -0
- package/src/assets/svgIcons/Subtract_icon.svg +3 -0
- package/src/assets/svgIcons/Suitcase.svg +3 -0
- package/src/assets/svgIcons/Template_icon_not_clickable.svg +6 -0
- package/src/assets/svgIcons/Truck.svg +3 -0
- package/src/assets/svgIcons/Underlined.svg +3 -0
- package/src/assets/svgIcons/Uparrow.svg +3 -0
- package/src/assets/svgIcons/Upload_avatar-1.svg +12 -0
- package/src/assets/svgIcons/Upload_avatar.svg +5 -0
- package/src/assets/svgIcons/Upload_image.svg +8 -0
- package/src/assets/svgIcons/Virtual_storage.svg +4 -0
- package/src/assets/svgIcons/Warning.svg +4 -0
- package/src/assets/svgIcons/Way.svg +5 -0
- package/src/assets/svgIcons/Wifi.svg +3 -0
- package/src/assets/svgIcons/Winter.svg +3 -0
- package/src/assets/svgIcons/inverter-1.svg +5 -0
- package/src/assets/svgIcons/inverter.svg +3 -0
- package/src/components/icons/index.vue +75 -0
- package/src/components/inputs/inputNumber/index.vue +74 -108
- package/src/assets/icons/error_icon copy.png +0 -0
- package/src/components/errorMessage/index.vue +0 -62
|
@@ -37,11 +37,6 @@
|
|
|
37
37
|
:isError="isError"
|
|
38
38
|
>{{ unitName }}</unit-container
|
|
39
39
|
>
|
|
40
|
-
<icon
|
|
41
|
-
v-if="(isError || inputIcon) && !showLinearUnitName"
|
|
42
|
-
:class="inputIconImageClass"
|
|
43
|
-
:src="isError ? warningIcon : inputIconImage"
|
|
44
|
-
/>
|
|
45
40
|
</input-wrapper>
|
|
46
41
|
<error-message v-if="isError">{{ errorMessage }}</error-message>
|
|
47
42
|
</container>
|
|
@@ -73,14 +68,13 @@
|
|
|
73
68
|
// :minNumber="0"
|
|
74
69
|
// fontColor="blue"
|
|
75
70
|
// />
|
|
76
|
-
import styled from
|
|
71
|
+
import styled from "vue-styled-components"
|
|
77
72
|
import {
|
|
78
73
|
stringToNumber,
|
|
79
|
-
numberToString
|
|
80
|
-
} from
|
|
81
|
-
import InfoText from
|
|
82
|
-
|
|
83
|
-
import warningIcon from '../../../assets/icons/error_icon.png'
|
|
74
|
+
numberToString,
|
|
75
|
+
} from "../../../helpers/numberConverter"
|
|
76
|
+
import InfoText from "../../infoText"
|
|
77
|
+
|
|
84
78
|
const Container = styled.div`
|
|
85
79
|
width: 100%;
|
|
86
80
|
position: relative;
|
|
@@ -95,31 +89,31 @@ const inputProps = {
|
|
|
95
89
|
noBorder: Boolean,
|
|
96
90
|
textAlign: String,
|
|
97
91
|
fontSize: String,
|
|
98
|
-
fontColor: String
|
|
92
|
+
fontColor: String,
|
|
99
93
|
}
|
|
100
|
-
const InputContainer = styled(
|
|
94
|
+
const InputContainer = styled("input", inputProps)`
|
|
101
95
|
border: ${(props) =>
|
|
102
96
|
props.isError
|
|
103
|
-
?
|
|
97
|
+
? "1px solid " + props.theme.colors.red
|
|
104
98
|
: props.noBorder
|
|
105
|
-
?
|
|
106
|
-
:
|
|
99
|
+
? "none"
|
|
100
|
+
: "1px solid " + props.theme.colors.mediumGray};
|
|
107
101
|
padding: ${(props) =>
|
|
108
|
-
props.hasUnit ?
|
|
102
|
+
props.hasUnit ? "11px 40px 11px 10px" : "11px 5px 11px 10px"};
|
|
109
103
|
border-radius: 4px;
|
|
110
104
|
text-align: ${(props) => props.textAlign};
|
|
111
|
-
cursor: ${(props) => (props.isDisabled ?
|
|
112
|
-
font-size: ${(props) => (props.fontSize ? props.fontSize :
|
|
105
|
+
cursor: ${(props) => (props.isDisabled ? "not-allowed" : "auto")};
|
|
106
|
+
font-size: ${(props) => (props.fontSize ? props.fontSize : "13px")};
|
|
113
107
|
color: ${(props) =>
|
|
114
108
|
props.isError
|
|
115
109
|
? props.theme.colors.red
|
|
116
110
|
: props.fontColor
|
|
117
|
-
? props.fontColor +
|
|
111
|
+
? props.fontColor + " !important"
|
|
118
112
|
: props.theme.colors.black};
|
|
119
|
-
width: ${(props) => (props.inputWidth ? props.inputWidth :
|
|
120
|
-
min-width: ${(props) => (props.minWidth ? props.minWidth :
|
|
113
|
+
width: ${(props) => (props.inputWidth ? props.inputWidth : "100%")};
|
|
114
|
+
min-width: ${(props) => (props.minWidth ? props.minWidth : "unset")};
|
|
121
115
|
background-color: ${(props) =>
|
|
122
|
-
props.isDisabled ? props.theme.colors.grey5 :
|
|
116
|
+
props.isDisabled ? props.theme.colors.grey5 : "#fff"};
|
|
123
117
|
box-sizing: border-box;
|
|
124
118
|
|
|
125
119
|
&::placeholder {
|
|
@@ -131,21 +125,12 @@ const InputContainer = styled('input', inputProps)`
|
|
|
131
125
|
outline: none;
|
|
132
126
|
}
|
|
133
127
|
`
|
|
134
|
-
const IconProps = {
|
|
135
|
-
inputIconHeight: String
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
const Icon = styled('img', IconProps)`
|
|
139
|
-
position: absolute;
|
|
140
|
-
right: 10px;
|
|
141
|
-
top: 2px;
|
|
142
|
-
`
|
|
143
128
|
|
|
144
129
|
const InputWrapper = styled.span`
|
|
145
130
|
position: relative;
|
|
146
131
|
`
|
|
147
132
|
|
|
148
|
-
const UnitContainer = styled(
|
|
133
|
+
const UnitContainer = styled("span", inputProps)`
|
|
149
134
|
border-left: 1px solid
|
|
150
135
|
${(props) =>
|
|
151
136
|
props.isError
|
|
@@ -165,14 +150,12 @@ const UnitContainer = styled('span', inputProps)`
|
|
|
165
150
|
: props.theme.colors.mediumGray};
|
|
166
151
|
`
|
|
167
152
|
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
// position: absolute;
|
|
175
|
-
// `
|
|
153
|
+
const ErrorMessage = styled.div`
|
|
154
|
+
font-size: 14px;
|
|
155
|
+
color: ${(props) => props.theme.colors.red};
|
|
156
|
+
position: absolute;
|
|
157
|
+
top: calc(100% + 1px);
|
|
158
|
+
`
|
|
176
159
|
|
|
177
160
|
const LabelWrapper = styled.div`
|
|
178
161
|
display: flex;
|
|
@@ -186,7 +169,7 @@ const LabelText = styled.div`
|
|
|
186
169
|
`
|
|
187
170
|
|
|
188
171
|
export default {
|
|
189
|
-
name:
|
|
172
|
+
name: "input-number",
|
|
190
173
|
components: {
|
|
191
174
|
Container,
|
|
192
175
|
InputContainer,
|
|
@@ -196,147 +179,130 @@ export default {
|
|
|
196
179
|
LabelWrapper,
|
|
197
180
|
LabelText,
|
|
198
181
|
InfoText,
|
|
199
|
-
Icon
|
|
200
182
|
},
|
|
201
183
|
data() {
|
|
202
184
|
return {
|
|
203
|
-
textInput:
|
|
185
|
+
textInput: "",
|
|
204
186
|
isFocused: false,
|
|
205
|
-
warningIcon: warningIcon
|
|
206
187
|
}
|
|
207
188
|
},
|
|
208
189
|
props: {
|
|
209
190
|
placeholder: {
|
|
210
191
|
required: false,
|
|
211
|
-
default:
|
|
192
|
+
default: "",
|
|
212
193
|
},
|
|
213
194
|
isError: {
|
|
214
195
|
required: false,
|
|
215
|
-
default: false
|
|
196
|
+
default: false,
|
|
216
197
|
},
|
|
217
198
|
inputWidth: {
|
|
218
199
|
required: false,
|
|
219
|
-
default: null
|
|
200
|
+
default: null,
|
|
220
201
|
},
|
|
221
202
|
minWidth: {
|
|
222
203
|
required: false,
|
|
223
|
-
default: null
|
|
204
|
+
default: null,
|
|
224
205
|
},
|
|
225
206
|
value: {
|
|
226
207
|
required: true,
|
|
227
|
-
default: null
|
|
208
|
+
default: null,
|
|
228
209
|
},
|
|
229
210
|
clearInput: {
|
|
230
211
|
required: false,
|
|
231
|
-
default: false
|
|
212
|
+
default: false,
|
|
232
213
|
},
|
|
233
214
|
errorMessage: {
|
|
234
215
|
required: false,
|
|
235
|
-
default:
|
|
216
|
+
default: "Please insert a correct number",
|
|
236
217
|
},
|
|
237
218
|
numberPrecision: {
|
|
238
219
|
required: false,
|
|
239
|
-
default: 0
|
|
220
|
+
default: 0,
|
|
240
221
|
},
|
|
241
222
|
unitName: {
|
|
242
223
|
required: false,
|
|
243
|
-
default:
|
|
224
|
+
default: "",
|
|
244
225
|
},
|
|
245
226
|
showLinearUnitName: {
|
|
246
227
|
required: false,
|
|
247
|
-
default: false
|
|
228
|
+
default: false,
|
|
248
229
|
},
|
|
249
230
|
disabled: {
|
|
250
231
|
required: false,
|
|
251
|
-
default: false
|
|
232
|
+
default: false,
|
|
252
233
|
},
|
|
253
234
|
noBorder: {
|
|
254
235
|
required: false,
|
|
255
|
-
default: false
|
|
236
|
+
default: false,
|
|
256
237
|
},
|
|
257
238
|
textAlign: {
|
|
258
239
|
required: false,
|
|
259
|
-
default:
|
|
240
|
+
default: "left",
|
|
260
241
|
},
|
|
261
242
|
fontSize: {
|
|
262
243
|
required: false,
|
|
263
|
-
default:
|
|
244
|
+
default: "13px",
|
|
264
245
|
},
|
|
265
246
|
labelText: {
|
|
266
247
|
required: false,
|
|
267
|
-
default: null
|
|
248
|
+
default: null,
|
|
268
249
|
},
|
|
269
250
|
labelInfoText: {
|
|
270
251
|
required: false,
|
|
271
|
-
default: null
|
|
252
|
+
default: null,
|
|
272
253
|
},
|
|
273
254
|
labelInfoAlign: {
|
|
274
255
|
required: false,
|
|
275
|
-
default:
|
|
256
|
+
default: "right",
|
|
276
257
|
},
|
|
277
258
|
minNumber: {
|
|
278
259
|
required: false,
|
|
279
|
-
default: null
|
|
260
|
+
default: null,
|
|
280
261
|
},
|
|
281
262
|
fontColor: {
|
|
282
263
|
required: false,
|
|
283
|
-
default: null
|
|
264
|
+
default: null,
|
|
284
265
|
},
|
|
285
266
|
numberToStringEnabled: {
|
|
286
267
|
required: false,
|
|
287
|
-
default: true
|
|
268
|
+
default: true,
|
|
288
269
|
},
|
|
289
|
-
inputIcon: {
|
|
290
|
-
require: false,
|
|
291
|
-
type: Boolean,
|
|
292
|
-
default: false
|
|
293
|
-
},
|
|
294
|
-
inputIconImage: {
|
|
295
|
-
require: false,
|
|
296
|
-
type: String,
|
|
297
|
-
default: ''
|
|
298
|
-
},
|
|
299
|
-
inputIconImageClass: {
|
|
300
|
-
require: false,
|
|
301
|
-
type: Array,
|
|
302
|
-
default: () => []
|
|
303
|
-
}
|
|
304
270
|
},
|
|
305
271
|
methods: {
|
|
306
272
|
onChangeHandler(event) {
|
|
307
273
|
if (isNaN(event)) {
|
|
308
274
|
event = this.minNumber || this.minNumber === 0 ? this.minNumber : event
|
|
309
275
|
}
|
|
310
|
-
this.$emit(
|
|
276
|
+
this.$emit("input-change", event)
|
|
311
277
|
},
|
|
312
278
|
onEvaluateCode(val) {
|
|
313
279
|
// function to perform math on the code
|
|
314
280
|
// filter the string in case of any malicious content
|
|
315
|
-
let filtered = val.replace(/[^-()\d/*+.,]/g,
|
|
281
|
+
let filtered = val.replace(/[^-()\d/*+.,]/g, "")
|
|
316
282
|
filtered = filtered.split(/([-+*/()])/)
|
|
317
283
|
let formatted = filtered.map((item) => {
|
|
318
284
|
if (
|
|
319
|
-
item ===
|
|
320
|
-
item ===
|
|
321
|
-
item ===
|
|
322
|
-
item ===
|
|
323
|
-
item ===
|
|
324
|
-
item ===
|
|
325
|
-
item ===
|
|
285
|
+
item === "+" ||
|
|
286
|
+
item === "-" ||
|
|
287
|
+
item === "*" ||
|
|
288
|
+
item === "/" ||
|
|
289
|
+
item === "(" ||
|
|
290
|
+
item === ")" ||
|
|
291
|
+
item === ""
|
|
326
292
|
) {
|
|
327
293
|
return item
|
|
328
294
|
} else {
|
|
329
295
|
let num = stringToNumber({
|
|
330
296
|
value: item,
|
|
331
|
-
numberPrecision: false
|
|
297
|
+
numberPrecision: false,
|
|
332
298
|
})
|
|
333
299
|
return num
|
|
334
300
|
}
|
|
335
301
|
})
|
|
336
|
-
let evaluated = eval(formatted.join(
|
|
302
|
+
let evaluated = eval(formatted.join(""))
|
|
337
303
|
evaluated = stringToNumber({
|
|
338
304
|
value: evaluated,
|
|
339
|
-
numberPrecision: this.numberPrecision
|
|
305
|
+
numberPrecision: this.numberPrecision,
|
|
340
306
|
})
|
|
341
307
|
return evaluated
|
|
342
308
|
},
|
|
@@ -349,7 +315,7 @@ export default {
|
|
|
349
315
|
this.textInput = numberToString({
|
|
350
316
|
value:
|
|
351
317
|
evaluatedInput && value.length ? evaluatedInput : this.minNumber,
|
|
352
|
-
numberPrecision: this.numberPrecision
|
|
318
|
+
numberPrecision: this.numberPrecision,
|
|
353
319
|
})
|
|
354
320
|
}
|
|
355
321
|
let adjustedMinValue =
|
|
@@ -357,8 +323,8 @@ export default {
|
|
|
357
323
|
? value
|
|
358
324
|
: this.minNumber || this.minNumber === 0
|
|
359
325
|
? this.minNumber
|
|
360
|
-
:
|
|
361
|
-
this.$emit(
|
|
326
|
+
: ""
|
|
327
|
+
this.$emit("input-blur", adjustedMinValue)
|
|
362
328
|
},
|
|
363
329
|
focusInput() {
|
|
364
330
|
if (this.disabled) {
|
|
@@ -375,38 +341,38 @@ export default {
|
|
|
375
341
|
? value
|
|
376
342
|
: this.minNumber || this.minNumber === 0
|
|
377
343
|
? this.minNumber
|
|
378
|
-
:
|
|
344
|
+
: ""
|
|
379
345
|
if ((adjustedMinValue || adjustedMinValue === 0) && !this.isFocused) {
|
|
380
346
|
let input = this.numberToStringEnabled
|
|
381
347
|
? numberToString({
|
|
382
348
|
value: adjustedMinValue,
|
|
383
|
-
numberPrecision: this.numberPrecision
|
|
349
|
+
numberPrecision: this.numberPrecision,
|
|
384
350
|
})
|
|
385
351
|
: adjustedMinValue
|
|
386
|
-
let unit = this.showLinearUnitName ?
|
|
387
|
-
return input +
|
|
352
|
+
let unit = this.showLinearUnitName ? "" : this.unitName
|
|
353
|
+
return input + " " + unit
|
|
388
354
|
} else if (!adjustedMinValue && adjustedMinValue !== 0) {
|
|
389
|
-
return
|
|
355
|
+
return ""
|
|
390
356
|
} else {
|
|
391
357
|
return this.numberToStringEnabled
|
|
392
358
|
? numberToString({
|
|
393
359
|
value: adjustedMinValue,
|
|
394
|
-
numberPrecision: this.numberPrecision
|
|
360
|
+
numberPrecision: this.numberPrecision,
|
|
395
361
|
})
|
|
396
362
|
: adjustedMinValue
|
|
397
363
|
}
|
|
398
|
-
}
|
|
364
|
+
},
|
|
399
365
|
},
|
|
400
366
|
created() {
|
|
401
367
|
if (this.value) {
|
|
402
368
|
this.textInput = numberToString({
|
|
403
369
|
value: this.value,
|
|
404
|
-
numberPrecision: this.numberPrecision
|
|
370
|
+
numberPrecision: this.numberPrecision,
|
|
405
371
|
})
|
|
406
372
|
} else if (this.minNumber !== null) {
|
|
407
373
|
this.textInput = numberToString({
|
|
408
374
|
value: this.minNumber,
|
|
409
|
-
numberPrecision: this.numberPrecision
|
|
375
|
+
numberPrecision: this.numberPrecision,
|
|
410
376
|
})
|
|
411
377
|
}
|
|
412
378
|
},
|
|
@@ -414,9 +380,9 @@ export default {
|
|
|
414
380
|
clearInput: function (value) {
|
|
415
381
|
if (value) {
|
|
416
382
|
// If the value is typed, then we should clear the textInput on Continue
|
|
417
|
-
this.textInput =
|
|
383
|
+
this.textInput = ""
|
|
418
384
|
}
|
|
419
|
-
}
|
|
420
|
-
}
|
|
385
|
+
},
|
|
386
|
+
},
|
|
421
387
|
}
|
|
422
|
-
</script>
|
|
388
|
+
</script>
|
|
Binary file
|
|
@@ -1,62 +0,0 @@
|
|
|
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>
|