@eturnity/eturnity_reusable_components 6.33.1-EPDM-7762.3 → 6.33.1-EPDM-6487.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
package/src/assets/theme.js
CHANGED
@@ -3,7 +3,7 @@ const theme = {
|
|
3
3
|
primary: '#48a2d0',
|
4
4
|
secondary: '#fdb813',
|
5
5
|
tertiary: '#d5d5d5',
|
6
|
-
black: '#
|
6
|
+
black: '#353535',
|
7
7
|
yellow: '#fdb813',
|
8
8
|
darkGray: '#818181',
|
9
9
|
gray1: '#666',
|
@@ -20,8 +20,8 @@ const theme = {
|
|
20
20
|
grey5: '#fafafa',
|
21
21
|
grey6: '#555d61',
|
22
22
|
green: '#99db0c',
|
23
|
-
transparentWhite1:
|
24
|
-
transparentBlack1:
|
23
|
+
transparentWhite1:'#ffffff32',
|
24
|
+
transparentBlack1:'#263238e6',
|
25
25
|
disabled: '#dfe1e1',
|
26
26
|
eturnityGrey: '#263238'
|
27
27
|
},
|
@@ -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)
|
@@ -14,11 +14,9 @@
|
|
14
14
|
labelFontColor || colorMode == 'dark' ? 'white' : 'eturnityGrey'
|
15
15
|
"
|
16
16
|
:fontSize="fontSize"
|
17
|
-
>{{ label }}
|
18
|
-
|
19
|
-
|
20
|
-
>
|
21
|
-
</input-label>
|
17
|
+
>{{ label }} <optionalLabel v-if="labelOptional"> ({{ $gettext('Optional') }})</optionalLabel>
|
18
|
+
</input-label
|
19
|
+
>
|
22
20
|
<info-text
|
23
21
|
v-if="infoTextMessage"
|
24
22
|
:text="infoTextMessage"
|
@@ -93,7 +91,9 @@
|
|
93
91
|
:hoveredIndex="hoveredIndex"
|
94
92
|
:isActive="isActive"
|
95
93
|
:optionWidth="optionWidth"
|
96
|
-
:
|
94
|
+
:bgColor="
|
95
|
+
dropdownBgColor || colorMode == 'dark' ? 'black' : 'white'
|
96
|
+
"
|
97
97
|
:fontColor="
|
98
98
|
dropdownFontColor || colorMode == 'dark' ? 'white' : 'black'
|
99
99
|
"
|
@@ -151,7 +151,7 @@ const Selector = styled.div`
|
|
151
151
|
width: 100%;
|
152
152
|
`
|
153
153
|
|
154
|
-
const labelAttrs = { fontSize: String
|
154
|
+
const labelAttrs = { fontSize: String }
|
155
155
|
const InputLabel = styled('div', labelAttrs)`
|
156
156
|
color: ${(props) =>
|
157
157
|
props.theme.colors[props.fontColor]
|
@@ -162,6 +162,7 @@ const InputLabel = styled('div', labelAttrs)`
|
|
162
162
|
`
|
163
163
|
const optionalLabel = styled.span`
|
164
164
|
font-weight: 300;
|
165
|
+
|
165
166
|
`
|
166
167
|
const inputProps = { selectWidth: String, optionWidth: String }
|
167
168
|
const Container = styled('div', inputProps)`
|
@@ -197,10 +198,11 @@ const selectButton = styled('div', selectButtonAttrs)`
|
|
197
198
|
position: relative;
|
198
199
|
box-sizing: border-box;
|
199
200
|
border-radius: 4px;
|
200
|
-
padding: ${(props) =>
|
201
|
+
padding: ${(props) =>
|
202
|
+
props.isSearchBarVisible ? '0' : '0px 0px 0 15px'};
|
201
203
|
text-align: left;
|
202
204
|
border-radius: 4px;
|
203
|
-
min-height:
|
205
|
+
min-height: 36px;
|
204
206
|
display: flex;
|
205
207
|
align-items: center;
|
206
208
|
max-height: ${(props) => props.selectHeight};
|
@@ -222,7 +224,7 @@ const selectButton = styled('div', selectButtonAttrs)`
|
|
222
224
|
${(props) => (props.disabled ? 'pointer-events: none' : '')};
|
223
225
|
`
|
224
226
|
const selectDropdownAttrs = {
|
225
|
-
|
227
|
+
bgColor: String,
|
226
228
|
fontColor: String,
|
227
229
|
selectWidth: String,
|
228
230
|
optionWidth: String,
|
@@ -243,20 +245,20 @@ const selectDropdown = styled('div', selectDropdownAttrs)`
|
|
243
245
|
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
|
244
246
|
width: ${(props) => (props.optionWidth ? props.optionWidth : '100%')};
|
245
247
|
background-color:${(props) =>
|
246
|
-
props.theme.colors[props.
|
247
|
-
? props.theme.colors[props.
|
248
|
-
: props.
|
248
|
+
props.theme.colors[props.bgColor]
|
249
|
+
? props.theme.colors[props.bgColor]
|
250
|
+
: props.bgColor};
|
249
251
|
color:${(props) =>
|
250
252
|
props.theme.colors[props.fontColor]
|
251
253
|
? props.theme.colors[props.fontColor]
|
252
254
|
: props.fontColor};
|
253
255
|
max-height:300px;
|
254
256
|
overflow-y:auto;
|
257
|
+
& [data-value="${(props) => props.selectedValue}"]{
|
258
|
+
backdrop-filter: brightness(1.4);
|
259
|
+
}
|
255
260
|
&>div:nth-child(${(props) => props.hoveredIndex}){
|
256
|
-
|
257
|
-
props.theme.colors[props.hoveredBgColor]
|
258
|
-
? props.theme.colors[props.hoveredBgColor]
|
259
|
-
: props.hoveredBgColor};
|
261
|
+
backdrop-filter: brightness(1.2);
|
260
262
|
}
|
261
263
|
`
|
262
264
|
const DropdownWrapper = styled('div')`
|
@@ -323,8 +325,7 @@ export default {
|
|
323
325
|
required: false
|
324
326
|
},
|
325
327
|
dropdownBgColor: {
|
326
|
-
required: false
|
327
|
-
default: 'grey5'
|
328
|
+
required: false
|
328
329
|
},
|
329
330
|
dropdownFontColor: {
|
330
331
|
required: false
|
@@ -1,68 +1,59 @@
|
|
1
1
|
<template>
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
@click="clickHandler"
|
7
|
-
@mouseover="hoverHandler"
|
8
|
-
>
|
9
|
-
<slot></slot>
|
10
|
-
</optionContainer>
|
11
|
-
</template>
|
2
|
+
<optionContainer :data-value="value" :hoveredBgColor="hoveredBgColor || colorMode=='dark'?'#000000':'grey5'" @click="clickHandler" @mouseover="hoverHandler">
|
3
|
+
<slot></slot>
|
4
|
+
</optionContainer>
|
5
|
+
</template>
|
12
6
|
|
13
|
-
<script>
|
7
|
+
<script>
|
14
8
|
// import selectButton from './selectButton'
|
15
9
|
// import selectDropdown from './selectDropDown'
|
16
|
-
import styled from 'vue-styled-components'
|
17
|
-
const optionProps
|
18
|
-
const optionContainer = styled('div',
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
? props.theme.colors[props.hoveredBgColor]
|
33
|
-
: props.hoveredBgColor};
|
34
|
-
}
|
35
|
-
`
|
10
|
+
import styled from 'vue-styled-components'
|
11
|
+
const optionProps={hoveredBgColor:String}
|
12
|
+
const optionContainer = styled('div',optionProps)`
|
13
|
+
display:flex;
|
14
|
+
cursor: pointer;
|
15
|
+
flex-direction: row;
|
16
|
+
justify-content: space-between;
|
17
|
+
align-items: center;
|
18
|
+
padding: 12px 10px;
|
19
|
+
gap: 14px;
|
20
|
+
width:100%;
|
21
|
+
box-sizing:inherit;
|
22
|
+
&:hover{
|
23
|
+
background-color:${(props) => props.theme.colors[props.hoveredBgColor]?props.theme.colors[props.hoveredBgColor]:props.hoveredBgColor};
|
24
|
+
}
|
25
|
+
`
|
36
26
|
|
37
|
-
export default {
|
38
|
-
|
27
|
+
export default {
|
28
|
+
name: 'RCoption',
|
39
29
|
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
30
|
+
props: {
|
31
|
+
value: {
|
32
|
+
required: true
|
33
|
+
},
|
34
|
+
hoveredBgColor:{
|
35
|
+
required:false,
|
36
|
+
},
|
37
|
+
colorMode:{
|
38
|
+
required:false,
|
39
|
+
default:'light'
|
40
|
+
}
|
46
41
|
},
|
47
|
-
colorMode: {
|
48
|
-
required: false,
|
49
|
-
default: 'light'
|
50
|
-
}
|
51
|
-
},
|
52
42
|
|
53
|
-
|
43
|
+
components: {optionContainer},
|
54
44
|
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
45
|
+
data() {
|
46
|
+
return {}
|
47
|
+
},
|
48
|
+
methods:{
|
49
|
+
clickHandler(){
|
50
|
+
this.$parent.$emit('option-selected',this.value)
|
51
|
+
},
|
52
|
+
hoverHandler(){
|
53
|
+
this.$parent.$emit('option-hovered',this.value)
|
54
|
+
}
|
61
55
|
},
|
62
|
-
|
63
|
-
this.$parent.$emit('option-hovered', this.value)
|
56
|
+
computed: {
|
64
57
|
}
|
65
|
-
}
|
66
|
-
|
67
|
-
}
|
68
|
-
</script>
|
58
|
+
}
|
59
|
+
</script>
|