@eturnity/eturnity_reusable_components 6.38.0 → 6.39.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
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@eturnity/eturnity_reusable_components",
|
3
|
-
"version": "6.
|
3
|
+
"version": "6.39.1",
|
4
4
|
"private": false,
|
5
5
|
"scripts": {
|
6
6
|
"dev": "vue-cli-service serve",
|
@@ -60,4 +60,4 @@
|
|
60
60
|
"author": "Aaron Enser",
|
61
61
|
"license": "ISC",
|
62
62
|
"homepage": "https://bitbucket.org/eturnitydevs/eturnity_reusable_components#readme"
|
63
|
-
}
|
63
|
+
}
|
@@ -5,6 +5,7 @@
|
|
5
5
|
:minWidth="minWidth"
|
6
6
|
:isDisabled="isDisabled"
|
7
7
|
:customColor="customColor"
|
8
|
+
:noWrap="noWrap"
|
8
9
|
>
|
9
10
|
{{ text }}
|
10
11
|
</button-container>
|
@@ -26,7 +27,7 @@ import styled from "vue-styled-components"
|
|
26
27
|
|
27
28
|
const PageContainer = styled.div``
|
28
29
|
|
29
|
-
const ButtonAttrs = { type: String, isDisabled: Boolean, minWidth: String, customColor: String }
|
30
|
+
const ButtonAttrs = { type: String, isDisabled: Boolean, minWidth: String, customColor: String, noWrap: Boolean }
|
30
31
|
const ButtonContainer = styled("div", ButtonAttrs)`
|
31
32
|
padding: 7px 15px;
|
32
33
|
font-size: 13px;
|
@@ -48,6 +49,7 @@ const ButtonContainer = styled("div", ButtonAttrs)`
|
|
48
49
|
cursor: ${(props) => (props.isDisabled ? "not-allowed" : "pointer")};
|
49
50
|
user-select: none;
|
50
51
|
${(props) => (props.minWidth ? `min-width: ${props.minWidth};` : '')};
|
52
|
+
${(props) => (props.noWrap ? `white-space: nowrap;` : '')};
|
51
53
|
|
52
54
|
&:hover {
|
53
55
|
opacity: ${(props) => (props.isDisabled ? "1" : "0.8")};
|
@@ -80,6 +82,10 @@ export default {
|
|
80
82
|
required: false,
|
81
83
|
default: null,
|
82
84
|
},
|
85
|
+
noWrap: {
|
86
|
+
required: false,
|
87
|
+
default: false
|
88
|
+
},
|
83
89
|
minWidth: {
|
84
90
|
required: false,
|
85
91
|
default: null
|
@@ -311,7 +311,8 @@ export default {
|
|
311
311
|
return {
|
312
312
|
textInput: '',
|
313
313
|
isFocused: false,
|
314
|
-
warningIcon: warningIcon
|
314
|
+
warningIcon: warningIcon,
|
315
|
+
isBlurred: false
|
315
316
|
}
|
316
317
|
},
|
317
318
|
props: {
|
@@ -488,7 +489,9 @@ export default {
|
|
488
489
|
return num
|
489
490
|
}
|
490
491
|
})
|
491
|
-
let evaluated
|
492
|
+
let evaluated
|
493
|
+
formatted = this.removeStringItemsAfterLastNumber(formatted)
|
494
|
+
evaluated = eval(formatted.join(' '))
|
492
495
|
if (typeof evaluated === 'string') {
|
493
496
|
evaluated = stringToNumber({
|
494
497
|
value: evaluated,
|
@@ -499,7 +502,32 @@ export default {
|
|
499
502
|
}
|
500
503
|
return evaluated
|
501
504
|
},
|
505
|
+
removeStringItemsAfterLastNumber(array) {
|
506
|
+
// fixed in EPDM-6487, in order to prevent 'Unexpected end of input'
|
507
|
+
let lastNumberIndex = -1
|
508
|
+
// Find the index of the last number in the array
|
509
|
+
for (let i = array.length - 1; i >= 0; i--) {
|
510
|
+
if (typeof array[i] === 'number') {
|
511
|
+
lastNumberIndex = i
|
512
|
+
break
|
513
|
+
}
|
514
|
+
}
|
515
|
+
// if there are no numbers, return an empty array
|
516
|
+
if (lastNumberIndex === -1) {
|
517
|
+
return []
|
518
|
+
}
|
519
|
+
// Remove non-numeric items after the last number
|
520
|
+
if (lastNumberIndex !== -1) {
|
521
|
+
const newArray = array.slice(0, lastNumberIndex + 1)
|
522
|
+
return newArray
|
523
|
+
}
|
524
|
+
return array
|
525
|
+
},
|
502
526
|
onInput(value) {
|
527
|
+
if (this.isBlurred) {
|
528
|
+
this.isBlurred = false
|
529
|
+
return
|
530
|
+
}
|
503
531
|
if (value === '') {
|
504
532
|
this.$emit('on-input', '')
|
505
533
|
}
|
@@ -514,6 +542,8 @@ export default {
|
|
514
542
|
},
|
515
543
|
onInputBlur(e) {
|
516
544
|
this.isFocused = false
|
545
|
+
// setting isBlurred so we don't trigger onInput as well
|
546
|
+
this.isBlurred = true
|
517
547
|
let value = e.target.value
|
518
548
|
let evaluatedInput = this.onEvaluateCode(value)
|
519
549
|
this.onChangeHandler(evaluatedInput ? evaluatedInput : value)
|
@@ -20,7 +20,9 @@ export const stringToNumber = ({
|
|
20
20
|
selectedLang === 'de-be' ||
|
21
21
|
selectedLang === 'es-es' ||
|
22
22
|
selectedLang === 'de' ||
|
23
|
+
selectedLang === 'de-at' ||
|
23
24
|
selectedLang === 'it' ||
|
25
|
+
selectedLang === 'it-it' ||
|
24
26
|
selectedLang === 'nl-nl' ||
|
25
27
|
selectedLang === 'nl-be'
|
26
28
|
) {
|
@@ -8,6 +8,8 @@ export const translateLang = (lang) => {
|
|
8
8
|
return 'english_uk'
|
9
9
|
} else if (lang === 'de' || lang === 'de-de') {
|
10
10
|
return 'german'
|
11
|
+
} else if (lang === 'de-at') {
|
12
|
+
return 'german_at'
|
11
13
|
} else if (lang === 'de-ch') {
|
12
14
|
return 'german_ch'
|
13
15
|
} else if (lang === 'de-lu') {
|
@@ -34,8 +36,10 @@ export const translateLang = (lang) => {
|
|
34
36
|
return 'swedish'
|
35
37
|
} else if (lang === 'no-no' || lang === 'nb-no') {
|
36
38
|
return 'norwegian'
|
37
|
-
} else if (lang === 'nl-nl'
|
38
|
-
return '
|
39
|
+
} else if (lang === 'nl-nl') {
|
40
|
+
return 'dutch_nl'
|
41
|
+
} else if (lang === 'nl-be') {
|
42
|
+
return 'dutch_be'
|
39
43
|
} else if (lang === 'cs') {
|
40
44
|
return 'czech'
|
41
45
|
} else if (lang === 'fi-fi') {
|