@eturnity/eturnity_reusable_components 1.1.78 → 1.1.81

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": "1.1.78",
3
+ "version": "1.1.81",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "dev": "vue-cli-service serve",
@@ -15,7 +15,7 @@
15
15
  'table-dropdown-item': item.type !== 'input',
16
16
  }"
17
17
  >
18
- <nested-container>
18
+ <nested-container :isNested="isNested">
19
19
  <nested-icon
20
20
  v-if="
21
21
  isNested &&
@@ -8,9 +8,12 @@ export const stringToNumber = ({ value, numberPrecision, allowNegative }) => {
8
8
  selectedLang === "it-CH" ||
9
9
  selectedLang === "no-no" ||
10
10
  selectedLang === "da-dk" ||
11
+ selectedLang === "de-lu" ||
12
+ selectedLang === "fr-lu" ||
13
+ selectedLang === "es-es" ||
11
14
  selectedLang === "de"
12
15
  ) {
13
- // replace commas with a dot, and dots with blank
16
+ // replace dots with blank, and commas with a dot: 1.234,56 --> 1234.56
14
17
  if (allowNegative) {
15
18
  newVal = newVal
16
19
  .replace(/[^\d-.,']/g, "")
@@ -23,7 +26,7 @@ export const stringToNumber = ({ value, numberPrecision, allowNegative }) => {
23
26
  .replace(/[,\s]/, ".")
24
27
  }
25
28
  } else if (selectedLang === "en-us") {
26
- // replace commas with blank
29
+ // replace commas with blank: 1,234.56 --> 1234.56
27
30
  if (allowNegative) {
28
31
  newVal = newVal.replace(/[^\d-.,']/g, "").replace(/[,\s]/g, "")
29
32
  } else {
@@ -34,7 +37,7 @@ export const stringToNumber = ({ value, numberPrecision, allowNegative }) => {
34
37
  selectedLang === "fr-ch" ||
35
38
  selectedLang === "it-ch"
36
39
  ) {
37
- // replace ' with blank
40
+ // replace ' with blank: 1'234.56 --> 1234.56
38
41
  if (allowNegative) {
39
42
  newVal = newVal.replace(/[^\d-.,']/g, "").replace(/['\s]/g, "")
40
43
  } else {
@@ -42,17 +45,19 @@ export const stringToNumber = ({ value, numberPrecision, allowNegative }) => {
42
45
  }
43
46
  } else if (
44
47
  selectedLang === "fr-fr" ||
45
- selectedLang === "fr" ||
46
- selectedLang === "sv-se"
48
+ selectedLang === "fr-be" ||
49
+ selectedLang === "sv-se" ||
50
+ selectedLang === "pt-pt" ||
51
+ selectedLang === "fr"
47
52
  ) {
48
- // replace space with blank, and commas with dot
53
+ // replace space with blank, and commas with dot: 1 234,56 --> 1234.56
49
54
  if (allowNegative) {
50
55
  newVal = newVal.replace(/[^\d-.,']/g, "").replace(/[,\s]/g, ".")
51
56
  } else {
52
57
  newVal = newVal.replace(/[^\d.,']/g, "").replace(/[,\s]/g, ".")
53
58
  }
54
59
  } else {
55
- // en-US as default
60
+ // en-US as default: 1,234.56 --> 1234.56
56
61
  if (allowNegative) {
57
62
  newVal = newVal.replace(/[^\d-.,']/g, "").replace(/[,\s]/g, "")
58
63
  } else {
@@ -0,0 +1,48 @@
1
+ export const translateLang = (lang) => {
2
+ // this is needed so that we use the correct keys for Phrase
3
+ if (lang === 'en') {
4
+ return 'english'
5
+ } else if (lang === 'en-us') {
6
+ return 'english_us'
7
+ } else if (lang === 'en-gb') {
8
+ return 'english_uk'
9
+ } else if (lang === 'de' || lang === 'de-de') {
10
+ return 'german'
11
+ } else if (lang === 'de-ch') {
12
+ return 'german_ch'
13
+ } else if (lang === 'de-lu') {
14
+ return 'german_lu'
15
+ } else if (lang === 'fr' || lang === 'fr-fr') {
16
+ return 'french'
17
+ } else if (lang === 'fr-be') {
18
+ return 'french_be'
19
+ } else if (lang === 'fr-lu') {
20
+ return 'french_lu'
21
+ } else if (lang === 'fr-ch') {
22
+ return 'french_ch'
23
+ } else if (lang === 'it' || lang === 'it-it') {
24
+ return 'italian'
25
+ } else if (lang === 'it-ch') {
26
+ return 'italian_ch'
27
+ } else if (lang === 'da-dk') {
28
+ return 'danish'
29
+ } else if (lang === 'pl-pl') {
30
+ return 'polish'
31
+ } else if (lang === 'sv-se') {
32
+ return 'swedish'
33
+ } else if (lang === 'no-no') {
34
+ return 'norwegian'
35
+ } else if (lang === 'nl-nl' || lang === 'nl') {
36
+ return 'nl-nl'
37
+ } else if (lang === 'cs') {
38
+ return 'czech'
39
+ } else if (lang === 'fi-fi') {
40
+ return 'finnish'
41
+ } else if (lang === 'pt-pt') {
42
+ return 'portuguese'
43
+ } else if (lang === 'es-es') {
44
+ return 'spanish'
45
+ } else {
46
+ return lang
47
+ }
48
+ }